Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
TA-Lib questions

Some questions regarding TA-Lib:

  1. Are there technical specifications for the TA-Lib methods? For example, when I go to http://tadoc.org/indicator/EMA.htm, there are just more links. I'd like to be able to test the I/O for some of the methods, but I need to know what the black box between the "I" and "O" is intended to compute (without having to interpret the TA-Lib source code myself).

  2. What if I don't want to use the automatic mapping of OHLCV data described on the help page (along the same lines as Peter's question on https://www.quantopian.com/posts/help-needed-ta-lib). Are the TA-Lib methods available directly? For example, could I feed a TA-Lib method dollar-volume data that I've generated via the batch transform? Or compute, using open prices, instead of close prices?

  3. Regarding your implementation of a weighted moving average in TA-Lib, it is not clear how the weights are defined. Typically, they would be supplied as an input, right?

2 responses

Hello Grant,

  1. This is a problem. I've found that using TA-Lib in Excel or using talib (the TA-Lib Python wrapper) in the iPython QtConsole is a good learning exercise but I am VERY much a novice here.

  2. Some new developments this morning at https://www.quantopian.com/posts/help-needed-ta-lib suggest we can use TA-Lib in Quantopian with any time series.

  3. For the TA-Lib WMA function you may need to look at the source. This is an extract from http://traitor.googlecode.com/svn/trunk/ta-lib/src/ta_func/ta_WMA.c which I have not really read yet:

/* The algo used here use a very basic property of
    * multiplication/addition: (x*2) = x+x  
    *  
    * As an example, a 3 period weighted can be  
    * interpreted in two way:  
    *  (x1*1)+(x2*2)+(x3*3)  
    *      OR  
    *  x1+x2+x2+x3+x3+x3 (this is the periodSum)  
    *  
    * When you move forward in the time serie  
    * you can quickly adjust the periodSum for the  
    * period by substracting:  
    *   x1+x2+x3 (This is the periodSub)  
    * Making the new periodSum equals to:  
    *   x2+x3+x3  
    *  
    * You can then add the new price bar  
    * which is x4+x4+x4 giving:  
    *   x2+x3+x3+x4+x4+x4  
    *  
    * At this point one iteration is completed and you can  
    * see that we are back to the step 1 of this example.  
    *  
    * Why making it so un-intuitive? The number of memory  
    * access and floating point operations are kept to a  
    * minimum with this algo.  
    */  

P.

Thanks Peter,

Nice work on sorting out how to use TA-Lib directly. Kinda sketchy that there isn't better documentation, but I guess you get what you pay for.

Grant