/* Generated */ TA_RetCode TA_S_APO( int startIdx, /* Generated */ int endIdx, /* Generated */ const float inReal[], /* Generated */ int optInFastPeriod, /* From 2 to 100000 */ /* Generated */ int optInSlowPeriod, /* From 2 to 100000 */ /* Generated */ TA_MAType optInMAType, /* Generated */ int *outBegIdx, /* Generated */ int *outNbElement, /* Generated */ double outReal[] ) /* Generated */ #endif /* Generated */ { /* Generated */ ARRAY_REF(tempBuffer); /* Generated */ TA_RetCode retCode; /* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK /* Generated */ if( startIdx < 0 ) /* Generated */ return NAMESPACE(TA_RetCode)TA_OUT_OF_RANGE_START_INDEX; /* Generated */ if( (endIdx < 0) || (endIdx < startIdx)) /* Generated */ return NAMESPACE(TA_RetCode)TA_OUT_OF_RANGE_END_INDEX; /* Generated */ #if !defined(_MANAGED) && !defined(_JAVA) /* Generated */ if( !inReal ) return NAMESPACE(TA_RetCode)TA_BAD_PARAM; /* Generated */ #endif /* Generated */ if( (int)optInFastPeriod == TA_INTEGER_DEFAULT ) /* Generated */ optInFastPeriod = 12; /* Generated */ else if( ((int)optInFastPeriod < 2) || ((int)optInFastPeriod > 100000) ) /* Generated */ return NAMESPACE(TA_RetCode)TA_BAD_PARAM; /* Generated */ if( (int)optInSlowPeriod == TA_INTEGER_DEFAULT ) /* Generated */ optInSlowPeriod = 26; /* Generated */ else if( ((int)optInSlowPeriod < 2) || ((int)optInSlowPeriod > 100000) ) /* Generated */ return NAMESPACE(TA_RetCode)TA_BAD_PARAM; /* Generated */ #if !defined(_MANAGED) && !defined(_JAVA) /* Generated */ if( (int)optInMAType == TA_INTEGER_DEFAULT ) /* Generated */ optInMAType = 0; /* Generated */ else if( ((int)optInMAType < 0) || ((int)optInMAType > 8) ) /* Generated */ return NAMESPACE(TA_RetCode)TA_BAD_PARAM; /* Generated */ #endif /* Generated */ #if !defined(_MANAGED) && !defined(_JAVA) /* Generated */ if( !outReal ) /* Generated */ return NAMESPACE(TA_RetCode)TA_BAD_PARAM; /* Generated */ #endif /* Generated */ #endif /* Generated */ ARRAY_ALLOC(tempBuffer, (endIdx-startIdx+1) ); /* Generated */ #if !defined(_JAVA) /* Generated */ if( !tempBuffer ) /* Generated */ return NAMESPACE(TA_RetCode)TA_ALLOC_ERR; /* Generated */ #endif /* Generated */ retCode = FUNCTION_CALL(INT_PO)( startIdx, endIdx, /* Generated */ inReal, /* Generated */ optInFastPeriod, /* Generated */ optInSlowPeriod, /* Generated */ optInMAType, /* Generated */ outBegIdx, /* Generated */ outNbElement, /* Generated */ outReal, /* Generated */ tempBuffer, /* Generated */ 0 ); /* Generated */ ARRAY_FREE( tempBuffer ); /* Generated */ return retCode; /* Generated */ }
/* Generated */ TA_RetCode TA_S_PPO( int startIdx, /* Generated */ int endIdx, /* Generated */ const float inReal_0[], /* Generated */ int optInFastPeriod_0, /* From 2 to 100000 */ /* Generated */ int optInSlowPeriod_1, /* From 2 to 100000 */ /* Generated */ TA_MAType optInMAType_2, /* Generated */ int *outBegIdx, /* Generated */ int *outNbElement, /* Generated */ double outReal_0[] ) /* Generated */ #endif /* Generated */ { /* Generated */ ARRAY_REF(tempBuffer); /* Generated */ TA_RetCode retCode; /* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK /* Generated */ if( startIdx < 0 ) /* Generated */ return TA_OUT_OF_RANGE_START_INDEX; /* Generated */ if( (endIdx < 0) || (endIdx < startIdx)) /* Generated */ return TA_OUT_OF_RANGE_END_INDEX; /* Generated */ if( !inReal_0 ) return TA_BAD_PARAM; /* Generated */ if( (int)optInFastPeriod_0 == TA_INTEGER_DEFAULT ) /* Generated */ optInFastPeriod_0 = 12; /* Generated */ else if( ((int)optInFastPeriod_0 < 2) || ((int)optInFastPeriod_0 > 100000) ) /* Generated */ return TA_BAD_PARAM; /* Generated */ if( (int)optInSlowPeriod_1 == TA_INTEGER_DEFAULT ) /* Generated */ optInSlowPeriod_1 = 26; /* Generated */ else if( ((int)optInSlowPeriod_1 < 2) || ((int)optInSlowPeriod_1 > 100000) ) /* Generated */ return TA_BAD_PARAM; /* Generated */ #if !defined(_MANAGED) /* Generated */ if( (int)optInMAType_2 == TA_INTEGER_DEFAULT ) /* Generated */ optInMAType_2 = 0; /* Generated */ else if( ((int)optInMAType_2 < 0) || ((int)optInMAType_2 > 8) ) /* Generated */ return TA_BAD_PARAM; /* Generated */ #endif /* Generated */ if( outReal_0 == NULL ) /* Generated */ return TA_BAD_PARAM; /* Generated */ #endif /* Generated */ ARRAY_ALLOC( tempBuffer, endIdx-startIdx+1 ); /* Generated */ if( !tempBuffer ) /* Generated */ return TA_ALLOC_ERR; /* Generated */ retCode = TA_PREFIX(INT_PO)( startIdx, endIdx, inReal_0, /* Generated */ optInFastPeriod_0, /* Generated */ optInSlowPeriod_1, /* Generated */ optInMAType_2, /* Generated */ outBegIdx, /* Generated */ outNbElement, /* Generated */ outReal_0, /* Generated */ tempBuffer, /* Generated */ 1 ); /* Generated */ ARRAY_FREE( tempBuffer ); /* Generated */ return TA_SUCCESS; /* Generated */ }
/* Generated */ TA_RetCode TA_PREFIX(INT_MACD)( int startIdx, /* Generated */ int endIdx, /* Generated */ const INPUT_TYPE inReal[], /* Generated */ int optInFastPeriod, /* Generated */ int optInSlowPeriod, /* Generated */ int optInSignalPeriod_2, /* Generated */ int *outBegIdx, /* Generated */ int *outNbElement, /* Generated */ double outMACD[], /* Generated */ double outMACDSignal[], /* Generated */ double outMACDHist[] ) /* Generated */ #endif /* Generated */ { /* Generated */ ARRAY_REF(slowEMABuffer); /* Generated */ ARRAY_REF(fastEMABuffer); /* Generated */ double k1, k2; /* Generated */ TA_RetCode retCode; /* Generated */ int tempInteger, outBegIdx1, outNbElement1; /* Generated */ int outBegIdx2, outNbElement2; /* Generated */ int lookbackTotal, lookbackSignal; /* Generated */ int i; /* Generated */ if( optInSlowPeriod < optInFastPeriod ) /* Generated */ { /* Generated */ tempInteger = optInSlowPeriod; /* Generated */ optInSlowPeriod = optInFastPeriod; /* Generated */ optInFastPeriod = tempInteger; /* Generated */ } /* Generated */ if( optInSlowPeriod != 0 ) /* Generated */ k1 = PER_TO_K(optInSlowPeriod); /* Generated */ else /* Generated */ { /* Generated */ optInSlowPeriod = 26; /* Generated */ k1 = (double)0.075; /* Generated */ } /* Generated */ if( optInFastPeriod != 0 ) /* Generated */ k2 = PER_TO_K(optInFastPeriod); /* Generated */ else /* Generated */ { /* Generated */ optInFastPeriod = 12; /* Generated */ k2 = (double)0.15; /* Generated */ } /* Generated */ lookbackSignal = TA_EMA_Lookback( optInSignalPeriod_2 ); /* Generated */ lookbackTotal = lookbackSignal; /* Generated */ lookbackTotal += TA_EMA_Lookback( optInSlowPeriod ); /* Generated */ if( startIdx < lookbackTotal ) /* Generated */ startIdx = lookbackTotal; /* Generated */ if( startIdx > endIdx ) /* Generated */ { /* Generated */ *outBegIdx = 0; /* Generated */ *outNbElement = 0; /* Generated */ return TA_SUCCESS; /* Generated */ } /* Generated */ tempInteger = (endIdx-startIdx)+1+lookbackSignal; /* Generated */ ARRAY_ALLOC( fastEMABuffer, tempInteger ); /* Generated */ if( !fastEMABuffer ) /* Generated */ { /* Generated */ *outBegIdx = 0; /* Generated */ *outNbElement = 0; /* Generated */ return TA_ALLOC_ERR; /* Generated */ } /* Generated */ ARRAY_ALLOC( slowEMABuffer, tempInteger ); /* Generated */ if( !slowEMABuffer ) /* Generated */ { /* Generated */ *outBegIdx = 0; /* Generated */ *outNbElement = 0; /* Generated */ ARRAY_FREE( fastEMABuffer ); /* Generated */ return TA_ALLOC_ERR; /* Generated */ } /* Generated */ tempInteger = startIdx-lookbackSignal; /* Generated */ retCode = TA_PREFIX(INT_EMA)( tempInteger, endIdx, /* Generated */ inReal, optInSlowPeriod, k1, /* Generated */ &outBegIdx1, &outNbElement1, slowEMABuffer ); /* Generated */ if( retCode != TA_SUCCESS ) /* Generated */ { /* Generated */ *outBegIdx = 0; /* Generated */ *outNbElement = 0; /* Generated */ ARRAY_FREE( fastEMABuffer ); /* Generated */ ARRAY_FREE( slowEMABuffer ); /* Generated */ return retCode; /* Generated */ } /* Generated */ retCode = TA_PREFIX(INT_EMA)( tempInteger, endIdx, /* Generated */ inReal, optInFastPeriod, k2, /* Generated */ &outBegIdx2, &outNbElement2, fastEMABuffer ); /* Generated */ if( retCode != TA_SUCCESS ) /* Generated */ { /* Generated */ *outBegIdx = 0; /* Generated */ *outNbElement = 0; /* Generated */ ARRAY_FREE( fastEMABuffer ); /* Generated */ ARRAY_FREE( slowEMABuffer ); /* Generated */ return retCode; /* Generated */ } /* Generated */ if( (outBegIdx1 != tempInteger) || /* Generated */ (outBegIdx2 != tempInteger) || /* Generated */ (outNbElement1 != outNbElement2) || /* Generated */ (outNbElement1 != (endIdx-startIdx)+1+lookbackSignal) ) /* Generated */ { /* Generated */ *outBegIdx = 0; /* Generated */ *outNbElement = 0; /* Generated */ ARRAY_FREE( fastEMABuffer ); /* Generated */ ARRAY_FREE( slowEMABuffer ); /* Generated */ return TA_INTERNAL_ERROR(119); /* Generated */ } /* Generated */ for( i=0; i < outNbElement1; i++ ) /* Generated */ fastEMABuffer[i] = fastEMABuffer[i] - slowEMABuffer[i]; /* Generated */ ARRAY_MEMMOVE( outMACD, 0, fastEMABuffer, lookbackSignal, (endIdx-startIdx)+1 ); /* Generated */ retCode = TA_INT_EMA( 0, outNbElement1-1, /* Generated */ fastEMABuffer, optInSignalPeriod_2, PER_TO_K(optInSignalPeriod_2), /* Generated */ &outBegIdx2, &outNbElement2, outMACDSignal ); /* Generated */ ARRAY_FREE( fastEMABuffer ); /* Generated */ ARRAY_FREE( slowEMABuffer ); /* Generated */ if( retCode != TA_SUCCESS ) /* Generated */ { /* Generated */ *outBegIdx = 0; /* Generated */ *outNbElement = 0; /* Generated */ return retCode; /* Generated */ } /* Generated */ for( i=0; i < outNbElement2; i++ ) /* Generated */ outMACDHist[i] = outMACD[i]-outMACDSignal[i]; /* Generated */ *outBegIdx = startIdx; /* Generated */ *outNbElement = outNbElement2; /* Generated */ return TA_SUCCESS; /* Generated */ }
void init_pluto_constants(void) { check_enum_names(ARRAY_REF(pluto_enum_names_checklist)); }
* TEST_INDECENT_PROPOSAL * USE_3DES USE_AES USE_MD5 USE_SERPENT USE_SHA1 USE_SHA2 USE_TWOFISH * USE_KEYRR */ static const char *const kern_interface_name[] = { "no-kernel", /* run without stack */ "klips", "netkey", "win2k", "mastklips", "bsdkame" }; enum_names kern_interface_names = { NO_KERNEL, USE_BSDKAME, ARRAY_REF(kern_interface_name), NULL }; /* DPD actions */ static const char *const dpd_action_name[] = { "action:disabled", "action:clear", "action:hold", "action:restart", }; enum_names dpd_action_names = { DPD_ACTION_DISABLED, DPD_ACTION_RESTART, ARRAY_REF(dpd_action_name), NULL
/* Generated */ TA_RetCode TA_S_STOCHF( int startIdx, /* Generated */ int endIdx, /* Generated */ const float inHigh_0[], /* Generated */ const float inLow_0[], /* Generated */ const float inClose_0[], /* Generated */ int optInFastK_Period_0, /* From 1 to 100000 */ /* Generated */ int optInFastD_Period_1, /* From 1 to 100000 */ /* Generated */ TA_MAType optInFastD_MAType_2, /* Generated */ int *outBegIdx, /* Generated */ int *outNbElement, /* Generated */ double outFastK_0[], /* Generated */ double outFastD_1[] ) /* Generated */ #endif /* Generated */ { /* Generated */ TA_RetCode retCode; /* Generated */ double lowest, highest, tmp, diff; /* Generated */ ARRAY_REF( tempBuffer ); /* Generated */ int outIdx, lowestIdx, highestIdx; /* Generated */ int lookbackTotal, lookbackK, lookbackFastD; /* Generated */ int trailingIdx, today, i; /* Generated */ #if !defined( _MANAGED ) && !defined(USE_SINGLE_PRECISION_INPUT) /* Generated */ int bufferIsAllocated; /* Generated */ #endif /* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK /* Generated */ if( startIdx < 0 ) /* Generated */ return TA_OUT_OF_RANGE_START_INDEX; /* Generated */ if( (endIdx < 0) || (endIdx < startIdx)) /* Generated */ return TA_OUT_OF_RANGE_END_INDEX; /* Generated */ if(!inHigh_0||!inLow_0||!inClose_0) /* Generated */ return TA_BAD_PARAM; /* Generated */ if( (int)optInFastK_Period_0 == TA_INTEGER_DEFAULT ) /* Generated */ optInFastK_Period_0 = 5; /* Generated */ else if( ((int)optInFastK_Period_0 < 1) || ((int)optInFastK_Period_0 > 100000) ) /* Generated */ return TA_BAD_PARAM; /* Generated */ if( (int)optInFastD_Period_1 == TA_INTEGER_DEFAULT ) /* Generated */ optInFastD_Period_1 = 3; /* Generated */ else if( ((int)optInFastD_Period_1 < 1) || ((int)optInFastD_Period_1 > 100000) ) /* Generated */ return TA_BAD_PARAM; /* Generated */ #if !defined(_MANAGED) /* Generated */ if( (int)optInFastD_MAType_2 == TA_INTEGER_DEFAULT ) /* Generated */ optInFastD_MAType_2 = 0; /* Generated */ else if( ((int)optInFastD_MAType_2 < 0) || ((int)optInFastD_MAType_2 > 8) ) /* Generated */ return TA_BAD_PARAM; /* Generated */ #endif /* Generated */ if( outFastK_0 == NULL ) /* Generated */ return TA_BAD_PARAM; /* Generated */ if( outFastD_1 == NULL ) /* Generated */ return TA_BAD_PARAM; /* Generated */ #endif /* Generated */ lookbackK = optInFastK_Period_0-1; /* Generated */ lookbackFastD = TA_MA_Lookback( optInFastD_Period_1, optInFastD_MAType_2 ); /* Generated */ lookbackTotal = lookbackK + lookbackFastD; /* Generated */ if( startIdx < lookbackTotal ) /* Generated */ startIdx = lookbackTotal; /* Generated */ if( startIdx > endIdx ) /* Generated */ { /* Generated */ *outBegIdx = 0; /* Generated */ *outNbElement = 0; /* Generated */ return TA_SUCCESS; /* Generated */ } /* Generated */ outIdx = 0; /* Generated */ trailingIdx = startIdx-lookbackTotal; /* Generated */ today = trailingIdx+lookbackK; /* Generated */ lowestIdx = highestIdx = -1; /* Generated */ diff = highest = lowest = 0.0; /* Generated */ #if !defined( _MANAGED ) && !defined(USE_SINGLE_PRECISION_INPUT) /* Generated */ bufferIsAllocated = 0; /* Generated */ #endif /* Generated */ #if defined(USE_SINGLE_PRECISION_INPUT) /* Generated */ ARRAY_ALLOC( tempBuffer, endIdx-today+1 ); /* Generated */ #else /* Generated */ if( (outFastK_0 == inHigh_0) || /* Generated */ (outFastK_0 == inLow_0) || /* Generated */ (outFastK_0 == inClose_0) ) /* Generated */ { /* Generated */ tempBuffer = outFastK_0; /* Generated */ } /* Generated */ else if( (outFastD_1 == inHigh_0) || /* Generated */ (outFastD_1 == inLow_0) || /* Generated */ (outFastD_1 == inClose_0) ) /* Generated */ { /* Generated */ tempBuffer = outFastD_1; /* Generated */ } /* Generated */ else /* Generated */ { /* Generated */ #if !defined( _MANAGED ) /* Generated */ bufferIsAllocated = 1; /* Generated */ #endif /* Generated */ ARRAY_ALLOC(tempBuffer, endIdx-today+1 ); /* Generated */ } /* Generated */ #endif /* Generated */ while( today <= endIdx ) /* Generated */ { /* Generated */ tmp = inLow_0[today]; /* Generated */ if( lowestIdx < trailingIdx ) /* Generated */ { /* Generated */ lowestIdx = trailingIdx; /* Generated */ lowest = inLow_0[lowestIdx]; /* Generated */ i = lowestIdx; /* Generated */ while( ++i<=today ) /* Generated */ { /* Generated */ tmp = inLow_0[i]; /* Generated */ if( tmp < lowest ) /* Generated */ { /* Generated */ lowestIdx = i; /* Generated */ lowest = tmp; /* Generated */ } /* Generated */ } /* Generated */ diff = (highest - lowest)/100.0; /* Generated */ } /* Generated */ else if( tmp <= lowest ) /* Generated */ { /* Generated */ lowestIdx = today; /* Generated */ lowest = tmp; /* Generated */ diff = (highest - lowest)/100.0; /* Generated */ } /* Generated */ tmp = inHigh_0[today]; /* Generated */ if( highestIdx < trailingIdx ) /* Generated */ { /* Generated */ highestIdx = trailingIdx; /* Generated */ highest = inHigh_0[highestIdx]; /* Generated */ i = highestIdx; /* Generated */ while( ++i<=today ) /* Generated */ { /* Generated */ tmp = inHigh_0[i]; /* Generated */ if( tmp > highest ) /* Generated */ { /* Generated */ highestIdx = i; /* Generated */ highest = tmp; /* Generated */ } /* Generated */ } /* Generated */ diff = (highest - lowest)/100.0; /* Generated */ } /* Generated */ else if( tmp >= highest ) /* Generated */ { /* Generated */ highestIdx = today; /* Generated */ highest = tmp; /* Generated */ diff = (highest - lowest)/100.0; /* Generated */ } /* Generated */ if( diff != 0.0 ) /* Generated */ tempBuffer[outIdx++] = (inClose_0[today]-lowest)/diff; /* Generated */ else /* Generated */ tempBuffer[outIdx++] = 0.0; /* Generated */ trailingIdx++; /* Generated */ today++; /* Generated */ } /* Generated */ retCode = TA_MA( 0, outIdx-1, /* Generated */ tempBuffer, optInFastD_Period_1, /* Generated */ optInFastD_MAType_2, /* Generated */ outBegIdx, outNbElement, outFastD_1 ); /* Generated */ if( (retCode != TA_SUCCESS) || (*outNbElement == 0) ) /* Generated */ { /* Generated */ #if defined(USE_SINGLE_PRECISION_INPUT) /* Generated */ ARRAY_FREE( tempBuffer ); /* Generated */ #else /* Generated */ ARRAY_FREE_COND( bufferIsAllocated, tempBuffer ); /* Generated */ #endif /* Generated */ *outBegIdx = 0; /* Generated */ *outNbElement = 0; /* Generated */ return retCode; /* Generated */ } /* Generated */ ARRAY_MEMMOVE( outFastK_0, 0, tempBuffer, lookbackFastD, *outNbElement ); /* Generated */ #if defined(USE_SINGLE_PRECISION_INPUT) /* Generated */ ARRAY_FREE( tempBuffer ); /* Generated */ #else /* Generated */ ARRAY_FREE_COND( bufferIsAllocated, tempBuffer ); /* Generated */ #endif /* Generated */ if( retCode != TA_SUCCESS ) /* Generated */ { /* Generated */ *outBegIdx = 0; /* Generated */ *outNbElement = 0; /* Generated */ return retCode; /* Generated */ } /* Generated */ *outBegIdx = startIdx; /* Generated */ return TA_SUCCESS; /* Generated */ }
/* Generated */ TA_RetCode TA_S_ACCBANDS( int startIdx, /* Generated */ int endIdx, /* Generated */ const float inHigh[], /* Generated */ const float inLow[], /* Generated */ const float inClose[], /* Generated */ int optInTimePeriod, /* From 2 to 100000 */ /* Generated */ int *outBegIdx, /* Generated */ int *outNBElement, /* Generated */ double outRealUpperBand[], /* Generated */ double outRealMiddleBand[], /* Generated */ double outRealLowerBand[] ) /* Generated */ #endif /* Generated */ { /* Generated */ ENUM_DECLARATION(RetCode) retCode; /* Generated */ ARRAY_REF( tempBuffer1 ); /* Generated */ ARRAY_REF( tempBuffer2 ); /* Generated */ VALUE_HANDLE_INT(outBegIdxDummy); /* Generated */ VALUE_HANDLE_INT(outNbElementDummy); /* Generated */ int i, j, outputSize, bufferSize, lookbackTotal; /* Generated */ double tempReal; /* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK /* Generated */ if( startIdx < 0 ) /* Generated */ return ENUM_VALUE(RetCode,TA_OUT_OF_RANGE_START_INDEX,OutOfRangeStartIndex); /* Generated */ if( (endIdx < 0) || (endIdx < startIdx)) /* Generated */ return ENUM_VALUE(RetCode,TA_OUT_OF_RANGE_END_INDEX,OutOfRangeEndIndex); /* Generated */ #if !defined(_JAVA) /* Generated */ if(!inHigh||!inLow||!inClose) /* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam); /* Generated */ #endif /* Generated */ if( (int)optInTimePeriod == TA_INTEGER_DEFAULT ) /* Generated */ optInTimePeriod = 20; /* Generated */ else if( ((int)optInTimePeriod < 2) || ((int)optInTimePeriod > 100000) ) /* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam); /* Generated */ #if !defined(_JAVA) /* Generated */ if( !outRealUpperBand ) /* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam); /* Generated */ if( !outRealMiddleBand ) /* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam); /* Generated */ if( !outRealLowerBand ) /* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam); /* Generated */ #endif /* Generated */ #endif /* Generated */ lookbackTotal = LOOKBACK_CALL(SMA)( optInTimePeriod ); /* Generated */ if( startIdx < lookbackTotal ) /* Generated */ startIdx = lookbackTotal; /* Generated */ if( startIdx > endIdx ) /* Generated */ { /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); /* Generated */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success); /* Generated */ } /* Generated */ outputSize = endIdx-startIdx+1; /* Generated */ bufferSize = outputSize+lookbackTotal; /* Generated */ ARRAY_ALLOC(tempBuffer1, bufferSize ); /* Generated */ #if !defined(_JAVA) /* Generated */ if( !tempBuffer1 ) /* Generated */ { /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); /* Generated */ return ENUM_VALUE(RetCode,TA_ALLOC_ERR,AllocErr); /* Generated */ } /* Generated */ #endif /* Generated */ ARRAY_ALLOC(tempBuffer2, bufferSize ); /* Generated */ #if !defined(_JAVA) /* Generated */ if( !tempBuffer2 ) /* Generated */ { /* Generated */ ARRAY_FREE(tempBuffer1); /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); /* Generated */ return ENUM_VALUE(RetCode,TA_ALLOC_ERR,AllocErr); /* Generated */ } /* Generated */ #endif /* Generated */ for(j=0, i=startIdx-lookbackTotal; i<=endIdx; i++, j++) /* Generated */ { /* Generated */ tempReal = inHigh[i]+inLow[i]; /* Generated */ if( !TA_IS_ZERO(tempReal) ) /* Generated */ { /* Generated */ tempReal = 4*(inHigh[i]-inLow[i])/tempReal; /* Generated */ tempBuffer1[j] = inHigh[i]*(1+tempReal); /* Generated */ tempBuffer2[j] = inLow[i]*(1-tempReal); /* Generated */ } /* Generated */ else /* Generated */ { /* Generated */ tempBuffer1[j] = inHigh[i]; /* Generated */ tempBuffer2[j] = inLow[i]; /* Generated */ } /* Generated */ } /* Generated */ retCode = FUNCTION_CALL(SMA)( startIdx, endIdx, inClose, /* Generated */ optInTimePeriod, /* Generated */ VALUE_HANDLE_OUT(outBegIdxDummy), VALUE_HANDLE_OUT(outNbElementDummy), outRealMiddleBand ); /* Generated */ if( (retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) || ((int)VALUE_HANDLE_GET(outNbElementDummy) != outputSize) ) /* Generated */ { /* Generated */ ARRAY_FREE( tempBuffer1 ); /* Generated */ ARRAY_FREE( tempBuffer2 ); /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); /* Generated */ return retCode; /* Generated */ } /* Generated */ retCode = FUNCTION_CALL_DOUBLE(SMA)( 0, bufferSize-1, tempBuffer1, /* Generated */ optInTimePeriod, /* Generated */ VALUE_HANDLE_OUT(outBegIdxDummy), VALUE_HANDLE_OUT(outNbElementDummy), /* Generated */ outRealUpperBand ); /* Generated */ if( (retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) || ((int)VALUE_HANDLE_GET(outNbElementDummy) != outputSize) ) /* Generated */ { /* Generated */ ARRAY_FREE( tempBuffer1 ); /* Generated */ ARRAY_FREE( tempBuffer2 ); /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); /* Generated */ return retCode; /* Generated */ } /* Generated */ retCode = FUNCTION_CALL_DOUBLE(SMA)( 0, bufferSize-1, tempBuffer2, /* Generated */ optInTimePeriod, /* Generated */ VALUE_HANDLE_OUT(outBegIdxDummy), VALUE_HANDLE_OUT(outNbElementDummy), /* Generated */ outRealLowerBand ); /* Generated */ ARRAY_FREE( tempBuffer1 ); /* Generated */ ARRAY_FREE( tempBuffer2 ); /* Generated */ if( (retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) || ((int)VALUE_HANDLE_GET(outNbElementDummy) != outputSize) ) /* Generated */ { /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); /* Generated */ return retCode; /* Generated */ } /* Generated */ VALUE_HANDLE_DEREF(outBegIdx) = startIdx; /* Generated */ VALUE_HANDLE_DEREF(outNBElement) = outputSize; /* Generated */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success); /* Generated */ }
/* Generated */ TA_RetCode TA_S_MACDEXT( int startIdx, /* Generated */ int endIdx, /* Generated */ const float inReal[], /* Generated */ int optInFastPeriod, /* From 2 to 100000 */ /* Generated */ TA_MAType optInFastMAType, /* Generated */ int optInSlowPeriod, /* From 2 to 100000 */ /* Generated */ TA_MAType optInSlowMAType, /* Generated */ int optInSignalPeriod, /* From 1 to 100000 */ /* Generated */ TA_MAType optInSignalMAType, /* Generated */ int *outBegIdx, /* Generated */ int *outNbElement, /* Generated */ double outMACD[], /* Generated */ double outMACDSignal[], /* Generated */ double outMACDHist[] ) /* Generated */ #endif /* Generated */ { /* Generated */ ARRAY_REF( slowMABuffer ); /* Generated */ ARRAY_REF( fastMABuffer ); /* Generated */ TA_RetCode retCode; /* Generated */ int tempInteger, outBegIdx1, outNbElement1; /* Generated */ int outBegIdx2, outNbElement2; /* Generated */ int lookbackTotal, lookbackSignal, lookbackLargest; /* Generated */ int i; /* Generated */ TA_MAType tempMAType; /* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK /* Generated */ if( startIdx < 0 ) /* Generated */ return TA_OUT_OF_RANGE_START_INDEX; /* Generated */ if( (endIdx < 0) || (endIdx < startIdx)) /* Generated */ return TA_OUT_OF_RANGE_END_INDEX; /* Generated */ if( !inReal ) return TA_BAD_PARAM; /* Generated */ if( (int)optInFastPeriod == TA_INTEGER_DEFAULT ) /* Generated */ optInFastPeriod = 12; /* Generated */ else if( ((int)optInFastPeriod < 2) || ((int)optInFastPeriod > 100000) ) /* Generated */ return TA_BAD_PARAM; /* Generated */ #if !defined(_MANAGED) /* Generated */ if( (int)optInFastMAType == TA_INTEGER_DEFAULT ) /* Generated */ optInFastMAType = 0; /* Generated */ else if( ((int)optInFastMAType < 0) || ((int)optInFastMAType > 8) ) /* Generated */ return TA_BAD_PARAM; /* Generated */ #endif /* Generated */ if( (int)optInSlowPeriod == TA_INTEGER_DEFAULT ) /* Generated */ optInSlowPeriod = 26; /* Generated */ else if( ((int)optInSlowPeriod < 2) || ((int)optInSlowPeriod > 100000) ) /* Generated */ return TA_BAD_PARAM; /* Generated */ #if !defined(_MANAGED) /* Generated */ if( (int)optInSlowMAType == TA_INTEGER_DEFAULT ) /* Generated */ optInSlowMAType = 0; /* Generated */ else if( ((int)optInSlowMAType < 0) || ((int)optInSlowMAType > 8) ) /* Generated */ return TA_BAD_PARAM; /* Generated */ #endif /* Generated */ if( (int)optInSignalPeriod == TA_INTEGER_DEFAULT ) /* Generated */ optInSignalPeriod = 9; /* Generated */ else if( ((int)optInSignalPeriod < 1) || ((int)optInSignalPeriod > 100000) ) /* Generated */ return TA_BAD_PARAM; /* Generated */ #if !defined(_MANAGED) /* Generated */ if( (int)optInSignalMAType == TA_INTEGER_DEFAULT ) /* Generated */ optInSignalMAType = 0; /* Generated */ else if( ((int)optInSignalMAType < 0) || ((int)optInSignalMAType > 8) ) /* Generated */ return TA_BAD_PARAM; /* Generated */ #endif /* Generated */ if( outMACD == NULL ) /* Generated */ return TA_BAD_PARAM; /* Generated */ if( outMACDSignal == NULL ) /* Generated */ return TA_BAD_PARAM; /* Generated */ if( outMACDHist == NULL ) /* Generated */ return TA_BAD_PARAM; /* Generated */ #endif /* Generated */ if( optInSlowPeriod < optInFastPeriod ) /* Generated */ { /* Generated */ tempInteger = optInSlowPeriod; /* Generated */ optInSlowPeriod = optInFastPeriod; /* Generated */ optInFastPeriod = tempInteger; /* Generated */ tempMAType = optInSlowMAType; /* Generated */ optInSlowMAType = optInFastMAType; /* Generated */ optInFastMAType = tempMAType; /* Generated */ } /* Generated */ lookbackLargest = TA_MA_Lookback( optInFastPeriod, optInFastMAType ); /* Generated */ tempInteger = TA_MA_Lookback( optInSlowPeriod, optInSlowMAType ); /* Generated */ if( tempInteger > lookbackLargest ) /* Generated */ lookbackLargest = tempInteger; /* Generated */ lookbackSignal = TA_MA_Lookback( optInSignalPeriod, optInSignalMAType ); /* Generated */ lookbackTotal = lookbackSignal+lookbackLargest; /* Generated */ if( startIdx < lookbackTotal ) /* Generated */ startIdx = lookbackTotal; /* Generated */ if( startIdx > endIdx ) /* Generated */ { /* Generated */ *outBegIdx = 0; /* Generated */ *outNbElement = 0; /* Generated */ return TA_SUCCESS; /* Generated */ } /* Generated */ tempInteger = (endIdx-startIdx)+1+lookbackSignal; /* Generated */ ARRAY_ALLOC( fastMABuffer, tempInteger ); /* Generated */ if( !fastMABuffer ) /* Generated */ { /* Generated */ *outBegIdx = 0; /* Generated */ *outNbElement = 0; /* Generated */ return TA_ALLOC_ERR; /* Generated */ } /* Generated */ ARRAY_ALLOC( slowMABuffer, tempInteger ); /* Generated */ if( !slowMABuffer ) /* Generated */ { /* Generated */ *outBegIdx = 0; /* Generated */ *outNbElement = 0; /* Generated */ ARRAY_FREE( fastMABuffer ); /* Generated */ return TA_ALLOC_ERR; /* Generated */ } /* Generated */ tempInteger = startIdx-lookbackSignal; /* Generated */ retCode = TA_PREFIX(MA)( tempInteger, endIdx, /* Generated */ inReal, optInSlowPeriod, optInSlowMAType, /* Generated */ &outBegIdx1, &outNbElement1, slowMABuffer ); /* Generated */ if( retCode != TA_SUCCESS ) /* Generated */ { /* Generated */ *outBegIdx = 0; /* Generated */ *outNbElement = 0; /* Generated */ ARRAY_FREE( fastMABuffer ); /* Generated */ ARRAY_FREE( slowMABuffer ); /* Generated */ return retCode; /* Generated */ } /* Generated */ retCode = TA_PREFIX(MA)( tempInteger, endIdx, /* Generated */ inReal, optInFastPeriod, optInFastMAType, /* Generated */ &outBegIdx2, &outNbElement2, fastMABuffer ); /* Generated */ if( retCode != TA_SUCCESS ) /* Generated */ { /* Generated */ *outBegIdx = 0; /* Generated */ *outNbElement = 0; /* Generated */ ARRAY_FREE( fastMABuffer ); /* Generated */ ARRAY_FREE( slowMABuffer ); /* Generated */ return retCode; /* Generated */ } /* Generated */ if( (outBegIdx1 != tempInteger) || /* Generated */ (outBegIdx2 != tempInteger) || /* Generated */ (outNbElement1 != outNbElement2) || /* Generated */ (outNbElement1 != (endIdx-startIdx)+1+lookbackSignal) ) /* Generated */ { /* Generated */ *outBegIdx = 0; /* Generated */ *outNbElement = 0; /* Generated */ ARRAY_FREE( fastMABuffer ); /* Generated */ ARRAY_FREE( slowMABuffer ); /* Generated */ return TA_INTERNAL_ERROR(119); /* Generated */ } /* Generated */ for( i=0; i < outNbElement1; i++ ) /* Generated */ fastMABuffer[i] = fastMABuffer[i] - slowMABuffer[i]; /* Generated */ ARRAY_MEMMOVE( outMACD, 0, fastMABuffer, lookbackSignal, (endIdx-startIdx)+1 ); /* Generated */ retCode = TA_MA( 0, outNbElement1-1, /* Generated */ fastMABuffer, optInSignalPeriod, optInSignalMAType, /* Generated */ &outBegIdx2, &outNbElement2, outMACDSignal ); /* Generated */ ARRAY_FREE( fastMABuffer ); /* Generated */ ARRAY_FREE( slowMABuffer ); /* Generated */ if( retCode != TA_SUCCESS ) /* Generated */ { /* Generated */ *outBegIdx = 0; /* Generated */ *outNbElement = 0; /* Generated */ return retCode; /* Generated */ } /* Generated */ for( i=0; i < outNbElement2; i++ ) /* Generated */ outMACDHist[i] = outMACD[i]-outMACDSignal[i]; /* Generated */ *outBegIdx = startIdx; /* Generated */ *outNbElement = outNbElement2; /* Generated */ return TA_SUCCESS; /* Generated */ }
/* Generated */ TA_RetCode TA_S_MA( int startIdx, /* Generated */ int endIdx, /* Generated */ const float inReal[], /* Generated */ int optInTimePeriod, /* From 1 to 100000 */ /* Generated */ TA_MAType optInMAType, /* Generated */ int *outBegIdx, /* Generated */ int *outNbElement, /* Generated */ double outReal[] ) /* Generated */ #endif /* Generated */ { /* Generated */ ARRAY_REF(dummyBuffer); /* Generated */ TA_RetCode retCode; /* Generated */ int nbElement; /* Generated */ int outIdx, todayIdx; /* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK /* Generated */ if( startIdx < 0 ) /* Generated */ return TA_OUT_OF_RANGE_START_INDEX; /* Generated */ if( (endIdx < 0) || (endIdx < startIdx)) /* Generated */ return TA_OUT_OF_RANGE_END_INDEX; /* Generated */ if( !inReal ) return TA_BAD_PARAM; /* Generated */ if( (int)optInTimePeriod == TA_INTEGER_DEFAULT ) /* Generated */ optInTimePeriod = 30; /* Generated */ else if( ((int)optInTimePeriod < 1) || ((int)optInTimePeriod > 100000) ) /* Generated */ return TA_BAD_PARAM; /* Generated */ #if !defined(_MANAGED) /* Generated */ if( (int)optInMAType == TA_INTEGER_DEFAULT ) /* Generated */ optInMAType = 0; /* Generated */ else if( ((int)optInMAType < 0) || ((int)optInMAType > 8) ) /* Generated */ return TA_BAD_PARAM; /* Generated */ #endif /* Generated */ if( outReal == NULL ) /* Generated */ return TA_BAD_PARAM; /* Generated */ #endif /* Generated */ if( optInTimePeriod == 1 ) /* Generated */ { /* Generated */ nbElement = endIdx-startIdx+1; /* Generated */ *outNbElement = nbElement; /* Generated */ for( todayIdx=startIdx, outIdx=0; outIdx < nbElement; outIdx++, todayIdx++ ) /* Generated */ outReal[outIdx] = inReal[todayIdx]; /* Generated */ *outBegIdx = startIdx; /* Generated */ return TA_SUCCESS; /* Generated */ } /* Generated */ switch( optInMAType ) /* Generated */ { /* Generated */ case TA_MAType_SMA: /* Generated */ retCode = TA_PREFIX(INT_SMA)( startIdx, endIdx, inReal, optInTimePeriod, /* Generated */ outBegIdx, outNbElement, outReal ); /* Generated */ break; /* Generated */ case TA_MAType_EMA: /* Generated */ retCode = TA_PREFIX(INT_EMA)( startIdx, endIdx, inReal, /* Generated */ optInTimePeriod, PER_TO_K(optInTimePeriod), /* Generated */ outBegIdx, outNbElement, outReal ); /* Generated */ break; /* Generated */ case TA_MAType_WMA: /* Generated */ retCode = TA_PREFIX(WMA)( startIdx, endIdx, inReal, optInTimePeriod, /* Generated */ outBegIdx, outNbElement, outReal ); /* Generated */ break; /* Generated */ case TA_MAType_DEMA: /* Generated */ retCode = TA_PREFIX(DEMA)( startIdx, endIdx, inReal, optInTimePeriod, /* Generated */ outBegIdx, outNbElement, outReal ); /* Generated */ break; /* Generated */ case TA_MAType_TEMA: /* Generated */ retCode = TA_PREFIX(TEMA)( startIdx, endIdx, inReal, optInTimePeriod, /* Generated */ outBegIdx, outNbElement, outReal ); /* Generated */ break; /* Generated */ case TA_MAType_TRIMA: /* Generated */ retCode = TA_PREFIX(TRIMA)( startIdx, endIdx, inReal, optInTimePeriod, /* Generated */ outBegIdx, outNbElement, outReal ); /* Generated */ break; /* Generated */ case TA_MAType_KAMA: /* Generated */ retCode = TA_PREFIX(KAMA)( startIdx, endIdx, inReal, optInTimePeriod, /* Generated */ outBegIdx, outNbElement, outReal ); /* Generated */ break; /* Generated */ case TA_MAType_MAMA: /* Generated */ ARRAY_ALLOC(dummyBuffer, (endIdx-startIdx+1) ); /* Generated */ if( !dummyBuffer ) /* Generated */ return TA_ALLOC_ERR; /* Generated */ retCode = TA_PREFIX(MAMA)( startIdx, endIdx, inReal, 0.5, 0.05, /* Generated */ outBegIdx, outNbElement, /* Generated */ outReal, dummyBuffer ); /* Generated */ ARRAY_FREE( dummyBuffer ); /* Generated */ break; /* Generated */ case TA_MAType_T3: /* Generated */ retCode = TA_PREFIX(T3)( startIdx, endIdx, inReal, /* Generated */ optInTimePeriod, 0.7, /* Generated */ outBegIdx, outNbElement, outReal ); /* Generated */ break; /* Generated */ default: /* Generated */ retCode = TA_BAD_PARAM; /* Generated */ break; /* Generated */ } /* Generated */ return retCode; /* Generated */ }
/* Generated */ TA_RetCode TA_S_TEMA( int startIdx, /* Generated */ int endIdx, /* Generated */ const float inReal_0[], /* Generated */ int optInTimePeriod_0, /* From 2 to 100000 */ /* Generated */ int *outBegIdx, /* Generated */ int *outNbElement, /* Generated */ double outReal_0[] ) /* Generated */ #endif /* Generated */ { /* Generated */ ARRAY_REF(firstEMA); /* Generated */ ARRAY_REF(secondEMA); /* Generated */ double k; /* Generated */ int firstEMABegIdx, firstEMANbElement; /* Generated */ int secondEMABegIdx, secondEMANbElement; /* Generated */ int thirdEMABegIdx, thirdEMANbElement; /* Generated */ int tempInt, outIdx, lookbackTotal, lookbackEMA; /* Generated */ int firstEMAIdx, secondEMAIdx; /* Generated */ TA_RetCode retCode; /* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK /* Generated */ if( startIdx < 0 ) /* Generated */ return TA_OUT_OF_RANGE_START_INDEX; /* Generated */ if( (endIdx < 0) || (endIdx < startIdx)) /* Generated */ return TA_OUT_OF_RANGE_END_INDEX; /* Generated */ if( !inReal_0 ) return TA_BAD_PARAM; /* Generated */ if( (int)optInTimePeriod_0 == TA_INTEGER_DEFAULT ) /* Generated */ optInTimePeriod_0 = 30; /* Generated */ else if( ((int)optInTimePeriod_0 < 2) || ((int)optInTimePeriod_0 > 100000) ) /* Generated */ return TA_BAD_PARAM; /* Generated */ if( outReal_0 == NULL ) /* Generated */ return TA_BAD_PARAM; /* Generated */ #endif /* Generated */ *outNbElement = 0; /* Generated */ *outBegIdx = 0; /* Generated */ lookbackEMA = TA_EMA_Lookback( optInTimePeriod_0 ); /* Generated */ lookbackTotal = lookbackEMA * 3; /* Generated */ if( startIdx < lookbackTotal ) /* Generated */ startIdx = lookbackTotal; /* Generated */ if( startIdx > endIdx ) /* Generated */ return TA_SUCCESS; /* Generated */ tempInt = lookbackTotal+(endIdx-startIdx)+1; /* Generated */ ARRAY_ALLOC(firstEMA,tempInt); /* Generated */ if( !firstEMA ) /* Generated */ return TA_ALLOC_ERR; /* Generated */ k = PER_TO_K(optInTimePeriod_0); /* Generated */ retCode = TA_PREFIX(INT_EMA)( startIdx-(lookbackEMA*2), endIdx, inReal_0, /* Generated */ optInTimePeriod_0, k, /* Generated */ &firstEMABegIdx, &firstEMANbElement, firstEMA ); /* Generated */ if( (retCode != TA_SUCCESS) || (firstEMANbElement == 0) ) /* Generated */ { /* Generated */ ARRAY_FREE( firstEMA ); /* Generated */ return retCode; /* Generated */ } /* Generated */ ARRAY_ALLOC(secondEMA,firstEMANbElement); /* Generated */ if( !secondEMA ) /* Generated */ { /* Generated */ ARRAY_FREE( firstEMA ); /* Generated */ return TA_ALLOC_ERR; /* Generated */ } /* Generated */ retCode = TA_INT_EMA( 0, firstEMANbElement-1, firstEMA, /* Generated */ optInTimePeriod_0, k, /* Generated */ &secondEMABegIdx, &secondEMANbElement, secondEMA ); /* Generated */ if( (retCode != TA_SUCCESS) || (secondEMANbElement == 0) ) /* Generated */ { /* Generated */ ARRAY_FREE( firstEMA ); /* Generated */ ARRAY_FREE( secondEMA ); /* Generated */ return retCode; /* Generated */ } /* Generated */ retCode = TA_INT_EMA( 0, secondEMANbElement-1, secondEMA, /* Generated */ optInTimePeriod_0, k, /* Generated */ &thirdEMABegIdx, &thirdEMANbElement, /* Generated */ outReal_0 ); /* Generated */ if( (retCode != TA_SUCCESS) || (thirdEMANbElement == 0) ) /* Generated */ { /* Generated */ ARRAY_FREE( firstEMA ); /* Generated */ ARRAY_FREE( secondEMA ); /* Generated */ return retCode; /* Generated */ } /* Generated */ firstEMAIdx = thirdEMABegIdx + secondEMABegIdx; /* Generated */ secondEMAIdx = thirdEMABegIdx; /* Generated */ *outBegIdx = firstEMAIdx + firstEMABegIdx; /* Generated */ outIdx = 0; /* Generated */ while( outIdx < thirdEMANbElement ) /* Generated */ { /* Generated */ outReal_0[outIdx] += (3.0*firstEMA[firstEMAIdx++]) - (3.0*secondEMA[secondEMAIdx++]); /* Generated */ outIdx++; /* Generated */ } /* Generated */ ARRAY_FREE( firstEMA ); /* Generated */ ARRAY_FREE( secondEMA ); /* Generated */ *outNbElement = outIdx; /* Generated */ return TA_SUCCESS; /* Generated */ }
/* Generated */ TA_RetCode TA_S_BBANDS( int startIdx, /* Generated */ int endIdx, /* Generated */ const float inReal[], /* Generated */ int optInTimePeriod, /* From 2 to 100000 */ /* Generated */ double optInNbDevUp, /* From TA_REAL_MIN to TA_REAL_MAX */ /* Generated */ double optInNbDevDn, /* From TA_REAL_MIN to TA_REAL_MAX */ /* Generated */ TA_MAType optInMAType, /* Generated */ int *outBegIdx, /* Generated */ int *outNbElement, /* Generated */ double outRealUpperBand[], /* Generated */ double outRealMiddleBand[], /* Generated */ double outRealLowerBand[] ) /* Generated */ #endif /* Generated */ { /* Generated */ TA_RetCode retCode; /* Generated */ int i; /* Generated */ double tempReal, tempReal2; /* Generated */ ARRAY_REF(tempBuffer1); /* Generated */ ARRAY_REF(tempBuffer2); /* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK /* Generated */ if( startIdx < 0 ) /* Generated */ return TA_OUT_OF_RANGE_START_INDEX; /* Generated */ if( (endIdx < 0) || (endIdx < startIdx)) /* Generated */ return TA_OUT_OF_RANGE_END_INDEX; /* Generated */ if( !inReal ) return TA_BAD_PARAM; /* Generated */ if( (int)optInTimePeriod == TA_INTEGER_DEFAULT ) /* Generated */ optInTimePeriod = 5; /* Generated */ else if( ((int)optInTimePeriod < 2) || ((int)optInTimePeriod > 100000) ) /* Generated */ return TA_BAD_PARAM; /* Generated */ if( optInNbDevUp == TA_REAL_DEFAULT ) /* Generated */ optInNbDevUp = 2.000000e+0; /* Generated */ else if( (optInNbDevUp < -3.000000e+37) || (optInNbDevUp > 3.000000e+37) ) /* Generated */ return TA_BAD_PARAM; /* Generated */ if( optInNbDevDn == TA_REAL_DEFAULT ) /* Generated */ optInNbDevDn = 2.000000e+0; /* Generated */ else if( (optInNbDevDn < -3.000000e+37) || (optInNbDevDn > 3.000000e+37) ) /* Generated */ return TA_BAD_PARAM; /* Generated */ #if !defined(_MANAGED) /* Generated */ if( (int)optInMAType == TA_INTEGER_DEFAULT ) /* Generated */ optInMAType = 0; /* Generated */ else if( ((int)optInMAType < 0) || ((int)optInMAType > 8) ) /* Generated */ return TA_BAD_PARAM; /* Generated */ #endif /* Generated */ if( outRealUpperBand == NULL ) /* Generated */ return TA_BAD_PARAM; /* Generated */ if( outRealMiddleBand == NULL ) /* Generated */ return TA_BAD_PARAM; /* Generated */ if( outRealLowerBand == NULL ) /* Generated */ return TA_BAD_PARAM; /* Generated */ #endif /* Generated */ #if defined(USE_SINGLE_PRECISION_INPUT) /* Generated */ tempBuffer1 = outRealMiddleBand; /* Generated */ tempBuffer2 = outRealLowerBand; /* Generated */ #else /* Generated */ if( inReal == outRealUpperBand ) /* Generated */ { /* Generated */ tempBuffer1 = outRealMiddleBand; /* Generated */ tempBuffer2 = outRealLowerBand; /* Generated */ } /* Generated */ else if( inReal == outRealLowerBand ) /* Generated */ { /* Generated */ tempBuffer1 = outRealMiddleBand; /* Generated */ tempBuffer2 = outRealUpperBand; /* Generated */ } /* Generated */ else if( inReal == outRealMiddleBand ) /* Generated */ { /* Generated */ tempBuffer1 = outRealLowerBand; /* Generated */ tempBuffer2 = outRealUpperBand; /* Generated */ } /* Generated */ else /* Generated */ { /* Generated */ tempBuffer1 = outRealMiddleBand; /* Generated */ tempBuffer2 = outRealUpperBand; /* Generated */ } /* Generated */ if( (tempBuffer1 == inReal) || (tempBuffer2 == inReal) ) /* Generated */ return TA_BAD_PARAM; /* Generated */ #endif /* Generated */ retCode = TA_PREFIX(MA)( startIdx, endIdx, inReal, /* Generated */ optInTimePeriod, optInMAType, /* Generated */ outBegIdx, outNbElement, tempBuffer1 ); /* Generated */ if( (retCode != TA_SUCCESS) || (*outNbElement == 0) ) /* Generated */ { /* Generated */ *outNbElement = 0; /* Generated */ return retCode; /* Generated */ } /* Generated */ if( optInMAType == TA_MAType_SMA ) /* Generated */ { /* Generated */ TA_PREFIX(INT_stddev_using_precalc_ma)( inReal, tempBuffer1, /* Generated */ *outBegIdx, *outNbElement, /* Generated */ optInTimePeriod, tempBuffer2 ); /* Generated */ } /* Generated */ else /* Generated */ { /* Generated */ retCode = TA_PREFIX(STDDEV)( *outBegIdx, endIdx, inReal, /* Generated */ optInTimePeriod, 1.0, /* Generated */ outBegIdx, outNbElement, tempBuffer2 ); /* Generated */ if( retCode != TA_SUCCESS ) /* Generated */ { /* Generated */ *outNbElement = 0; /* Generated */ return retCode; /* Generated */ } /* Generated */ } /* Generated */ #if !defined(USE_SINGLE_PRECISION_INPUT) /* Generated */ if( tempBuffer1 != outRealMiddleBand ) /* Generated */ { /* Generated */ ARRAY_COPY( outRealMiddleBand, tempBuffer1, *outNbElement ); /* Generated */ } /* Generated */ #endif /* Generated */ if( optInNbDevUp == optInNbDevDn ) /* Generated */ { /* Generated */ if( optInNbDevUp == 1.0 ) /* Generated */ { /* Generated */ for( i=0; i < *outNbElement; i++ ) /* Generated */ { /* Generated */ tempReal = tempBuffer2[i]; /* Generated */ tempReal2 = outRealMiddleBand[i]; /* Generated */ outRealUpperBand[i] = tempReal2 + tempReal; /* Generated */ outRealLowerBand[i] = tempReal2 - tempReal; /* Generated */ } /* Generated */ } /* Generated */ else /* Generated */ { /* Generated */ for( i=0; i < *outNbElement; i++ ) /* Generated */ { /* Generated */ tempReal = tempBuffer2[i] * optInNbDevUp; /* Generated */ tempReal2 = outRealMiddleBand[i]; /* Generated */ outRealUpperBand[i] = tempReal2 + tempReal; /* Generated */ outRealLowerBand[i] = tempReal2 - tempReal; /* Generated */ } /* Generated */ } /* Generated */ } /* Generated */ else if( optInNbDevUp == 1.0 ) /* Generated */ { /* Generated */ for( i=0; i < *outNbElement; i++ ) /* Generated */ { /* Generated */ tempReal = tempBuffer2[i]; /* Generated */ tempReal2 = outRealMiddleBand[i]; /* Generated */ outRealUpperBand[i] = tempReal2 + tempReal; /* Generated */ outRealLowerBand[i] = tempReal2 - (tempReal * optInNbDevDn); /* Generated */ } /* Generated */ } /* Generated */ else if( optInNbDevDn == 1.0 ) /* Generated */ { /* Generated */ for( i=0; i < *outNbElement; i++ ) /* Generated */ { /* Generated */ tempReal = tempBuffer2[i]; /* Generated */ tempReal2 = outRealMiddleBand[i]; /* Generated */ outRealLowerBand[i] = tempReal2 - tempReal; /* Generated */ outRealUpperBand[i] = tempReal2 + (tempReal * optInNbDevUp); /* Generated */ } /* Generated */ } /* Generated */ else /* Generated */ { /* Generated */ for( i=0; i < *outNbElement; i++ ) /* Generated */ { /* Generated */ tempReal = tempBuffer2[i]; /* Generated */ tempReal2 = outRealMiddleBand[i]; /* Generated */ outRealUpperBand[i] = tempReal2 + (tempReal * optInNbDevUp); /* Generated */ outRealLowerBand[i] = tempReal2 - (tempReal * optInNbDevDn); /* Generated */ } /* Generated */ } /* Generated */ return TA_SUCCESS; /* Generated */ }
/* Generated */ TA_RetCode TA_S_TEMA( int startIdx, /* Generated */ int endIdx, /* Generated */ const float inReal[], /* Generated */ int optInTimePeriod, /* From 2 to 100000 */ /* Generated */ int *outBegIdx, /* Generated */ int *outNbElement, /* Generated */ double outReal[] ) /* Generated */ #endif /* Generated */ { /* Generated */ ARRAY_REF(firstEMA); /* Generated */ ARRAY_REF(secondEMA); /* Generated */ double k; /* Generated */ VALUE_HANDLE_INT(firstEMABegIdx); /* Generated */ VALUE_HANDLE_INT(firstEMANbElement); /* Generated */ VALUE_HANDLE_INT(secondEMABegIdx); /* Generated */ VALUE_HANDLE_INT(secondEMANbElement); /* Generated */ VALUE_HANDLE_INT(thirdEMABegIdx); /* Generated */ VALUE_HANDLE_INT(thirdEMANbElement); /* Generated */ int tempInt, outIdx, lookbackTotal, lookbackEMA; /* Generated */ int firstEMAIdx, secondEMAIdx; /* Generated */ TA_RetCode retCode; /* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK /* Generated */ if( startIdx < 0 ) /* Generated */ return NAMESPACE(TA_RetCode)TA_OUT_OF_RANGE_START_INDEX; /* Generated */ if( (endIdx < 0) || (endIdx < startIdx)) /* Generated */ return NAMESPACE(TA_RetCode)TA_OUT_OF_RANGE_END_INDEX; /* Generated */ #if !defined(_MANAGED) && !defined(_JAVA) /* Generated */ if( !inReal ) return NAMESPACE(TA_RetCode)TA_BAD_PARAM; /* Generated */ #endif /* Generated */ if( (int)optInTimePeriod == TA_INTEGER_DEFAULT ) /* Generated */ optInTimePeriod = 30; /* Generated */ else if( ((int)optInTimePeriod < 2) || ((int)optInTimePeriod > 100000) ) /* Generated */ return NAMESPACE(TA_RetCode)TA_BAD_PARAM; /* Generated */ #if !defined(_MANAGED) && !defined(_JAVA) /* Generated */ if( !outReal ) /* Generated */ return NAMESPACE(TA_RetCode)TA_BAD_PARAM; /* Generated */ #endif /* Generated */ #endif /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outNbElement); /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); /* Generated */ lookbackEMA = LOOKBACK_CALL(EMA)( optInTimePeriod ); /* Generated */ lookbackTotal = lookbackEMA * 3; /* Generated */ if( startIdx < lookbackTotal ) /* Generated */ startIdx = lookbackTotal; /* Generated */ if( startIdx > endIdx ) /* Generated */ return NAMESPACE(TA_RetCode)TA_SUCCESS; /* Generated */ tempInt = lookbackTotal+(endIdx-startIdx)+1; /* Generated */ ARRAY_ALLOC(firstEMA,tempInt); /* Generated */ #if !defined( _JAVA ) /* Generated */ if( !firstEMA ) /* Generated */ return NAMESPACE(TA_RetCode)TA_ALLOC_ERR; /* Generated */ #endif /* Generated */ k = PER_TO_K(optInTimePeriod); /* Generated */ retCode = FUNCTION_CALL(INT_EMA)( startIdx-(lookbackEMA*2), endIdx, inReal, /* Generated */ optInTimePeriod, k, /* Generated */ VALUE_HANDLE_OUT(firstEMABegIdx), VALUE_HANDLE_OUT(firstEMANbElement), /* Generated */ firstEMA ); /* Generated */ if( (retCode != NAMESPACE(TA_RetCode)TA_SUCCESS ) || (VALUE_HANDLE_GET(firstEMANbElement) == 0) ) /* Generated */ { /* Generated */ ARRAY_FREE( firstEMA ); /* Generated */ return retCode; /* Generated */ } /* Generated */ ARRAY_ALLOC(secondEMA,VALUE_HANDLE_GET(firstEMANbElement)); /* Generated */ #if !defined( _JAVA ) /* Generated */ if( !secondEMA ) /* Generated */ { /* Generated */ ARRAY_FREE( firstEMA ); /* Generated */ return NAMESPACE(TA_RetCode)TA_ALLOC_ERR; /* Generated */ } /* Generated */ #endif /* Generated */ retCode = FUNCTION_CALL_DOUBLE(INT_EMA)( 0, VALUE_HANDLE_GET(firstEMANbElement)-1, firstEMA, /* Generated */ optInTimePeriod, k, /* Generated */ VALUE_HANDLE_OUT(secondEMABegIdx), VALUE_HANDLE_OUT(secondEMANbElement), /* Generated */ secondEMA ); /* Generated */ if( (retCode != NAMESPACE(TA_RetCode)TA_SUCCESS ) || (VALUE_HANDLE_GET(secondEMANbElement) == 0) ) /* Generated */ { /* Generated */ ARRAY_FREE( firstEMA ); /* Generated */ ARRAY_FREE( secondEMA ); /* Generated */ return retCode; /* Generated */ } /* Generated */ retCode = FUNCTION_CALL_DOUBLE(INT_EMA)( 0, VALUE_HANDLE_GET(secondEMANbElement)-1, secondEMA, /* Generated */ optInTimePeriod, k, /* Generated */ VALUE_HANDLE_OUT(thirdEMABegIdx), VALUE_HANDLE_OUT(thirdEMANbElement), /* Generated */ outReal ); /* Generated */ if( (retCode != NAMESPACE(TA_RetCode)TA_SUCCESS ) || (VALUE_HANDLE_GET(thirdEMANbElement) == 0) ) /* Generated */ { /* Generated */ ARRAY_FREE( firstEMA ); /* Generated */ ARRAY_FREE( secondEMA ); /* Generated */ return retCode; /* Generated */ } /* Generated */ firstEMAIdx = VALUE_HANDLE_GET(thirdEMABegIdx) + VALUE_HANDLE_GET(secondEMABegIdx); /* Generated */ secondEMAIdx = VALUE_HANDLE_GET(thirdEMABegIdx); /* Generated */ VALUE_HANDLE_DEREF(outBegIdx) = firstEMAIdx + VALUE_HANDLE_GET(firstEMABegIdx); /* Generated */ outIdx = 0; /* Generated */ while( outIdx < VALUE_HANDLE_GET(thirdEMANbElement) ) /* Generated */ { /* Generated */ outReal[outIdx] += (3.0*firstEMA[firstEMAIdx++]) - (3.0*secondEMA[secondEMAIdx++]); /* Generated */ outIdx++; /* Generated */ } /* Generated */ ARRAY_FREE( firstEMA ); /* Generated */ ARRAY_FREE( secondEMA ); /* Generated */ VALUE_HANDLE_DEREF(outNbElement) = outIdx; /* Generated */ return NAMESPACE(TA_RetCode)TA_SUCCESS; /* Generated */ }
static int pc_workers_cnt = 0; /* number of workers threads */ static pcr_req_id pcw_id; /* counter for generating unique request IDs */ /* pluto crypto operations */ static const char *const pluto_cryptoop_strings[] = { "build KE and nonce", /* calculate g^i and generate a nonce */ "build nonce", /* generate a nonce */ "compute dh+iv (V1 Phase 1)", /* calculate (g^x)(g^y) and skeyids for Phase 1 DH + prf */ "compute dh (V1 Phase 2 PFS)", /* calculate (g^x)(g^y) for Phase 2 PFS */ "compute dh (V2)", /* perform IKEv2 PARENT SA calculation, create SKEYSEED */ }; static enum_names pluto_cryptoop_names = { pcr_build_ke_and_nonce, pcr_compute_dh_v2, ARRAY_REF(pluto_cryptoop_strings), NULL, /* prefix */ NULL }; /* initializers for pluto_crypto_request continuations */ static void pcr_init(struct pluto_crypto_req *r, enum pluto_crypto_requests pcr_type, enum crypto_importance pcr_pcim) { messup(r); r->pcr_len = sizeof(struct pluto_crypto_req); r->pcr_type = pcr_type; r->pcr_pcim = pcr_pcim; }
/* Generated */ TA_RetCode TA_S_STOCH( int startIdx, /* Generated */ int endIdx, /* Generated */ const float inHigh[], /* Generated */ const float inLow[], /* Generated */ const float inClose[], /* Generated */ int optInFastK_Period, /* From 1 to 100000 */ /* Generated */ int optInSlowK_Period, /* From 1 to 100000 */ /* Generated */ TA_MAType optInSlowK_MAType, /* Generated */ int optInSlowD_Period, /* From 1 to 100000 */ /* Generated */ TA_MAType optInSlowD_MAType, /* Generated */ int *outBegIdx, /* Generated */ int *outNbElement, /* Generated */ double outSlowK[], /* Generated */ double outSlowD[] ) /* Generated */ #endif /* Generated */ { /* Generated */ TA_RetCode retCode; /* Generated */ double lowest, highest, tmp, diff; /* Generated */ ARRAY_REF( tempBuffer ); /* Generated */ int outIdx, lowestIdx, highestIdx; /* Generated */ int lookbackTotal, lookbackK, lookbackKSlow, lookbackDSlow; /* Generated */ int trailingIdx, today, i; /* Generated */ #if !defined( _MANAGED ) && !defined(USE_SINGLE_PRECISION_INPUT) &&!defined(_JAVA) /* Generated */ int bufferIsAllocated; /* Generated */ #endif /* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK /* Generated */ if( startIdx < 0 ) /* Generated */ return NAMESPACE(TA_RetCode)TA_OUT_OF_RANGE_START_INDEX; /* Generated */ if( (endIdx < 0) || (endIdx < startIdx)) /* Generated */ return NAMESPACE(TA_RetCode)TA_OUT_OF_RANGE_END_INDEX; /* Generated */ #if !defined(_MANAGED) && !defined(_JAVA) /* Generated */ if(!inHigh||!inLow||!inClose) /* Generated */ return NAMESPACE(TA_RetCode)TA_BAD_PARAM; /* Generated */ #endif /* Generated */ if( (int)optInFastK_Period == TA_INTEGER_DEFAULT ) /* Generated */ optInFastK_Period = 5; /* Generated */ else if( ((int)optInFastK_Period < 1) || ((int)optInFastK_Period > 100000) ) /* Generated */ return NAMESPACE(TA_RetCode)TA_BAD_PARAM; /* Generated */ if( (int)optInSlowK_Period == TA_INTEGER_DEFAULT ) /* Generated */ optInSlowK_Period = 3; /* Generated */ else if( ((int)optInSlowK_Period < 1) || ((int)optInSlowK_Period > 100000) ) /* Generated */ return NAMESPACE(TA_RetCode)TA_BAD_PARAM; /* Generated */ #if !defined(_MANAGED) && !defined(_JAVA) /* Generated */ if( (int)optInSlowK_MAType == TA_INTEGER_DEFAULT ) /* Generated */ optInSlowK_MAType = 0; /* Generated */ else if( ((int)optInSlowK_MAType < 0) || ((int)optInSlowK_MAType > 8) ) /* Generated */ return NAMESPACE(TA_RetCode)TA_BAD_PARAM; /* Generated */ #endif /* Generated */ if( (int)optInSlowD_Period == TA_INTEGER_DEFAULT ) /* Generated */ optInSlowD_Period = 3; /* Generated */ else if( ((int)optInSlowD_Period < 1) || ((int)optInSlowD_Period > 100000) ) /* Generated */ return NAMESPACE(TA_RetCode)TA_BAD_PARAM; /* Generated */ #if !defined(_MANAGED) && !defined(_JAVA) /* Generated */ if( (int)optInSlowD_MAType == TA_INTEGER_DEFAULT ) /* Generated */ optInSlowD_MAType = 0; /* Generated */ else if( ((int)optInSlowD_MAType < 0) || ((int)optInSlowD_MAType > 8) ) /* Generated */ return NAMESPACE(TA_RetCode)TA_BAD_PARAM; /* Generated */ #endif /* Generated */ #if !defined(_MANAGED) && !defined(_JAVA) /* Generated */ if( !outSlowK ) /* Generated */ return NAMESPACE(TA_RetCode)TA_BAD_PARAM; /* Generated */ if( !outSlowD ) /* Generated */ return NAMESPACE(TA_RetCode)TA_BAD_PARAM; /* Generated */ #endif /* Generated */ #endif /* Generated */ lookbackK = optInFastK_Period-1; /* Generated */ lookbackKSlow = LOOKBACK_CALL(MA)( optInSlowK_Period, optInSlowK_MAType ); /* Generated */ lookbackDSlow = LOOKBACK_CALL(MA)( optInSlowD_Period, optInSlowD_MAType ); /* Generated */ lookbackTotal = lookbackK + lookbackDSlow + lookbackKSlow; /* Generated */ if( startIdx < lookbackTotal ) /* Generated */ startIdx = lookbackTotal; /* Generated */ if( startIdx > endIdx ) /* Generated */ { /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outNbElement); /* Generated */ return NAMESPACE(TA_RetCode)TA_SUCCESS; /* Generated */ } /* Generated */ outIdx = 0; /* Generated */ trailingIdx = startIdx-lookbackTotal; /* Generated */ today = trailingIdx+lookbackK; /* Generated */ lowestIdx = highestIdx = -1; /* Generated */ diff = highest = lowest = 0.0; /* Generated */ #if !defined( _MANAGED ) && !defined(USE_SINGLE_PRECISION_INPUT) && !defined( _JAVA ) /* Generated */ bufferIsAllocated = 0; /* Generated */ #endif /* Generated */ #if defined(USE_SINGLE_PRECISION_INPUT) /* Generated */ ARRAY_ALLOC( tempBuffer, endIdx-today+1 ); /* Generated */ #else /* Generated */ if( (outSlowK == inHigh) || /* Generated */ (outSlowK == inLow) || /* Generated */ (outSlowK == inClose) ) /* Generated */ { /* Generated */ tempBuffer = outSlowK; /* Generated */ } /* Generated */ else if( (outSlowD == inHigh) || /* Generated */ (outSlowD == inLow) || /* Generated */ (outSlowD == inClose) ) /* Generated */ { /* Generated */ tempBuffer = outSlowD; /* Generated */ } /* Generated */ else /* Generated */ { /* Generated */ #if !defined( _MANAGED ) && !defined(_JAVA) /* Generated */ bufferIsAllocated = 1; /* Generated */ #endif /* Generated */ ARRAY_ALLOC( tempBuffer, endIdx-today+1 ); /* Generated */ } /* Generated */ #endif /* Generated */ while( today <= endIdx ) /* Generated */ { /* Generated */ tmp = inLow[today]; /* Generated */ if( lowestIdx < trailingIdx ) /* Generated */ { /* Generated */ lowestIdx = trailingIdx; /* Generated */ lowest = inLow[lowestIdx]; /* Generated */ i = lowestIdx; /* Generated */ while( ++i<=today ) /* Generated */ { /* Generated */ tmp = inLow[i]; /* Generated */ if( tmp < lowest ) /* Generated */ { /* Generated */ lowestIdx = i; /* Generated */ lowest = tmp; /* Generated */ } /* Generated */ } /* Generated */ diff = (highest - lowest)/100.0; /* Generated */ } /* Generated */ else if( tmp <= lowest ) /* Generated */ { /* Generated */ lowestIdx = today; /* Generated */ lowest = tmp; /* Generated */ diff = (highest - lowest)/100.0; /* Generated */ } /* Generated */ tmp = inHigh[today]; /* Generated */ if( highestIdx < trailingIdx ) /* Generated */ { /* Generated */ highestIdx = trailingIdx; /* Generated */ highest = inHigh[highestIdx]; /* Generated */ i = highestIdx; /* Generated */ while( ++i<=today ) /* Generated */ { /* Generated */ tmp = inHigh[i]; /* Generated */ if( tmp > highest ) /* Generated */ { /* Generated */ highestIdx = i; /* Generated */ highest = tmp; /* Generated */ } /* Generated */ } /* Generated */ diff = (highest - lowest)/100.0; /* Generated */ } /* Generated */ else if( tmp >= highest ) /* Generated */ { /* Generated */ highestIdx = today; /* Generated */ highest = tmp; /* Generated */ diff = (highest - lowest)/100.0; /* Generated */ } /* Generated */ if( diff != 0.0 ) /* Generated */ tempBuffer[outIdx++] = (inClose[today]-lowest)/diff; /* Generated */ else /* Generated */ tempBuffer[outIdx++] = 0.0; /* Generated */ trailingIdx++; /* Generated */ today++; /* Generated */ } /* Generated */ retCode = FUNCTION_CALL_DOUBLE(MA)( 0, outIdx-1, /* Generated */ tempBuffer, optInSlowK_Period, /* Generated */ optInSlowK_MAType, /* Generated */ outBegIdx, outNbElement, tempBuffer ); /* Generated */ if( (retCode != NAMESPACE(TA_RetCode)TA_SUCCESS ) || ((int)VALUE_HANDLE_DEREF(outNbElement) == 0) ) /* Generated */ { /* Generated */ #if defined(USE_SINGLE_PRECISION_INPUT) /* Generated */ ARRAY_FREE( tempBuffer ); /* Generated */ #else /* Generated */ ARRAY_FREE_COND( bufferIsAllocated, tempBuffer ); /* Generated */ #endif /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outNbElement); /* Generated */ return retCode; /* Generated */ } /* Generated */ retCode = FUNCTION_CALL_DOUBLE(MA)( 0, (int)VALUE_HANDLE_DEREF(outNbElement)-1, /* Generated */ tempBuffer, optInSlowD_Period, /* Generated */ optInSlowD_MAType, /* Generated */ outBegIdx, outNbElement, outSlowD ); /* Generated */ ARRAY_MEMMOVE( outSlowK, 0, tempBuffer,lookbackDSlow,(int)VALUE_HANDLE_DEREF(outNbElement)); /* Generated */ #if defined(USE_SINGLE_PRECISION_INPUT) /* Generated */ ARRAY_FREE( tempBuffer ); /* Generated */ #else /* Generated */ ARRAY_FREE_COND( bufferIsAllocated, tempBuffer ); /* Generated */ #endif /* Generated */ if( retCode != NAMESPACE(TA_RetCode)TA_SUCCESS ) /* Generated */ { /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outNbElement); /* Generated */ return retCode; /* Generated */ } /* Generated */ VALUE_HANDLE_DEREF(outBegIdx) = startIdx; /* Generated */ return NAMESPACE(TA_RetCode)TA_SUCCESS; /* Generated */ }