This is the same as :
if(counted_bars==0) limit=limit-2;
No idea why it's written like that.
All this snippet of code is confusing and obsolete. You should use new syntax with prev_calculated and rates_total.
This is the same as :
No idea why it's written like that.
All this snippet of code is confusing and obsolete. You should use new syntax with prev_calculated and rates_total.
OK, thanks. I will certainly look into the new syntax with prev_calculated and rates_total. I've been away from MT4 for a while. I see it is now merged with MQL5. That's OK with me, as I've always wanted to learn more about c++
My coding skills are that of 'slightly' better than noob level.
Anyways, just out of curiosity, do you know under what conditions IndicatorCounted() is ever 0?
Anyways, just out of curiosity, do you know under what conditions IndicatorCounted() is ever 0?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Trying to decipher the last line of code in this segment:
I'm just trying to understand what the last line of code actually does. I get that it relates to the first 2 lines and seems to be part of an error checking process.
I'm just trying to figure out why it is there and exactly what it does under what conditions. I know that if counted_bars == 0, then limit will be equal to Bars.
Then, in this case, 1 is subtracted from limit from the expression limit-=1.
Questions:
1) Why is it the "+1" there following the assignment expression: limit-=1 ? And why is 1 being subtracted from limit ... and then 1 added back to it ...? Or ... is 2 (1+1) being subtracted from it? But is this necessary, or just an illogical piece of code that is not needed?
2) Another related question: How would IndicatorCounted() which is = to counted_bars ever be 0? (offline charts perhaps ....?)
Thanks.