vsaveris / trading-technical-indicators

Trading Technical Indicators python library
https://www.trading-technical-indicators.org/
MIT License
121 stars 34 forks source link

57 vs 62 indicators #21

Closed carlok closed 3 years ago

carlok commented 3 years ago

Hi, the website states there are 62 indicators but with this code

from tti.indicators.properties.indicators_properties import INDICATORS_PROPERTIES

print(len(list(INDICATORS_PROPERTIES.keys())))

I get 57 indicators.

What's wrong? PS: I'm Carlo, not Carlos 😃 Thanks.

vsaveris commented 3 years ago

Hi Carlo!

In the _moving_average.py there are 5 indicators implemented (simple moving average, exponential moving average, time series moving average, triangular moving average and variable moving average. The type of the indicator is set by the ma_type argument:

def __init__(self, input_data, period=20, ma_type='simple', fill_missing_values=True):

where:

ma_type (str, default='simple'): The type of the calculated moving average. Supported values are simple, exponential, time_series, triangular and variable.

Additionally, in the _stochastic_oscillator.py there are two indicators implemented ('fast stochastic oscillator' and slow stochastic oscillator). The type of the indicator is set by the k_slowing_periods input argument:

def __init__(self, input_data, k_periods=14, k_slowing_periods=1, d_periods=3, d_method='simple', fill_missing_values=True):

where:

k_slowing_periods (int, default=1): Smoothing to be used in the stochastic calculation. Supported values are 1 and 3. 1 is considered as Fast Stochastic and 3 is considered as Slow Stochastic.

carlok commented 3 years ago

Thanks, so there isn't a programmatic way to retrieve each indicator from a list because some of them are implicit changing their parameters.

vsaveris commented 3 years ago

Yes, if you want all the 62, you have to call again the MovingAverage and the StochasticOscillator with different arguments.