Attachments forums

List of attachments posted on this forum.


All files on forums: 159914

Re: ATR indicators for MT4

ionone, Sun Jun 30, 2024 5:53 pm

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))
:
All files in topic