Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
ta-lib port for ruby using swig
BENI
3/13/2007 12:28:00 PM
I was trying to SWIG onto the ta-lib .
the ta-lib is a collection of c functions for financial data analysis.
http://ta-lib.org/d_api/...
.
I was trying with one function.
the header
TA_RetCode TA_MA( int startIdx,
int endIdx,
const double inReal[],
int optInTimePeriod,
int optInMAType,
int *outBegIdx,
int *outNbElement,
double outReal[],
)
the c call:
Lets say you wish to calculate a 30 day moving average using closing
prices. The function call could look as follow:
TA_Real closePrice[400];
TA_Real out[400];
TA_Integer outBeg;
TA_Integer outNbElement;
/* ... initialize your closing price here... */
retCode = TA_MA( 0, 399,
&closePrice[0],
30,TA_MAType_SMA,
&outBeg, &outNbElement, &out[0] );
/* The output is displayed here */
for( i=0; i < outNbElement; i++ )
printf( "Day %d = %f\n", outBeg+i, out[i] );
============
i was wondering how the typemap for the arguments in swig will look
like.
1>const double inReal[],
2> int optInMAType,
3> int *outBegIdx,
4> int *outNbElement,
5> double outReal[],
Any lead will be very helpful.
btw. i have all the docs rltd to swig and the pickaxe as well.
regards
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
ta-lib port for ruby using swig
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password