Alert with arrows

Post Reply
User avatar
dynel14
Trader
Posts: 37
Joined: Wed Nov 16, 2011 1:38 am
Location: Cologne/Germany

Alert with arrows

Post by dynel14 »

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
User avatar
NeoTrader
Trader
Posts: 436
Joined: Wed Apr 04, 2012 2:52 pm
Location: small Village at Lake Chiemsee, Bavaria, Germany

Re: Alert with arrows

Post by NeoTrader »

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

-
Post Reply

Return to “Coders Hangout”