How do I create a Simple pushnotification alert on the indicator below? - page 2

 
qjol:

is it so hard ?


How come I can't use this then and just replace the Alert function with SendNotification then?

if (SoundON) Alert("SELL signal at Ask=",Ask,"\n Bid=",Bid,"\n Date=",TimeToStr(CurTime(),TIME_DATE)," ",TimeHour(CurTime()),":",TimeMinute(CurTime()),"\n Symbol=",Symbol()," Period=",Period());

 
AQLIVE:


How come I can't use this then and just replace the Alert function with SendNotification then?

Please read the documentation for Alert() and then for SendNotification() . . . Alert() takes many parameters, SendNotification() takes one. either combine the values/strings using + or use StringConcatenate()
 
RaptorUK:
Please read the documentation for Alert() and then for SendNotification() . . . Alert() takes many parameters, SendNotification() takes one. either combine the values/strings using + or use StringConcatenate()


Awesome that worked. Thanks a lot.
 
//How do I then parse this last part to get only the hour of current time?
string AlertText = "Currency pair: " + SendNotification(Symbol() + " , " + "Timeframe: " + TimeToStr(TimeLocal())

//And how do I then after that add xx hours?
//Lets say the local time is 15:26 - I then need to fetch current hour(15) and then add one hour
// Can someone hwlp me with that?
 
AQLIVE:


As I already said via PM . . .

Do you need 15 and then add an hour to get 16 ? or do you need 15:00 as a datetime and then add 1 hour to get 16:00 as a datetime ?

 
RaptorUK:


As I already said via PM . . .

OK, you want 16:00 as a datetime . . .

datetime LocalTime = 0;

LocalTime = TimeLocal() - ( TimeLocal() % (PERIOD_H1 * 60) );   // gives TimeLocal() without the minutes and seconds

LocalTime += (PERIOD_H1 * 60);    // adds an hour . . .
 
This topic has been really helpful, thank you! However, my ASK and BID price are not displaying in my notification, what am I doing wrong?
 
AlertPrefix2=StringConcatenate("BUY signal alert","BUY signal at Ask="+DoubleToStr(Ask,4)+", Bid="+DoubleToStr(Bid,4)+", Date="+TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime())+" Symbol="+Symbol()+" Period="+Period());
   AlertPrefix3=StringConcatenate("SELL signal alert","SELL signal at Ask="+DoubleToStr(Ask,4)+", Bid="+DoubleToStr(Bid,4)+", Date="+TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime())+" Symbol="+Symbol()+" Period="+Period());