On 01/26/2011 02:40 PM, Mark Knecht wrote:
> 
> REALLY great points about the math issues. Thanks.
> 
> As for testing it _may_ be a slight bit easier than having to get to
> that level. There is a library in portage called ta-lib which
> implements lots of standard technical analysis constructs. After it's
> installed I don't seem to have the C code for the actual functions
> anymore. What I have is a compiled library as well as some header
> files to look at. I suspect I can install the library again using
> portage bt not getting rid of the functions which I could then use as
> an example for my coding.

Use FEATURES="noclean" and the patched source will be left under
/var/tmp/portage. The unpatched source is probably in your
/usr/portage/distfiles already. (I don't know if there *are* any patches
for ta-lib, but if there are, you usually want them applied).


> I have not used this library myself, but I've read enough on the web
> to be reasonably sure it's results are very consistent with what
> TradeStation functions of the same type do.
> 
> For a simple function call like a moving average EasyLanguage would write:
> 
> ...
>
> TA_RetCode TA_MA( int    startIdx,
>                   int    endIdx,
>                   const double inReal[],
>                   int           optInTimePeriod, /* From 1 to 100000 */
>                   TA_MAType     optInMAType,
>                   int          *outBegIdx,
>                   int          *outNBElement,
>                   double        outReal[] );
>
> ...
> 
>    Maybe I could use the definitions of these functions as a basis for
> understanding what might be a reasonable set of guesses? From my point
> of view, a good start at translation would be to use whatever is
> available in ta-lib whenever possible and only have to deal with other
> stuff like If/Else, Switch, etc.
> 
>    Just thinking.

If you can figure out what all those parameters mean -- that will be the
hard part. What type of moving average is EasyLanguage doing? Which
TA_MAType does it match up to? Can the E.L. version fail if it runs off
the end of the prices array, or does it just add zeros at the end? Is
there a way to make TA_MA do the same?

Sorry I have nothing but discouragement to offer =) This isn't an easy
problem.

Reply via email to