Adaptive ATR

291
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.
These users thanked the author Jimmy for the post (total 4):
josi, uncle wong, RodrigoRT7, Chickenspicy
Are you looking for a Forex broker? FBS cuts spreads by up to 58%. Click here to begin your trading journey, today.
No commissions are earned by Forex-station.


Guide to the "All Averages" Filters (ADXvma, Laguerre etc.) 🆕
Use Fibonacci numbers for indicator settings + How to draw Fibonacci Extensions
An easy trick for drawing Support & Resistance


Re: Adaptive ATR

294
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.
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.
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

LikeRe: Adaptive Indicators for MT4

295
mrtools wrote: Tue Apr 28, 2020 2:22 am

Arrows added.
Hi MrTools, thank you so much for this indi! I cannot believe how accurate it is on all timeframes with the default settings. I am having so much suc6 with this one. Then I use your adaptive Jurik for extra signals if it is in the same direction. Works out pretty well. THANK U!


Re: Adaptive ATR

296
ionone wrote: Mon May 04, 2020 4:29 pm

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.
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
screenshot.04-05-2020 08.30.14.jpg
Try changing line # 60 from

Code: Select all

int i=rates_total-prev_calculated; if (i>rates_total-1) i=rates_total-1; for (; i>=0 && !_StopFlag; i--) 
   { 
to this

Code: Select all

int i=rates_total-prev_calculated+1; if (i>rates_total-1) i=rates_total-1; for (; i>=0 && !_StopFlag; i--) 
   { 

Re: Adaptive ATR

297
mrtools wrote: Tue May 05, 2020 4:58 am

Try changing line # 60 from

Code: Select all

int i=rates_total-prev_calculated; if (i>rates_total-1) i=rates_total-1; for (; i>=0 && !_StopFlag; i--) 
   { 
to this

Code: Select all

int i=rates_total-prev_calculated+1; if (i>rates_total-1) i=rates_total-1; for (; i>=0 && !_StopFlag; i--) 
   { 
it changes absolutely nothing lol
the problem is not a simple indexing issue, it's the algorithm that has been made so it behaves that way.
the ATR never uses high minus low with such importance in the computations, it uses close minus PREVIOUS low and previous high minus close AND high minus low (the max value of these)
so at the opening of the bar, it still maintains a value that is coherent.
But by affecting more weigth to current high minus low, it make the indi behave incoherently during the duration of the candle, getting closer and closer to an acceptable value as we get closer to the end of the bar.

Of course this is not a problem is you use the close value of the previous candle, but it can be a problem if you use the Adaptive ATR value of the current bar, in a live situation

EDIT :
here is my version, and as you can see the curve doesn't drop at the opening of the bar, and the two curves are pretty similar.

cheers

Jeff

Re: Adaptive Indicators for MT4

300
mrtools wrote: Thu Sep 20, 2018 6:24 am Mladen's Rsx of alb averages converted it to mt4.

About the indicator from Mladen::

RSX (Relative Strength Quality Index) that does not use "pure" price for calculation but uses adaptive lookback average filtered price for calculation

Of price filtering for rsx :

The advantage of using the filtered (smoothed) price is that some of the false signals are filtered out at the source itself (by averaging the price) and it the is omitted (the false signal) in the RSX calculation too. Also, since the average is adaptive it implicitly makes the RSX adaptive too

ALB averages that can be used :

simple moving average
exponential moving average
smoothed moving average
linear weighted moving average
triple exponential moving average
smoothed linear weighted moving average
nonlag moving average
linear regression value (lsma)
double smoothed exponential average
Usage :

Some experimenting with parameters is advised, but the usage of this RSX is the usual : either use the slope or some significant levels crossing for signals
Hi Mr Tools, do you by any chance have this exact indicator with mobile/email alerts?


Who is online

Users browsing this forum: areteus1, NasdaqBoss, Twitter [Bot], Yahoo Japan [Bot], Yandex [Bot] and 66 guests