das

Newbie
Jan 8, 2024
8
0
1
33
You can insert the following line somewhere at the top of the NotifyHit() function:
MQL4:
if (TimeCurrent()< LastNotification + WaitTimeNotify * 60) return;
Then change this line at the bottom of the function from:
MQL4:
LastNotificationTime = Time[0];
to:
MQL4:
LastNotificationTime = TimeCurrent();

Don't forget to add WaitTimeNotify as an input parameter near the top of the indicator's code:
MQL4:
input int WaitTimeNotify = 5; // Wait time between notifications (Minutes)
Are the annotations the same on MQL5?
 

Enivid

Administrator
Staff member
Nov 30, 2008
18,622
1,367
144
Odesa
www.earnforex.com
Here are the changes
I don't think you would be able to compile that. The change to the input parameters is OK, the first change to the NotifyHit() is OK, but the second change there isn't good. It's that line down below that has to be replaced:
1705431331935.png
Once again, don't forget to re-compile after applying the changes.
 

das

Newbie
Jan 8, 2024
8
0
1
33
I don't think you would be able to compile that. The change to the input parameters is OK, the first change to the NotifyHit() is OK, but the second change there isn't good. It's that line down below that has to be replaced:
View attachment 26883
Once again, don't forget to re-compile after applying the changes.
I replaced the bottom line LastNotificationTime = Time[0]; by LastNotificationTime = TimeCurrent(); but still chain notification and the Wait time between notifications option also does not appear on the indicator
 

Attachments

  • modif.PNG
    modif.PNG
    44.7 KB · Views: 3

Enivid

Administrator
Staff member
Nov 30, 2008
18,622
1,367
144
Odesa
www.earnforex.com
I replaced the bottom line LastNotificationTime = Time[0]; by LastNotificationTime = TimeCurrent(); but still chain notification and the Wait time between notifications option also does not appear on the indicator
Which means that you didn't re-compile the code after modifying it. You have to click that Compile button in your MetaEditor and make sure it compiles without errors.
 

das

Newbie
Jan 8, 2024
8
0
1
33
Which means that you didn't re-compile the code after modifying it. You have to click that Compile button in your MetaEditor and make sure it compiles without errors.
I have 1 error while compiling
 

Attachments

  • erreur.PNG
    erreur.PNG
    4 KB · Views: 2

das

Newbie
Jan 8, 2024
8
0
1
33
Thank you for all. Is it possible to put wait time between notifications in seconds instead of minutes?
 

hknnkt

Trader
Feb 26, 2024
2
0
6
32
sorry i am a new user in MT4. How can i make a alert in MT4? For example i want 30 and 70 rsi level in EURUSD. can u help me?