Thushara Dissanayake:
I can use "Print()". But i hope best thing is Alert(). But they see it like a spam! So what i do now?
Hello, need more variable to point ..
use this.. chaiya
bool flag=false; void OnTick(void) { if(Bars<100) { Alert("Bars less than 100!"); return; } if(!IsTradeAllowed() && !flag) { flag=true; } if(IsTradeAllowed() && flag) { flag=false; Alert("Trade is not allowed!"); return; } }
MQL4 (in Strategy Tester) - double testing of entry conditions - Strategy Tester - Expert Advisors and Automated Trading - MQL5 programming forum
You are looking at a signal (IsTradeAllowed.) Act on a change of signal.
MQL4 (in Strategy Tester) - double testing of entry conditions - Strategy Tester - Expert Advisors and Automated Trading - MQL5 programming forum
Thank you for all. You mean use a delay between messages?
I checked it. When i compile, The Alert popup one time and stop correctly. After spend the input time (120 seconds), It again doing it continuously. I mean it not taken time delay on next round.
This is my code. Please kindly check if anything wrong with my side.
static bool openCondition=false; static datetime firstSeen; bool prevCondition = openCondition; openCondition = (IsTradeAllowed()==false); if(openCondition){ if(!prevCondition) firstSeen = TimeCurrent(); // Remember first seen else if(TimeCurrent() - firstSeen >= 120){ // Still set for 2 seconds Alert("Trade is not allowed!"); return; } // else // still waiting. }
Hello, need more variable to point ..
use this.. chaiya
You are looking at a signal (IsTradeAllowed.) Act on a change of signal.
MQL4 (in Strategy Tester) - double testing of entry conditions - Strategy Tester - Expert Advisors and Automated Trading - MQL5 programming forum
I think 1 Alert is enough. Alert on every tick is quit annoying (in my opinion) and fill up the log.
Alternatively you can change the comment saying the " Trade is not allowed! "
or make a Label on the chart saying " Trade is not allowed! "
Or you can make alerts only when the EA tries to open / close a trade but unable to do so because Auto Trade is not allowed!
I think 1 Alert is enough. Alert on every tick is quit annoying (in my opinion) and fill up the log.
Alternatively you can change the comment saying the " Trade is not allowed! "
or make a Label on the chart saying " Trade is not allowed! "
Or you can make alerts only when the EA tries to open / close a trade but unable to do so because Auto Trade is not allowed!
Bro, Actually i want to check all things before go to a trade.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I added few checkup lines to my EA. But the EA validation team comment to that like this:
"Please remove amount of spam in logs and alerts."
Yes the Alert popup until the problem fixed. But they saying it like a spam. So what you recommend for me? What kind of method use to pass this step?
Thank you.