Monday, August 27, 2012

Hacking TA-Lib

TA-Lib source code is available from http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-msvc.zip

I opened the com.tictactec.ta.lib.Core class. The RSI method signature looks like this:
   public RetCode rsi( int startIdx,
      int endIdx,
      double inReal[],
      int optInTimePeriod,
      MInteger outBegIdx,
      MInteger outNBElement,
      double outReal[] )
I think I made a mistake in double inReal[]. I was supplying single latest stock quote. Instead, I think I'd better supply an array of current and past stock quote in specific interval.

But when I supplied the array as a parameter, AlgoTrader can't compile the EPL. I asked this in AlgoTrader forum https://groups.google.com/forum/?fromgroups=#!topic/algo-trader/PtaMF04ay6Q

Below is the reply from Andy:
You should only provide the scalar value (tick.currentValueDouble). The GenericTALibFunction will collect all values and provide them as an Array to the talib function. Have a look at the JavaDoc of GenericTALibFunction.

No comments:

Post a Comment