Relative Strength of True Range

 

Hi,


I'm trying to copy an indicator from Trading View and part of the indicator has the follow line of code

rr = ta.rma(ta.tr, 35)

ta.tr =  True range.  It is max(high - low, abs(high - close[1]), abs(low - close[1]))

ta.rma =  Moving average used in RSI. It is the exponentially weighted moving average with alpha = 1 / length.


What would be the correct way to write something similar?

 
Andrew Longstaff:

Hi,


I'm trying to copy an indicator from Trading View and part of the indicator has the follow line of code

ta.tr =  True range.  It is max(high - low, abs(high - close[1]), abs(low - close[1]))

ta.rma =  Moving average used in RSI. It is the exponentially weighted moving average with alpha = 1 / length.


What would be the correct way to write something similar?

Create an iATR handle with period set to 1 and then create a iMA handle with smoothing set to SMMA and applied to iATR handle.
 
Navdeep Singh #:
Create an iATR handle with period set to 1 and then create a iMA handle with smoothing set to SMMA and applied to iATR handle.

Thank you, Navdeep. 

I've not used handles before but I've given the documentation a read and it's exactly what I need. Thanks friend

 

Never any reason to use the SMMA(L) it's equivalent to the EMA(2L-1).
          The Smoothed Moving Average or SMMA - How to Avoid It - NinjaTrader Programming | futures.io (2019)

Reason: