stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Alert with arrows
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=719
Page 1 of 1
Author:  dynel14 [ Fri Jul 20, 2012 1:39 am ]
Post subject:  Alert with arrows

Hi @ll,

again I have so problems because of my coding skill ... :roll:

I use this code from hanover for my alerts:
extern int AlertCandle = 0;
extern bool ShowChartAlerts = true;
extern string Email_Subject = "Leave empty for no email";
extern string AlertEmailSubject = "";

datetime LastAlertTime = -999999;
string AlertTextCrossUp = "Possible long";
string AlertTextCrossDown = "Possible short";
ProcessAlerts();
void ProcessAlerts() {

if ((AlertCandle >= 0) && (Time[0] > LastAlertTime)) {

//---- alert UP
if (TrendUP[AlertCandle] == 1 && (SignalLabeled != 1)) {
string AlertText = Symbol() + "," + TFToStr(Period()) + ": " + AlertTextCrossUp;
if (ShowChartAlerts) Alert(AlertText);
if (AlertEmailSubject > "") SendMail(AlertEmailSubject,AlertText);
LastAlertTime = Time[0];
SignalLabeled = 1;
}

//---- alert DOWN
if (TrendDOWN[AlertCandle] == 1 && (SignalLabeled != 2)) {
AlertText = Symbol() + "," + TFToStr(Period()) + ": " + AlertTextCrossDown;
if (ShowChartAlerts) Alert(AlertText);
if (AlertEmailSubject > "") SendMail(AlertEmailSubject,AlertText);
LastAlertTime = Time[0];
SignalLabeled = 2;
}

}
return(0);
}
Everything is working fine. Now I want that the indicator shows an arrow with the alert. I have no idea how to do that. Have tried something, but nothing worked.

Hope someone can help me. Thx a lot!

dynel14
Author:  NeoTrader [ Fri Jul 20, 2012 5:13 am ]
Post subject:  Re: Alert with arrows

hi dynel 14,

use following code snippet as inspiration to add arrows to your chart...

Code: Select all

			objNameBuffer = StringConcatenate(objPrefix, "_", EntrySignalArrow, "_");
			ObjectDelete(objNameBuffer);
			ObjectCreate(objNameBuffer, OBJ_ARROW, 0, Time[PreviousBar1], EntrySignalPos);
			ObjectSet(objNameBuffer, OBJPROP_ARROWCODE, 233);
			ObjectSet(objNameBuffer, OBJPROP_COLOR, colourTrendUp);
			ObjectSet("EntryIcon", OBJPROP_BACK, FALSE);
			ObjectSet(objNameBuffer, OBJPROP_WIDTH, 2);
happy trading,

NeoTrader

-
All times are UTC Page 1 of 1