Closed sunpavlik closed 4 years ago
could you provide a small example for, let's say CDLLONGLINE, that demonstrates the crash?
const TA_FuncHandle *handle;
const TA_FuncInfo *theInfo;
TA_RetCode retCode = TA_GetFuncHandle( "CDLLONGLINE", &handle );
if( retCode != TA_SUCCESS )
return;
retCode = TA_GetFuncInfo( handle, &theInfo );
if ( retCode != TA_SUCCESS )
return;
TA_ParamHolder* holder;
retCode = TA_ParamHolderAlloc(theInfo->handle, &holder);
if ( retCode != TA_SUCCESS )
return;
int result;
retCode = TA_SetOutputParamIntegerPtr(holder, 0, &result);
if ( retCode != TA_SUCCESS )
return;
TA_Real price[6];
retCode = TA_SetInputParamPricePtr(holder, 0, &price[0], &price[1], &price[2], &price[3], &price[4], &price[5]);
if ( retCode != TA_SUCCESS )
return;
retCode = TA_InitNewState( holder );
if ( retCode != TA_SUCCESS )
return;
price[0] = 38.16;
price[1] = 38.165;
price[2] = 38.16;
price[3] = 38.165;
retCode = TA_CallFuncState(holder);
You must call once TA_Initialize();
before any access to TA-Lib's C++ API. That's by original design. Best place to call it is application's main()
. This function initializes some global variables and seems to set up candle default settings.
I see, cool, thank you
Hello,
I was testing CLD functions using the same inputs, only changing function name and some CDL functions work and some crash in TA_CallFuncState(holder). The list below is not exhaustive just a sample. Please could you tell what I am missing?
Work: CDLKICKING CDLHARAMI
Do not work: CDLSPINNINGTOP CDLSHORTLINE CDLLONGLINE