Attachments forums

List of attachments posted on this forum.


All files on forums: 163092

Re: MT4 Indicator requests and ideas

constbln, Thu Mar 03, 2022 5:05 am

mrtools wrote: Thu Mar 03, 2022 4:33 am Looks like both are Atr's of RMA, any chance you could post the code.

Code: Select all

adx indicator
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))
------------------------------------------------------------------------------------------------
but as you re looking for the rma I think you will find the tradingview code here
https://stackoverflow.com/questions/480 ... internally (I think you understand it better than I do)


--------------------------------------
please let me know if u need anything else
All files in topic