TradingView
AladdinAI
22 de Dez de 2022 12:15

Line Oscillator 

Bitcoin / TetherUS PERPETUAL CONTRACTBinance

Descrição

The input parameters include src, the source data for the indicator, presmooth, an integer value that determines the number of periods to use for pre-smoothing the source data, length, an integer value that determines the number of periods to use for calculating the relative strength index (RSI), smoothtype, a string value that determines whether to use the Hull moving average (HMA) or the Jurik moving average (JMA) for smoothing the RSI, smooth, an integer value that determines the number of periods to use for smoothing the RSI, and power, a float value that determines the power to use for the JMA calculation.

The script then performs some calculations, including pre-smoothing the source data using an exponential moving average (EMA), calculating the RSI from the pre-smoothed data, and smoothing the RSI using either the HMA or the JMA, depending on the value of smoothtype. The script also includes a function called calc_jma that calculates the JMA from a given source data and parameters.

Finally, the script plots the smoothed RSI on the chart and includes horizontal lines at various levels as well as an optional volume bar.
Mais