CODING QUESTION: ALERT SYSTEM

 

I would like an indicator to give alerts.. showing both time and price of signal e.g MACD bullish crossover at 11.20am at 1.086 on EURUSD

i think the generic syntax to be time , price and symbol

anyone willing to share a generic code that be used on any alert system

 
mwambaFX:
I would like an indicator to give alerts.. showing both time and price of signal e.g MACD bullish crossover at 11.20am at 1.086 on EURUSD

i think the generic syntax to be time , price and symbol

anyone willing to share a generic code that be used on any alert system

mwambaFX

You can use any of the alerting code from indicators with alerts for that

 

Thank you @mladen.. I have checked several.. However they only show symbol and time..

I would like one that shows price too e.g..symbol, time and price..

Thank you

 

Hi Mladen.. this own shows Symbol , Time and Alert ...i would like to to also show price at which the alert was formed..

void doAlert(int forBar, string doWhat)

{

static string previousAlert="nothing";

static datetime previousTime;

string message;

if (previousAlert != doWhat || previousTime != Time[forBar]) {

previousAlert = doWhat;

previousTime = Time[forBar];

//

//

//

//

//

message = StringConcatenate(Symbol()," ",timeFrameToString(Period())," at ",TimeToStr(TimeLocal(),TIME_SECONDS)," macd changed direction to ",doWhat);

if (alertsMessage) Alert(message);

if (alertsEmail) SendMail(StringConcatenate(Symbol()," macd "),message);

if (alertsSound) PlaySound("alert2.wav");

}

}
Reason: