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

Missing documentation?

Open blackice999 opened this issue 8 years ago • 11 comments

Hello,

Finally I managed to install this library but the problem is that the documentation's most important parts are missing, specifically the part about all the indicators and it's properties. Where can I find the usage of these indicators?

blackice999 avatar Feb 27 '18 17:02 blackice999

What specifically are you missing?

mrjbq7 avatar Feb 27 '18 17:02 mrjbq7

I see that the docs/func_groups directory contains the indicators, but it does not specify a return value for them, or anything close to be a valid function description.

blackice999 avatar Feb 27 '18 17:02 blackice999

Each function has basic docstrings:

>>> import talib
>>> help(talib.MOM)
Help on function MOM in module talib._ta_lib:

MOM(...)
    MOM(real[, timeperiod=?])
    
    Momentum (Momentum Indicators)
    
    Inputs:
        real: (any ndarray)
    Parameters:
        timeperiod: 10
    Outputs:
        real

If you're looking for further documentation on each indicator, you can look at http://tadoc.org/ or the underlying TA-LIb source code:

https://sourceforge.net/p/ta-lib/code/HEAD/tree/trunk/ta-lib/c/src/ta_func/

mrjbq7 avatar Feb 27 '18 17:02 mrjbq7

I see. Thank you, however it should be useful to include this also in the docs :)

blackice999 avatar Feb 27 '18 17:02 blackice999

I mean basically those are in the docs already, but in a compressed form:

MOM - Momentum

real = MOM(close, timeperiod=10)

Learn more about the Momentum at tadoc.org.

mrjbq7 avatar Feb 27 '18 17:02 mrjbq7

(We could always use better docs, but I have so far chosen to just link to the underlying TA-Lib C library documentation rather than write my own. Maybe it's worth improving it...)

mrjbq7 avatar Feb 27 '18 17:02 mrjbq7

Of course, it would be easier to use this wrapper this way, I think. Anyways, thank you for the quick reply and I wish you a pleasant afternoon

blackice999 avatar Feb 27 '18 17:02 blackice999

@mrjbq7 Can you give me more information on MACDEXT? Specifically about fastmatype, slowmatype, and signalmatype, I don't know which integer value represents which moving average type.

urimago avatar Mar 21 '18 13:03 urimago

Short answer:

The "moving average types" are integers, mapping to the TA_MAType enum in the underlying C library:

SMA    0    Simple Moving Average
EMA    1    Exponential Moving Average
WMA    2    Weighted Moving Average
DEMA   3    Double Exponential Moving Average
TEMA   4    Triple Exponential Moving Average
TRIMA  5    Triangular Moving Average
KAMA   6    Kaufman Adaptive Moving Average
MAMA   7    MESA Adaptive Moving Average
T3     8    Triple Generalized Double Exponential Moving Average

Long answer:

We've tried a few different approaches, including these constants that were deprecated:

# TA_MAType enums
MA_SMA, MA_EMA, MA_WMA, MA_DEMA, MA_TEMA, MA_TRIMA, MA_KAMA, MA_MAMA, MA_T3 = range(9)

Replaced by a class approach:

class MA_Type(object):
     SMA, EMA, WMA, DEMA, TEMA, TRIMA, KAMA, MAMA, T3 = range(9)

And then that got deleted as part of some cleanup, and we're stuck using integers again.

Thanks for reminding me, I forgot to come back and try and clean this up and document it.

Do you have any thoughts about approach here?

mrjbq7 avatar Mar 21 '18 14:03 mrjbq7

@mrjbq7 Thanks for fast replying. I think integer or constant seems to be enough.

urimago avatar Mar 22 '18 06:03 urimago

Closing old issue.

mrjbq7 avatar Jan 20 '24 19:01 mrjbq7