Re: ATR indicators for MT4

31
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

32
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))
:
These users thanked the author ionone for the post:
Jimmy
Scalping the Century TimeFrame since 1999

Re: ATR indicators for MT4

33
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.
These users thanked the author mrtools for the post (total 6):
kvak, RodrigoRT7, oskison, Akela, Takashi12, Kayleb

Re: ATR Indicators for MT4

35
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
These users thanked the author sylvester21 for the post:
RodrigoRT7


Re: ATR Indicators for MT4

36
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.
These users thanked the author mrtools for the post (total 10):
RodrigoRT7, sylvester21, Abdi, kvak, thomdel, Jimmy, maroka, 太虚一毫, Papybillou, Kayleb

Re: ATR Indicators for MT4

38
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?