there is a problem though. when passed through the strategy tester : when a new bar opens, the ATR value is lowered quite a lot compared to previous value, and it happens on each bar. The reason is that you use the high minus low, and this value is zero at the opening of the bar. this is not accurate for live situations I think.Jimmy wrote: Wed Apr 29, 2020 10:27 pm I'm not sure if this one has already been shared by our members but here is another nice new code from Mladen which I think would be very useful for traders is his Adaptive ATR for MT4.
Thanks to Mladen for creating some valuable tools for the older platform and also releasing the source codes
As explained by Mladen:
This is an adaptive ATR for metatrader 4.
Apart from being adaptive, there is one more deviation in it - it is calculating average range (not average true range). The difference is subtle but it exists. It means that unlike the average true range (that checks if there was a gap when compared to previous bar), this indicator is calculating average range of high to low. And that is it. It is, as it is obvious from previous description, "ignoring" the gaps and that way it is calculating only the "effective" ranges.
Is there a solution to this ?
could you make an adaptive ATR but with the same behaviour as the well known ATR?
or I guess we could just use previous value, that would be accurate
see the screenshot here, taken just after bar opening