Questions from Beginners MQL5 MT5 MetaTrader 5 - page 588

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello, could you please tell me if it is possible for the Expert Advisor to add an object such as a button or toggle switch to the chart, and if so, how?
edutak:
Тестер пишет, непрерывный проигрыш 3, а я вручную насчитал 5, потом еше больше. Из-за чего такое может быть?
without at least a report from the tester, you can't understand
without at least a report from the tester, you can't understand
lot 0.1
Could the tester be lying?
the report is StrategyTester report html
Can't attach...
Archive it.
When checking the indicator step by step, I found a bounce in the subroutine behind the if {} and in which there is no W. Here is a simplified code to clarify the point:
//--- input parameters
input int w=10;
//---
{
int i;
//---
int co=0;
for(i=0;i<=w;i++)if(w==10){co++; Alert(co);}
//--- return value of prev_calculated for next call
return(rates_total);
}
Result (arlet):
2016.05.30 00:45:14.064 1 (EURUSD,H1) 11
2016.05.30 01:10:35.972 1 (EURUSD,H1) 10
........... etc. to 1.
2016.05.30 00:45:14.064 1 (EURUSD,H1) 1
Rule: If the expression in brackets is true, then operator1 is executed.
In code: operator1 is executed ALWAYS.
I think if() should work only once when the bracketed condition is true. But it actually occurs at each check, so all expressions in {} are executed at each step and chew machine time.
Questions: WHY did the CO variable grow from 0 to 11 during the loop? Why is Alert triggered at every step?