ta-lib-python icon indicating copy to clipboard operation
ta-lib-python copied to clipboard

get_unstable_period gives 0 for all functions with unstable period

Open TsiVit opened this issue 1 year ago • 1 comments

Trying to understand why RSI has unstable period (according the docs), I explored that this period given not correct with "get_unstable_period" function

for name in [
            'ADX', 'ADXR', 'ATR', 'CMO', 'DX', 'EMA', 'HT_DCPERIOD',
            'HT_DCPHASE', 'HT_PHASOR', 'HT_SINE', 'HT_TRENDLINE',
            'HT_TRENDMODE', 'KAMA', 'MAMA', 'MFI', 'MINUS_DI', 'MINUS_DM',
            'NATR', 'PLUS_DI', 'PLUS_DM', 'RSI', 'STOCHRSI', 'T3', 'ALL'
        ]:
    print (name, talib.get_unstable_period(name))

ADX 0 ADXR 0 ATR 0 CMO 0 DX 0 EMA 0 HT_DCPERIOD 0 HT_DCPHASE 0 HT_PHASOR 0 HT_SINE 0 HT_TRENDLINE 0 HT_TRENDMODE 0 KAMA 0 MAMA 0 MFI 0 MINUS_DI 0 MINUS_DM 0 NATR 0 PLUS_DI 0 PLUS_DM 0 RSI 0 STOCHRSI 0 T3 0 ALL 0

TsiVit avatar Jul 16 '24 11:07 TsiVit

This works as expected.

By default, TA-Lib does not remove any of the "unstable data", so all settings are zero.

It is up to the user to decide how much of the output should always be removed with talib.set_unstable_period().

mario4tier avatar Dec 07 '24 05:12 mario4tier