If you mean you get different results when switch to another TF and back, then your code is broken.
Hi
thank you for your reply.
TF is M1 as default.
the change is happening just to the new bars after last switch back to M1 !!
somehow, bar 1 is being calculated wrongly when shift happen from bar 0 to bar 1.
even, i recalculate the last bar but making mess.
many thanks
just
Asked and answered.
WHRoeder: then your code is broken.
hi,
thank you for you reply.
i found out the reason. it was a basic mistake.
int IndicatorCounted( | ) |
Note: The latest bar is not considered to be calculated and,
in the most cases, it is necessary to recalculate only this bar. However, there
occur some boundary cases where custom indicator is called from the expert at
the first tick of the new bar. It is possible that the last tick of the previous
bar had not been processed (because the last-but-one tick was being processed when this last tick came),
the custom indicator was not called and it was not calculated because of this.
To avoid indicator calculation errors in such situations, the IndicatorCounted()
function returns the count of bars minus one.
thanks
just

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
Hi,
i created a simple indicator based on Stoch, but it gives me different results for the same time frame when being switched to M5 or M15.
has anyone got same problem?
many thanks
just