1 |
On 01/26/2011 02:40 PM, Mark Knecht wrote: |
2 |
> |
3 |
> REALLY great points about the math issues. Thanks. |
4 |
> |
5 |
> As for testing it _may_ be a slight bit easier than having to get to |
6 |
> that level. There is a library in portage called ta-lib which |
7 |
> implements lots of standard technical analysis constructs. After it's |
8 |
> installed I don't seem to have the C code for the actual functions |
9 |
> anymore. What I have is a compiled library as well as some header |
10 |
> files to look at. I suspect I can install the library again using |
11 |
> portage bt not getting rid of the functions which I could then use as |
12 |
> an example for my coding. |
13 |
|
14 |
Use FEATURES="noclean" and the patched source will be left under |
15 |
/var/tmp/portage. The unpatched source is probably in your |
16 |
/usr/portage/distfiles already. (I don't know if there *are* any patches |
17 |
for ta-lib, but if there are, you usually want them applied). |
18 |
|
19 |
|
20 |
> I have not used this library myself, but I've read enough on the web |
21 |
> to be reasonably sure it's results are very consistent with what |
22 |
> TradeStation functions of the same type do. |
23 |
> |
24 |
> For a simple function call like a moving average EasyLanguage would write: |
25 |
> |
26 |
> ... |
27 |
> |
28 |
> TA_RetCode TA_MA( int startIdx, |
29 |
> int endIdx, |
30 |
> const double inReal[], |
31 |
> int optInTimePeriod, /* From 1 to 100000 */ |
32 |
> TA_MAType optInMAType, |
33 |
> int *outBegIdx, |
34 |
> int *outNBElement, |
35 |
> double outReal[] ); |
36 |
> |
37 |
> ... |
38 |
> |
39 |
> Maybe I could use the definitions of these functions as a basis for |
40 |
> understanding what might be a reasonable set of guesses? From my point |
41 |
> of view, a good start at translation would be to use whatever is |
42 |
> available in ta-lib whenever possible and only have to deal with other |
43 |
> stuff like If/Else, Switch, etc. |
44 |
> |
45 |
> Just thinking. |
46 |
|
47 |
If you can figure out what all those parameters mean -- that will be the |
48 |
hard part. What type of moving average is EasyLanguage doing? Which |
49 |
TA_MAType does it match up to? Can the E.L. version fail if it runs off |
50 |
the end of the prices array, or does it just add zeros at the end? Is |
51 |
there a way to make TA_MA do the same? |
52 |
|
53 |
Sorry I have nothing but discouragement to offer =) This isn't an easy |
54 |
problem. |