I have used the code you suggested and it works to make the alert happen once, but it never alerts again. I want it to alert once everytime the criteria is met...the code makes it alert once and never again on that pair. how do I make it alert only once every time the criteria is met??
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
You're welcomed.
Good luck
GarF1eld,
I have used the code you suggested and it works to make the alert happen once, but it never alerts again. I want it to alert once everytime the criteria is met...the code makes it alert once and never again on that pair. how do I make it alert only once every time the criteria is met??
Please help, thanx.
When the condition is NOT met, reset the flag.
if you would just paste that code in your EA, it wouldnt work :D
declare firstTime as a global variable. and
put into the init() function.
why firstTime variable has to be in init() function?
I don't think it does. It can be declared either static inside start or on the global scope. Anything in init() for this variable is superfluous
V
I don't think it does. It can be declared either static inside start or on the global scope. Anything in init() for this variable is superfluous
V
Help me to find please the indicator sounding on each of ticks