Page 4 of 8

Re: ATR indicators for MT4

Posted: Sun Jun 30, 2024 12:07 am
by oskison
HI.
Would any of you be able to add the RMA smoothing to the ATR indicator as it is on the trading view platform? There is no smoothing option in the standard metatrade 4 indicator

Code

Code: Select all

//@version=5
indicator(title="Average True Range", shorttitle="ATR", overlay=false, timeframe="", timeframe_gaps=true)
length = input.int(title="Length", defval=14, minval=1)
smoothing = input.string(title="Smoothing", defval="RMA", options=["RMA", "SMA", "EMA", "WMA"])
ma_function(source, length) =>
	switch smoothing
		"RMA" => ta.rma(source, length)
		"SMA" => ta.sma(source, length)
		"EMA" => ta.ema(source, length)
		=> ta.wma(source, length)
plot(ma_function(ta.tr(true), length), title = "ATR", color=color.new(#B71C1C, 0))
:

Re: ATR indicators for MT4

Posted: Sun Jun 30, 2024 5:53 pm
by ionone
coincidence ? I made this indicator a few days ago

I think the RMA is just an EMa with k = 1.0/(MAPeriod);

Jeff
oskison wrote: Sun Jun 30, 2024 12:07 am HI.
Would any of you be able to add the RMA smoothing to the ATR indicator as it is on the trading view platform? There is no smoothing option in the standard metatrade 4 indicator

Code

Code: Select all

//@version=5
indicator(title="Average True Range", shorttitle="ATR", overlay=false, timeframe="", timeframe_gaps=true)
length = input.int(title="Length", defval=14, minval=1)
smoothing = input.string(title="Smoothing", defval="RMA", options=["RMA", "SMA", "EMA", "WMA"])
ma_function(source, length) =>
	switch smoothing
		"RMA" => ta.rma(source, length)
		"SMA" => ta.sma(source, length)
		"EMA" => ta.ema(source, length)
		=> ta.wma(source, length)
plot(ma_function(ta.tr(true), length), title = "ATR", color=color.new(#B71C1C, 0))
:

Re: ATR indicators for MT4

Posted: Mon Jul 01, 2024 3:29 am
by mrtools
oskison wrote: Sun Jun 30, 2024 12:07 am HI.
Would any of you be able to add the RMA smoothing to the ATR indicator as it is on the trading view platform? There is no smoothing option in the standard metatrade 4 indicator

Code

Code: Select all

//@version=5
indicator(title="Average True Range", shorttitle="ATR", overlay=false, timeframe="", timeframe_gaps=true)
length = input.int(title="Length", defval=14, minval=1)
smoothing = input.string(title="Smoothing", defval="RMA", options=["RMA", "SMA", "EMA", "WMA"])
ma_function(source, length) =>
	switch smoothing
		"RMA" => ta.rma(source, length)
		"SMA" => ta.sma(source, length)
		"EMA" => ta.ema(source, length)
		=> ta.wma(source, length)
plot(ma_function(ta.tr(true), length), title = "ATR", color=color.new(#B71C1C, 0))
:
Made this one. In the screenshot is the built in Atr which uses a simple moving average.

Re: ATR indicators for MT4

Posted: Tue Jul 02, 2024 7:26 pm
by oskison
mrtools wrote: Mon Jul 01, 2024 3:29 am Made this one. In the screenshot is the built in Atr which uses a simple moving average.
It is perfect. Thank you for help.
I respect that you took your time to make this indicator.
Thanks once again :)

Re: ATR Indicators for MT4

Posted: Wed Jul 03, 2024 7:54 pm
by sylvester21
mrtools wrote: Sun Jul 23, 2023 5:24 am ATR Probability Levels with Line Type + Line Width options
Hi MrTools and Kvak,

Is it possible to do this for ADR (Average Daily Range) instead of ATR? With on off buttons and only for the Daily Time Frame.
According to the works of Daryl Guppy, there's an 85% probability for an FX Pair to hit 75% of its 5-day ADR value.

With this indicator i think it will be good for traders to have a visualization on current day of trading for the amount of pips expected to move.

Thanks

Re: ATR Indicators for MT4

Posted: Wed Jul 03, 2024 10:33 pm
by mrtools
sylvester21 wrote: Wed Jul 03, 2024 7:54 pm Hi MrTools and Kvak,

Is it possible to do this for ADR (Average Daily Range) instead of ATR? With on off buttons and only for the Daily Time Frame.
According to the works of Daryl Guppy, there's an 85% probability for an FX Pair to hit 75% of its 5-day ADR value.

With this indicator i think it will be good for traders to have a visualization on current day of trading for the amount of pips expected to move.

Thanks
ATR & ADR On Chart Levels for MT4 (Multi-timeframe)

Hello,

Made it an option to choose average true range or average daily range, the default settings are for daily time frame but left it to be a choice. Hope that will work.

Re: ATR Indicators for MT4

Posted: Thu Jul 04, 2024 12:40 am
by sylvester21
mrtools wrote: Wed Jul 03, 2024 10:33 pm Hello,

Made it an option to choose atr or adr, the default settings are for daily time frame but left it to be a choice. Hope that will work.
Wow tq so much MrTools!

Re: ATR Indicators for MT4

Posted: Thu Jul 04, 2024 1:10 am
by Abdi
mrtools wrote: Wed Jul 03, 2024 10:33 pm Hello,

Made it an option to choose atr or adr, the default settings are for daily time frame but left it to be a choice. Hope that will work.
Thank you MrTools, this is awesome.
Can i ask for one modification if possible. Could you possible add the (any timeframe/mt5 time frames) option you were implementing recently to this indicator?

Re: ATR Indicators for MT4

Posted: Thu Jul 04, 2024 1:17 am
by Abdi
sylvester21 wrote: Thu Jul 04, 2024 12:40 am Wow tq so much MrTools!
Sylvester maybe you also like this atr indi i am using, if you dont know it already ...
It shows the stats you were mentioning :)

Re: ATR Indicators for MT4

Posted: Thu Jul 04, 2024 1:33 am
by mrtools
Abdi wrote: Thu Jul 04, 2024 1:10 am Thank you MrTools, this is awesome.
Can i ask for one modification if possible. Could you possible add the (any timeframe/mt5 time frames) option you were implementing recently to this indicator?
Sorry not sure how to implement it to this.