From f82d5a78ace6f93ea260ef5c72c5ae63c9ed44ef Mon Sep 17 00:00:00 2001 From: mario4tier Date: Thu, 7 Nov 2024 21:53:01 -0500 Subject: [PATCH] Update License date range --- include/ta_abstract.h | 2 +- include/ta_common.h | 2 +- include/ta_defs.h | 2 +- include/ta_func.h | 2 +- include/ta_libc.h | 2 +- java/src/com/tictactec/ta/lib/Core.java | 2 +- .../com/tictactec/ta/lib/CoreAnnotated.java | 4 +- src/ta_abstract/excel_glue.c | 4 +- src/ta_abstract/frames/ta_frame.c | 2 +- src/ta_abstract/ta_abstract.c | 78 +- src/ta_abstract/ta_def_ui.c | 6 +- src/ta_abstract/ta_def_ui.h | 2 +- src/ta_abstract/ta_frame_priv.h | 2 +- src/ta_abstract/ta_func_api.c | 2 +- src/ta_abstract/ta_java_defs.h | 4 +- src/ta_abstract/tables/table_a.c | 18 +- src/ta_abstract/tables/table_b.c | 2 +- src/ta_abstract/tables/table_c.c | 140 +-- src/ta_abstract/tables/table_d.c | 2 +- src/ta_abstract/tables/table_e.c | 2 +- src/ta_abstract/tables/table_f.c | 2 +- src/ta_abstract/tables/table_g.c | 2 +- src/ta_abstract/tables/table_h.c | 14 +- src/ta_abstract/tables/table_i.c | 2 +- src/ta_abstract/tables/table_j.c | 2 +- src/ta_abstract/tables/table_k.c | 2 +- src/ta_abstract/tables/table_l.c | 2 +- src/ta_abstract/tables/table_m.c | 10 +- src/ta_abstract/tables/table_n.c | 2 +- src/ta_abstract/tables/table_o.c | 2 +- src/ta_abstract/tables/table_p.c | 2 +- src/ta_abstract/tables/table_q.c | 2 +- src/ta_abstract/tables/table_r.c | 2 +- src/ta_abstract/tables/table_s.c | 2 +- src/ta_abstract/tables/table_t.c | 2 +- src/ta_abstract/tables/table_u.c | 2 +- src/ta_abstract/tables/table_v.c | 2 +- src/ta_abstract/tables/table_w.c | 6 +- src/ta_abstract/tables/table_x.c | 2 +- src/ta_abstract/tables/table_y.c | 2 +- src/ta_abstract/tables/table_z.c | 2 +- .../templates/CoreAnnotated.java.template | 4 +- .../templates/excel_glue.c.template | 4 +- src/ta_abstract/templates/ta_frame.c.template | 2 +- src/ta_abstract/templates/ta_func.h.template | 2 +- .../templates/ta_func.swg.template | 4 +- .../templates/ta_func_api.c.template | 2 +- .../templates/ta_java_defs.h.template | 4 +- .../templates/ta_retcode.c.template | 8 +- src/ta_abstract/templates/ta_x.c.template | 2 +- src/ta_common/ta_global.c | 2 +- src/ta_common/ta_pragma.h | 16 +- src/ta_common/ta_retcode.c | 8 +- src/ta_common/ta_version.c | 2 +- src/ta_func/ta_ACCBANDS.c | 46 +- src/ta_func/ta_ACOS.c | 2 +- src/ta_func/ta_AD.c | 8 +- src/ta_func/ta_ADD.c | 2 +- src/ta_func/ta_ADOSC.c | 14 +- src/ta_func/ta_ADX.c | 30 +- src/ta_func/ta_ADXR.c | 8 +- src/ta_func/ta_APO.c | 66 +- src/ta_func/ta_AROON.c | 8 +- src/ta_func/ta_AROONOSC.c | 8 +- src/ta_func/ta_ASIN.c | 2 +- src/ta_func/ta_ATAN.c | 6 +- src/ta_func/ta_ATR.c | 20 +- src/ta_func/ta_AVGDEV.c | 292 ++--- src/ta_func/ta_AVGPRICE.c | 2 +- src/ta_func/ta_BBANDS.c | 14 +- src/ta_func/ta_BETA.c | 16 +- src/ta_func/ta_BOP.c | 2 +- src/ta_func/ta_CCI.c | 10 +- src/ta_func/ta_CDL2CROWS.c | 2 +- src/ta_func/ta_CDL3BLACKCROWS.c | 2 +- src/ta_func/ta_CDL3INSIDE.c | 2 +- src/ta_func/ta_CDL3LINESTRIKE.c | 2 +- src/ta_func/ta_CDL3OUTSIDE.c | 2 +- src/ta_func/ta_CDL3STARSINSOUTH.c | 2 +- src/ta_func/ta_CDL3WHITESOLDIERS.c | 2 +- src/ta_func/ta_CDLABANDONEDBABY.c | 2 +- src/ta_func/ta_CDLADVANCEBLOCK.c | 2 +- src/ta_func/ta_CDLBELTHOLD.c | 36 +- src/ta_func/ta_CDLBREAKAWAY.c | 2 +- src/ta_func/ta_CDLCLOSINGMARUBOZU.c | 2 +- src/ta_func/ta_CDLCONCEALBABYSWALL.c | 2 +- src/ta_func/ta_CDLCOUNTERATTACK.c | 2 +- src/ta_func/ta_CDLDARKCLOUDCOVER.c | 2 +- src/ta_func/ta_CDLDOJI.c | 2 +- src/ta_func/ta_CDLDOJISTAR.c | 2 +- src/ta_func/ta_CDLDRAGONFLYDOJI.c | 2 +- src/ta_func/ta_CDLENGULFING.c | 2 +- src/ta_func/ta_CDLEVENINGDOJISTAR.c | 2 +- src/ta_func/ta_CDLEVENINGSTAR.c | 2 +- src/ta_func/ta_CDLGAPSIDESIDEWHITE.c | 22 +- src/ta_func/ta_CDLGRAVESTONEDOJI.c | 16 +- src/ta_func/ta_CDLHAMMER.c | 30 +- src/ta_func/ta_CDLHANGINGMAN.c | 28 +- src/ta_func/ta_CDLHARAMI.c | 2 +- src/ta_func/ta_CDLHARAMICROSS.c | 2 +- src/ta_func/ta_CDLHIGHWAVE.c | 16 +- src/ta_func/ta_CDLHIKKAKE.c | 14 +- src/ta_func/ta_CDLHIKKAKEMOD.c | 30 +- src/ta_func/ta_CDLHOMINGPIGEON.c | 2 +- src/ta_func/ta_CDLIDENTICAL3CROWS.c | 2 +- src/ta_func/ta_CDLINNECK.c | 2 +- src/ta_func/ta_CDLINVERTEDHAMMER.c | 2 +- src/ta_func/ta_CDLKICKING.c | 2 +- src/ta_func/ta_CDLKICKINGBYLENGTH.c | 2 +- src/ta_func/ta_CDLLADDERBOTTOM.c | 2 +- src/ta_func/ta_CDLLONGLEGGEDDOJI.c | 16 +- src/ta_func/ta_CDLLONGLINE.c | 2 +- src/ta_func/ta_CDLMARUBOZU.c | 16 +- src/ta_func/ta_CDLMATCHINGLOW.c | 2 +- src/ta_func/ta_CDLMATHOLD.c | 2 +- src/ta_func/ta_CDLMORNINGDOJISTAR.c | 2 +- src/ta_func/ta_CDLMORNINGSTAR.c | 16 +- src/ta_func/ta_CDLONNECK.c | 12 +- src/ta_func/ta_CDLPIERCING.c | 2 +- src/ta_func/ta_CDLRICKSHAWMAN.c | 2 +- src/ta_func/ta_CDLRISEFALL3METHODS.c | 2 +- src/ta_func/ta_CDLSEPARATINGLINES.c | 18 +- src/ta_func/ta_CDLSHOOTINGSTAR.c | 2 +- src/ta_func/ta_CDLSHORTLINE.c | 8 +- src/ta_func/ta_CDLSPINNINGTOP.c | 16 +- src/ta_func/ta_CDLSTALLEDPATTERN.c | 2 +- src/ta_func/ta_CDLSTICKSANDWICH.c | 8 +- src/ta_func/ta_CDLTAKURI.c | 2 +- src/ta_func/ta_CDLTASUKIGAP.c | 20 +- src/ta_func/ta_CDLTHRUSTING.c | 2 +- src/ta_func/ta_CDLTRISTAR.c | 2 +- src/ta_func/ta_CDLUNIQUE3RIVER.c | 2 +- src/ta_func/ta_CDLUPSIDEGAP2CROWS.c | 2 +- src/ta_func/ta_CDLXSIDEGAP3METHODS.c | 16 +- src/ta_func/ta_CEIL.c | 2 +- src/ta_func/ta_CMO.c | 34 +- src/ta_func/ta_CORREL.c | 12 +- src/ta_func/ta_COS.c | 2 +- src/ta_func/ta_COSH.c | 2 +- src/ta_func/ta_DEMA.c | 26 +- src/ta_func/ta_DIV.c | 2 +- src/ta_func/ta_DX.c | 32 +- src/ta_func/ta_EMA.c | 16 +- src/ta_func/ta_EXP.c | 2 +- src/ta_func/ta_FLOOR.c | 2 +- src/ta_func/ta_HT_DCPERIOD.c | 18 +- src/ta_func/ta_HT_DCPHASE.c | 20 +- src/ta_func/ta_HT_PHASOR.c | 14 +- src/ta_func/ta_HT_SINE.c | 20 +- src/ta_func/ta_HT_TRENDLINE.c | 22 +- src/ta_func/ta_HT_TRENDMODE.c | 28 +- src/ta_func/ta_IMI.c | 286 ++--- src/ta_func/ta_KAMA.c | 28 +- src/ta_func/ta_LINEARREG.c | 2 +- src/ta_func/ta_LINEARREG_ANGLE.c | 2 +- src/ta_func/ta_LINEARREG_INTERCEPT.c | 6 +- src/ta_func/ta_LINEARREG_SLOPE.c | 2 +- src/ta_func/ta_LN.c | 2 +- src/ta_func/ta_LOG10.c | 2 +- src/ta_func/ta_MA.c | 22 +- src/ta_func/ta_MACD.c | 28 +- src/ta_func/ta_MACDEXT.c | 24 +- src/ta_func/ta_MACDFIX.c | 4 +- src/ta_func/ta_MAMA.c | 20 +- src/ta_func/ta_MAVP.c | 32 +- src/ta_func/ta_MAX.c | 8 +- src/ta_func/ta_MAXINDEX.c | 8 +- src/ta_func/ta_MEDPRICE.c | 4 +- src/ta_func/ta_MFI.c | 14 +- src/ta_func/ta_MIDPOINT.c | 4 +- src/ta_func/ta_MIDPRICE.c | 4 +- src/ta_func/ta_MIN.c | 8 +- src/ta_func/ta_MININDEX.c | 8 +- src/ta_func/ta_MINMAX.c | 8 +- src/ta_func/ta_MINMAXINDEX.c | 8 +- src/ta_func/ta_MINUS_DI.c | 32 +- src/ta_func/ta_MINUS_DM.c | 26 +- src/ta_func/ta_MOM.c | 10 +- src/ta_func/ta_MULT.c | 2 +- src/ta_func/ta_NATR.c | 28 +- src/ta_func/ta_NVI.c | 40 +- src/ta_func/ta_OBV.c | 2 +- src/ta_func/ta_PLUS_DI.c | 32 +- src/ta_func/ta_PLUS_DM.c | 26 +- src/ta_func/ta_PPO.c | 4 +- src/ta_func/ta_PVI.c | 40 +- src/ta_func/ta_ROC.c | 10 +- src/ta_func/ta_ROCP.c | 16 +- src/ta_func/ta_ROCR.c | 16 +- src/ta_func/ta_ROCR100.c | 16 +- src/ta_func/ta_RSI.c | 26 +- src/ta_func/ta_SAR.c | 44 +- src/ta_func/ta_SAREXT.c | 60 +- src/ta_func/ta_SIN.c | 2 +- src/ta_func/ta_SINH.c | 2 +- src/ta_func/ta_SMA.c | 4 +- src/ta_func/ta_SQRT.c | 2 +- src/ta_func/ta_STDDEV.c | 24 +- src/ta_func/ta_STOCH.c | 56 +- src/ta_func/ta_STOCHF.c | 52 +- src/ta_func/ta_STOCHRSI.c | 34 +- src/ta_func/ta_SUB.c | 2 +- src/ta_func/ta_SUM.c | 2 +- src/ta_func/ta_T3.c | 34 +- src/ta_func/ta_TAN.c | 2 +- src/ta_func/ta_TANH.c | 2 +- src/ta_func/ta_TEMA.c | 32 +- src/ta_func/ta_TRANGE.c | 14 +- src/ta_func/ta_TRIMA.c | 38 +- src/ta_func/ta_TRIX.c | 26 +- src/ta_func/ta_TSF.c | 2 +- src/ta_func/ta_TYPPRICE.c | 2 +- src/ta_func/ta_ULTOSC.c | 58 +- src/ta_func/ta_VAR.c | 26 +- src/ta_func/ta_WCLPRICE.c | 2 +- src/ta_func/ta_WILLR.c | 10 +- src/ta_func/ta_WMA.c | 28 +- src/ta_func/ta_utility.c | 10 +- src/tools/gen_code/gen_code.c | 2 +- src/tools/ta_regtest/ta_regtest.c | 14 +- .../ta_regtest/ta_test_func/test_1in_1out.c | 28 +- .../ta_regtest/ta_test_func/test_1in_2out.c | 42 +- src/tools/ta_regtest/ta_test_func/test_adx.c | 34 +- .../ta_regtest/ta_test_func/test_avgdev.c | 22 +- .../ta_regtest/ta_test_func/test_bbands.c | 28 +- .../ta_test_func/test_candlestick.c | 70 +- src/tools/ta_regtest/ta_test_func/test_imi.c | 20 +- src/tools/ta_regtest/ta_test_func/test_ma.c | 66 +- src/tools/ta_regtest/ta_test_func/test_macd.c | 48 +- .../ta_regtest/ta_test_func/test_minmax.c | 68 +- src/tools/ta_regtest/ta_test_func/test_mom.c | 50 +- .../ta_regtest/ta_test_func/test_per_ema.c | 24 +- .../ta_regtest/ta_test_func/test_per_hl.c | 32 +- .../ta_regtest/ta_test_func/test_per_hlc.c | 40 +- .../ta_regtest/ta_test_func/test_per_hlcv.c | 28 +- .../ta_regtest/ta_test_func/test_per_ohlc.c | 28 +- src/tools/ta_regtest/ta_test_func/test_po.c | 26 +- src/tools/ta_regtest/ta_test_func/test_rsi.c | 20 +- src/tools/ta_regtest/ta_test_func/test_sar.c | 8 +- .../ta_regtest/ta_test_func/test_stddev.c | 22 +- .../ta_regtest/ta_test_func/test_stoch.c | 84 +- .../ta_regtest/ta_test_func/test_trange.c | 32 +- src/tools/ta_regtest/test_abstract.c | 68 +- src/tools/ta_regtest/test_internals.c | 6 +- src/tools/ta_regtest/test_util.c | 70 +- swig/src/interface/ta_func.swg | 1064 ++++++++--------- 246 files changed, 2557 insertions(+), 2557 deletions(-) diff --git a/include/ta_abstract.h b/include/ta_abstract.h index a1f4888dd..67b6e55ad 100644 --- a/include/ta_abstract.h +++ b/include/ta_abstract.h @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/include/ta_common.h b/include/ta_common.h index 0b948784b..49a5d7976 100644 --- a/include/ta_common.h +++ b/include/ta_common.h @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/include/ta_defs.h b/include/ta_defs.h index 536d881c3..11c56f574 100644 --- a/include/ta_defs.h +++ b/include/ta_defs.h @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/include/ta_func.h b/include/ta_func.h index 71c44a301..0246b6868 100644 --- a/include/ta_func.h +++ b/include/ta_func.h @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/include/ta_libc.h b/include/ta_libc.h index db98c584b..6c1c0bef2 100644 --- a/include/ta_libc.h +++ b/include/ta_libc.h @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/java/src/com/tictactec/ta/lib/Core.java b/java/src/com/tictactec/ta/lib/Core.java index d7562cc17..d8b8d0e93 100644 --- a/java/src/com/tictactec/ta/lib/Core.java +++ b/java/src/com/tictactec/ta/lib/Core.java @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/java/src/com/tictactec/ta/lib/CoreAnnotated.java b/java/src/com/tictactec/ta/lib/CoreAnnotated.java index e1859af57..0001e5922 100644 --- a/java/src/com/tictactec/ta/lib/CoreAnnotated.java +++ b/java/src/com/tictactec/ta/lib/CoreAnnotated.java @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -39,7 +39,7 @@ */ package com.tictactec.ta.lib; - + import com.tictactec.ta.lib.MAType; import com.tictactec.ta.lib.MInteger; import com.tictactec.ta.lib.RetCode; diff --git a/src/ta_abstract/excel_glue.c b/src/ta_abstract/excel_glue.c index 5afb5bde9..2c13d640d 100644 --- a/src/ta_abstract/excel_glue.c +++ b/src/ta_abstract/excel_glue.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -37,7 +37,7 @@ * If you are not re-building the excel library (which is most * likely the case), just ignore this file. */ - + EXCEL_GLUE_CODE_WITH_4_PARAM(ACCBANDS) EXCEL_GLUE_CODE_WITH_1_PARAM(ACOS) EXCEL_GLUE_CODE_WITH_4_PARAM(AD) diff --git a/src/ta_abstract/frames/ta_frame.c b/src/ta_abstract/frames/ta_frame.c index 3e032fd78..9b38b5382 100644 --- a/src/ta_abstract/frames/ta_frame.c +++ b/src/ta_abstract/frames/ta_frame.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_abstract/ta_abstract.c b/src/ta_abstract/ta_abstract.c index f89682f00..100b18ae7 100644 --- a/src/ta_abstract/ta_abstract.c +++ b/src/ta_abstract/ta_abstract.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -119,7 +119,7 @@ extern const unsigned int TA_DEF_TableASize, TA_DEF_TableBSize, #define min(a, b) (((a) < (b)) ? (a) : (b)) #endif -typedef struct +typedef struct { unsigned int magicNumber; } TA_StringTablePriv; @@ -212,7 +212,7 @@ TA_RetCode TA_GroupTableFree( TA_StringTable *table ) { return TA_INTERNAL_ERROR(1); } - + if( stringTablePriv->magicNumber != TA_STRING_TABLE_GROUP_MAGIC_NB ) { return TA_BAD_OBJECT; @@ -236,10 +236,10 @@ TA_RetCode TA_ForEachFunc( TA_CallForEachFunc functionToCall, void *opaqueData ) { return TA_BAD_PARAM; } - + /* Iterate the tables (each table is for one letter) */ for( i=0; i < 26; i++ ) - { + { funcDefTable = TA_DEF_Tables[i]; /* Identify the table size. */ @@ -250,9 +250,9 @@ TA_RetCode TA_ForEachFunc( TA_CallForEachFunc functionToCall, void *opaqueData ) if( !funcDef || !funcDef->funcInfo ) return TA_INTERNAL_ERROR(3); - funcInfo = funcDef->funcInfo; + funcInfo = funcDef->funcInfo; if( !funcInfo ) - return TA_INTERNAL_ERROR(4); + return TA_INTERNAL_ERROR(4); (*functionToCall)( funcInfo, opaqueData ); } } @@ -354,7 +354,7 @@ TA_RetCode TA_FuncTableFree( TA_StringTable *table ) { return TA_INTERNAL_ERROR(3); } - + if( stringTablePriv->magicNumber != TA_STRING_TABLE_FUNC_MAGIC_NB ) { return TA_BAD_OBJECT; @@ -419,10 +419,10 @@ TA_RetCode TA_GetFuncHandle( const char *name, const TA_FuncHandle **handle ) if( !funcDef || !funcDef->funcInfo ) return TA_INTERNAL_ERROR(3); - funcInfo = funcDef->funcInfo; + funcInfo = funcDef->funcInfo; if( !funcInfo ) return TA_INTERNAL_ERROR(4); - + if( strcmp( funcInfo->name, name ) == 0 ) { *handle = (TA_FuncHandle *)funcDef; @@ -450,7 +450,7 @@ TA_RetCode TA_GetFuncInfo( const TA_FuncHandle *handle, return TA_INVALID_HANDLE; } - *funcInfo = funcDef->funcInfo; + *funcInfo = funcDef->funcInfo; if( !funcDef->funcInfo ) return TA_INVALID_HANDLE; @@ -549,7 +549,7 @@ TA_RetCode TA_GetOutputParameterInfo( const TA_FuncHandle *handle, unsigned int paramIndex, const TA_OutputParameterInfo **info ) { - + const TA_FuncDef *funcDef; const TA_FuncInfo *funcInfo; const TA_OutputParameterInfo **outputTable; @@ -600,7 +600,7 @@ TA_RetCode TA_GetOutputParameterInfo( const TA_FuncHandle *handle, TA_RetCode TA_ParamHolderAlloc( const TA_FuncHandle *handle, TA_ParamHolder **allocatedParams ) { - + TA_FuncDef *funcDef; unsigned int allocSize, i; TA_ParamHolderInput *input; @@ -771,11 +771,11 @@ TA_RetCode TA_ParamHolderFree( TA_ParamHolder *paramsToFree ) } -TA_RetCode TA_SetInputParamIntegerPtr( TA_ParamHolder *param, +TA_RetCode TA_SetInputParamIntegerPtr( TA_ParamHolder *param, unsigned int paramIndex, const TA_Integer *value ) { - + TA_ParamHolderPriv *paramHolderPriv; const TA_InputParameterInfo *paramInfo; const TA_FuncInfo *funcInfo; @@ -798,7 +798,7 @@ TA_RetCode TA_SetInputParamIntegerPtr( TA_ParamHolder *param, if( paramIndex >= funcInfo->nbInput ) { return TA_BAD_PARAM; - } + } /* Verify the type of the parameter. */ paramInfo = paramHolderPriv->in[paramIndex].inputInfo; @@ -809,7 +809,7 @@ TA_RetCode TA_SetInputParamIntegerPtr( TA_ParamHolder *param, } /* keep a copy of the provided parameter. */ - paramHolderPriv->in[paramIndex].data.inInteger = value; + paramHolderPriv->in[paramIndex].data.inInteger = value; /* This parameter is now initialized, clear the corresponding bit. */ paramHolderPriv->inBitmap &= ~(1<= funcInfo->nbInput ) { return TA_BAD_PARAM; - } + } /* Verify the type of the parameter. */ paramInfo = paramHolderPriv->in[paramIndex].inputInfo; @@ -854,7 +854,7 @@ TA_RetCode TA_SetInputParamRealPtr( TA_ParamHolder *param, } /* keep a copy of the provided parameter. */ - paramHolderPriv->in[paramIndex].data.inReal = value; + paramHolderPriv->in[paramIndex].data.inReal = value; /* This parameter is now initialized, clear the corresponding bit. */ paramHolderPriv->inBitmap &= ~(1<= funcInfo->nbInput ) { return TA_BAD_PARAM; - } + } /* Verify the type of the parameter. */ paramInfo = paramHolderPriv->in[paramIndex].inputInfo; @@ -935,7 +935,7 @@ TA_RetCode TA_SetOptInputParamInteger( TA_ParamHolder *param, unsigned int paramIndex, TA_Integer value ) { - + TA_ParamHolderPriv *paramHolderPriv; const TA_OptInputParameterInfo *paramInfo; const TA_FuncInfo *funcInfo; @@ -957,7 +957,7 @@ TA_RetCode TA_SetOptInputParamInteger( TA_ParamHolder *param, if( paramIndex >= funcInfo->nbOptInput ) { return TA_BAD_PARAM; - } + } /* Verify the type of the parameter. */ paramInfo = paramHolderPriv->optIn[paramIndex].optInputInfo; @@ -969,7 +969,7 @@ TA_RetCode TA_SetOptInputParamInteger( TA_ParamHolder *param, } /* keep a copy of the provided parameter. */ - paramHolderPriv->optIn[paramIndex].data.optInInteger = value; + paramHolderPriv->optIn[paramIndex].data.optInInteger = value; return TA_SUCCESS; } @@ -977,7 +977,7 @@ TA_RetCode TA_SetOptInputParamInteger( TA_ParamHolder *param, TA_RetCode TA_SetOptInputParamReal( TA_ParamHolder *param, unsigned int paramIndex, TA_Real value ) -{ +{ TA_ParamHolderPriv *paramHolderPriv; const TA_OptInputParameterInfo *paramInfo; const TA_FuncInfo *funcInfo; @@ -1000,7 +1000,7 @@ TA_RetCode TA_SetOptInputParamReal( TA_ParamHolder *param, if( paramIndex >= funcInfo->nbOptInput ) { return TA_BAD_PARAM; - } + } /* Verify the type of the parameter. */ paramInfo = paramHolderPriv->optIn[paramIndex].optInputInfo; @@ -1012,7 +1012,7 @@ TA_RetCode TA_SetOptInputParamReal( TA_ParamHolder *param, } /* keep a copy of the provided parameter. */ - paramHolderPriv->optIn[paramIndex].data.optInReal = value; + paramHolderPriv->optIn[paramIndex].data.optInReal = value; return TA_SUCCESS; } @@ -1022,7 +1022,7 @@ TA_RetCode TA_SetOptInputParamReal( TA_ParamHolder *param, TA_RetCode TA_SetOutputParamIntegerPtr( TA_ParamHolder *param, unsigned int paramIndex, TA_Integer *out ) -{ +{ TA_ParamHolderPriv *paramHolderPriv; const TA_OutputParameterInfo *paramInfo; const TA_FuncInfo *funcInfo; @@ -1045,7 +1045,7 @@ TA_RetCode TA_SetOutputParamIntegerPtr( TA_ParamHolder *param, if( paramIndex >= funcInfo->nbOutput ) { return TA_BAD_PARAM; - } + } /* Verify the type of the parameter. */ paramInfo = paramHolderPriv->out[paramIndex].outputInfo; @@ -1056,7 +1056,7 @@ TA_RetCode TA_SetOutputParamIntegerPtr( TA_ParamHolder *param, } /* keep a copy of the provided parameter. */ - paramHolderPriv->out[paramIndex].data.outInteger = out; + paramHolderPriv->out[paramIndex].data.outInteger = out; /* This parameter is now initialized, clear the corresponding bit. */ paramHolderPriv->outBitmap &= ~(1<= funcInfo->nbOutput ) { return TA_BAD_PARAM; - } + } /* Verify the type of the parameter. */ paramInfo = paramHolderPriv->out[paramIndex].outputInfo; @@ -1101,7 +1101,7 @@ TA_RetCode TA_SetOutputParamRealPtr( TA_ParamHolder *param, } /* keep a copy of the provided parameter. */ - paramHolderPriv->out[paramIndex].data.outReal = out; + paramHolderPriv->out[paramIndex].data.outReal = out; /* This parameter is now initialized, clear the corresponding bit. */ paramHolderPriv->outBitmap &= ~(1<= TA_NB_GROUP_ID ) return TA_INTERNAL_ERROR(2); + if( groupId >= TA_NB_GROUP_ID ) return TA_INTERNAL_ERROR(2); if( !groupSize ) return TA_INTERNAL_ERROR(2); nbFuncFound = 0; @@ -1263,7 +1263,7 @@ static TA_RetCode getGroupSize( TA_GroupId groupId, unsigned int *groupSize ) { #ifdef TA_GEN_CODE /* Code used only when compiled with gen_code. */ - + unsigned int curIdx; unsigned int i, j, found; const TA_FuncDef **funcDefTable; diff --git a/src/ta_abstract/ta_def_ui.c b/src/ta_abstract/ta_def_ui.c index fcb029629..a103a9560 100644 --- a/src/ta_abstract/ta_def_ui.c +++ b/src/ta_abstract/ta_def_ui.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -499,8 +499,8 @@ const TA_OptInputParameterInfo TA_DEF_UI_HorizontalShift = NULL /* helpFile */ }; -/* Define the values available for the MA function. - * +/* Define the values available for the MA function. + * * Many TA function using the MA internally may wish to * re-use this parameter as one of their own. That way a * new MA will provide automatically a new way of calculating diff --git a/src/ta_abstract/ta_def_ui.h b/src/ta_abstract/ta_def_ui.h index 288bb0120..38dfd02d0 100644 --- a/src/ta_abstract/ta_def_ui.h +++ b/src/ta_abstract/ta_def_ui.h @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_abstract/ta_frame_priv.h b/src/ta_abstract/ta_frame_priv.h index ac5c72624..c105644fb 100644 --- a/src/ta_abstract/ta_frame_priv.h +++ b/src/ta_abstract/ta_frame_priv.h @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_abstract/ta_func_api.c b/src/ta_abstract/ta_func_api.c index 9fc2b65c6..1cd83ade3 100644 --- a/src/ta_abstract/ta_func_api.c +++ b/src/ta_abstract/ta_func_api.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_abstract/ta_java_defs.h b/src/ta_abstract/ta_java_defs.h index c02f87497..f93bab0fb 100644 --- a/src/ta_abstract/ta_java_defs.h +++ b/src/ta_abstract/ta_java_defs.h @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -37,7 +37,7 @@ * If you are not re-generating the java code (which is most * likely the case), just ignore this file. */ - + #define TA_ACCBANDS_Lookback accbandsLookback #define TA_ACCBANDS accbands #define TA_ACOS_Lookback acosLookback diff --git a/src/ta_abstract/tables/table_a.c b/src/ta_abstract/tables/table_a.c index be410a18c..f85115c98 100644 --- a/src/ta_abstract/tables/table_a.c +++ b/src/ta_abstract/tables/table_a.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -163,7 +163,7 @@ static const TA_OutputParameterInfo *TA_ADOSC_Outputs[] = }; static const TA_OptInputParameterInfo *TA_ADOSC_OptInputs[] = -{ +{ &TA_DEF_UI_FastADOSC_Period, &TA_DEF_UI_SlowADOSC_Period, NULL @@ -277,8 +277,8 @@ static const TA_OutputParameterInfo *TA_AROON_Outputs[] = NULL }; -static const TA_OptInputParameterInfo *TA_AROON_OptInputs[] = -{ +static const TA_OptInputParameterInfo *TA_AROON_OptInputs[] = +{ &TA_DEF_UI_TimePeriod_14_MINIMUM2, NULL }; @@ -287,7 +287,7 @@ DEF_FUNCTION( AROON, /* name */ TA_GroupId_MomentumIndicators, /* groupId */ "Aroon", /* hint */ "Aroon", /* CamelCase name */ - 0 /* flags */ + 0 /* flags */ ); /* AROON END */ @@ -305,8 +305,8 @@ static const TA_OutputParameterInfo *TA_AROONOSC_Outputs[] = NULL }; -static const TA_OptInputParameterInfo *TA_AROONOSC_OptInputs[] = -{ +static const TA_OptInputParameterInfo *TA_AROONOSC_OptInputs[] = +{ &TA_DEF_UI_TimePeriod_14_MINIMUM2, NULL }; @@ -378,7 +378,7 @@ DEF_FUNCTION( AVGPRICE, /* name */ /* AVGPRICE END */ /* AVGDEV BEGIN */ -static const TA_InputParameterInfo *TA_AVGDEV_Inputs[] = +static const TA_InputParameterInfo *TA_AVGDEV_Inputs[] = { &TA_DEF_UI_Input_Real, NULL @@ -390,7 +390,7 @@ static const TA_OutputParameterInfo *TA_AVGDEV_Outputs[] = NULL }; -static const TA_OptInputParameterInfo *TA_AVGDEV_OptInputs[] = +static const TA_OptInputParameterInfo *TA_AVGDEV_OptInputs[] = { &TA_DEF_UI_TimePeriod_14_MINIMUM2, NULL diff --git a/src/ta_abstract/tables/table_b.c b/src/ta_abstract/tables/table_b.c index 723764ab0..e0fdc4bec 100644 --- a/src/ta_abstract/tables/table_b.c +++ b/src/ta_abstract/tables/table_b.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_abstract/tables/table_c.c b/src/ta_abstract/tables/table_c.c index 8423c0afb..717f56a1b 100644 --- a/src/ta_abstract/tables/table_c.c +++ b/src/ta_abstract/tables/table_c.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -88,7 +88,7 @@ static const TA_OutputParameterInfo *TA_CDL2CROWS_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDL2CROWS_OptInputs[] = -{ +{ NULL }; @@ -115,7 +115,7 @@ static const TA_OutputParameterInfo *TA_CDL3BLACKCROWS_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDL3BLACKCROWS_OptInputs[] = -{ +{ NULL }; @@ -142,7 +142,7 @@ static const TA_OutputParameterInfo *TA_CDL3INSIDE_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDL3INSIDE_OptInputs[] = -{ +{ NULL }; @@ -169,7 +169,7 @@ static const TA_OutputParameterInfo *TA_CDL3LINESTRIKE_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDL3LINESTRIKE_OptInputs[] = -{ +{ NULL }; @@ -177,7 +177,7 @@ DEF_FUNCTION( CDL3LINESTRIKE, /* name */ TA_GroupId_PatternRecognition, /* groupId */ "Three-Line Strike ", /* hint */ "Cdl3LineStrike", /* CamelCase name */ - TA_FUNC_FLG_CANDLESTICK /* flags */ + TA_FUNC_FLG_CANDLESTICK /* flags */ ); /* CDL3LINESTRIKE END */ @@ -196,7 +196,7 @@ static const TA_OutputParameterInfo *TA_CDL3OUTSIDE_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDL3OUTSIDE_OptInputs[] = -{ +{ NULL }; @@ -223,7 +223,7 @@ static const TA_OutputParameterInfo *TA_CDL3STARSINSOUTH_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDL3STARSINSOUTH_OptInputs[] = -{ +{ NULL }; @@ -231,7 +231,7 @@ DEF_FUNCTION( CDL3STARSINSOUTH, /* name */ TA_GroupId_PatternRecognition, /* groupId */ "Three Stars In The South", /* hint */ "Cdl3StarsInSouth", /* CamelCase name */ - TA_FUNC_FLG_CANDLESTICK /* flags */ + TA_FUNC_FLG_CANDLESTICK /* flags */ ); /* CDL3STARSINSOUTH END */ @@ -250,7 +250,7 @@ static const TA_OutputParameterInfo *TA_CDL3WHITESOLDIERS_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDL3WHITESOLDIERS_OptInputs[] = -{ +{ NULL }; @@ -277,7 +277,7 @@ static const TA_OutputParameterInfo *TA_CDLABANDONEDBABY_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLABANDONEDBABY_OptInputs[] = -{ +{ &TA_DEF_UI_Penetration_30, NULL }; @@ -305,7 +305,7 @@ static const TA_OutputParameterInfo *TA_CDLADVANCEBLOCK_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLADVANCEBLOCK_OptInputs[] = -{ +{ NULL }; @@ -332,7 +332,7 @@ static const TA_OutputParameterInfo *TA_CDLBELTHOLD_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLBELTHOLD_OptInputs[] = -{ +{ NULL }; @@ -359,7 +359,7 @@ static const TA_OutputParameterInfo *TA_CDLBREAKAWAY_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLBREAKAWAY_OptInputs[] = -{ +{ NULL }; @@ -386,7 +386,7 @@ static const TA_OutputParameterInfo *TA_CDLCLOSINGMARUBOZU_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLCLOSINGMARUBOZU_OptInputs[] = -{ +{ NULL }; @@ -413,7 +413,7 @@ static const TA_OutputParameterInfo *TA_CDLCONCEALBABYSWALL_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLCONCEALBABYSWALL_OptInputs[] = -{ +{ NULL }; @@ -440,7 +440,7 @@ static const TA_OutputParameterInfo *TA_CDLCOUNTERATTACK_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLCOUNTERATTACK_OptInputs[] = -{ +{ NULL }; @@ -467,7 +467,7 @@ static const TA_OutputParameterInfo *TA_CDLDARKCLOUDCOVER_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLDARKCLOUDCOVER_OptInputs[] = -{ +{ &TA_DEF_UI_Penetration_50, NULL }; @@ -495,7 +495,7 @@ static const TA_OutputParameterInfo *TA_CDLDOJI_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLDOJI_OptInputs[] = -{ +{ NULL }; @@ -522,7 +522,7 @@ static const TA_OutputParameterInfo *TA_CDLDOJISTAR_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLDOJISTAR_OptInputs[] = -{ +{ NULL }; @@ -549,7 +549,7 @@ static const TA_OutputParameterInfo *TA_CDLDRAGONFLYDOJI_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLDRAGONFLYDOJI_OptInputs[] = -{ +{ NULL }; @@ -576,7 +576,7 @@ static const TA_OutputParameterInfo *TA_CDLENGULFING_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLENGULFING_OptInputs[] = -{ +{ NULL }; @@ -603,7 +603,7 @@ static const TA_OutputParameterInfo *TA_CDLEVENINGDOJISTAR_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLEVENINGDOJISTAR_OptInputs[] = -{ +{ &TA_DEF_UI_Penetration_30, NULL }; @@ -631,7 +631,7 @@ static const TA_OutputParameterInfo *TA_CDLEVENINGSTAR_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLEVENINGSTAR_OptInputs[] = -{ +{ &TA_DEF_UI_Penetration_30, NULL }; @@ -661,7 +661,7 @@ static const TA_OutputParameterInfo *TA_CDLGAPSIDESIDEWHITE_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLGAPSIDESIDEWHITE_OptInputs[] = -{ +{ NULL }; @@ -688,7 +688,7 @@ static const TA_OutputParameterInfo *TA_CDLGRAVESTONEDOJI_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLGRAVESTONEDOJI_OptInputs[] = -{ +{ NULL }; @@ -715,7 +715,7 @@ static const TA_OutputParameterInfo *TA_CDLHAMMER_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLHAMMER_OptInputs[] = -{ +{ NULL }; @@ -742,7 +742,7 @@ static const TA_OutputParameterInfo *TA_CDLHANGINGMAN_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLHANGINGMAN_OptInputs[] = -{ +{ NULL }; @@ -769,7 +769,7 @@ static const TA_OutputParameterInfo *TA_CDLHARAMI_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLHARAMI_OptInputs[] = -{ +{ NULL }; @@ -796,7 +796,7 @@ static const TA_OutputParameterInfo *TA_CDLHARAMICROSS_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLHARAMICROSS_OptInputs[] = -{ +{ NULL }; @@ -823,7 +823,7 @@ static const TA_OutputParameterInfo *TA_CDLHIGHWAVE_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLHIGHWAVE_OptInputs[] = -{ +{ NULL }; @@ -850,7 +850,7 @@ static const TA_OutputParameterInfo *TA_CDLHIKKAKE_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLHIKKAKE_OptInputs[] = -{ +{ NULL }; @@ -877,7 +877,7 @@ static const TA_OutputParameterInfo *TA_CDLHIKKAKEMOD_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLHIKKAKEMOD_OptInputs[] = -{ +{ NULL }; @@ -904,7 +904,7 @@ static const TA_OutputParameterInfo *TA_CDLHOMINGPIGEON_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLHOMINGPIGEON_OptInputs[] = -{ +{ NULL }; @@ -931,7 +931,7 @@ static const TA_OutputParameterInfo *TA_CDLIDENTICAL3CROWS_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLIDENTICAL3CROWS_OptInputs[] = -{ +{ NULL }; @@ -958,7 +958,7 @@ static const TA_OutputParameterInfo *TA_CDLINNECK_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLINNECK_OptInputs[] = -{ +{ NULL }; @@ -985,7 +985,7 @@ static const TA_OutputParameterInfo *TA_CDLINVERTEDHAMMER_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLINVERTEDHAMMER_OptInputs[] = -{ +{ NULL }; @@ -1012,7 +1012,7 @@ static const TA_OutputParameterInfo *TA_CDLKICKING_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLKICKING_OptInputs[] = -{ +{ NULL }; @@ -1039,7 +1039,7 @@ static const TA_OutputParameterInfo *TA_CDLKICKINGBYLENGTH_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLKICKINGBYLENGTH_OptInputs[] = -{ +{ NULL }; @@ -1066,7 +1066,7 @@ static const TA_OutputParameterInfo *TA_CDLLADDERBOTTOM_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLLADDERBOTTOM_OptInputs[] = -{ +{ NULL }; @@ -1093,7 +1093,7 @@ static const TA_OutputParameterInfo *TA_CDLLONGLEGGEDDOJI_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLLONGLEGGEDDOJI_OptInputs[] = -{ +{ NULL }; @@ -1120,7 +1120,7 @@ static const TA_OutputParameterInfo *TA_CDLLONGLINE_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLLONGLINE_OptInputs[] = -{ +{ NULL }; @@ -1147,7 +1147,7 @@ static const TA_OutputParameterInfo *TA_CDLMARUBOZU_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLMARUBOZU_OptInputs[] = -{ +{ NULL }; @@ -1174,7 +1174,7 @@ static const TA_OutputParameterInfo *TA_CDLMATCHINGLOW_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLMATCHINGLOW_OptInputs[] = -{ +{ NULL }; @@ -1201,7 +1201,7 @@ static const TA_OutputParameterInfo *TA_CDLMATHOLD_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLMATHOLD_OptInputs[] = -{ +{ &TA_DEF_UI_Penetration_50, NULL }; @@ -1229,7 +1229,7 @@ static const TA_OutputParameterInfo *TA_CDLMORNINGDOJISTAR_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLMORNINGDOJISTAR_OptInputs[] = -{ +{ &TA_DEF_UI_Penetration_30, NULL }; @@ -1257,7 +1257,7 @@ static const TA_OutputParameterInfo *TA_CDLMORNINGSTAR_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLMORNINGSTAR_OptInputs[] = -{ +{ &TA_DEF_UI_Penetration_30, NULL }; @@ -1285,7 +1285,7 @@ static const TA_OutputParameterInfo *TA_CDLONNECK_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLONNECK_OptInputs[] = -{ +{ NULL }; @@ -1312,7 +1312,7 @@ static const TA_OutputParameterInfo *TA_CDLPIERCING_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLPIERCING_OptInputs[] = -{ +{ NULL }; @@ -1339,7 +1339,7 @@ static const TA_OutputParameterInfo *TA_CDLRICKSHAWMAN_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLRICKSHAWMAN_OptInputs[] = -{ +{ NULL }; @@ -1366,7 +1366,7 @@ static const TA_OutputParameterInfo *TA_CDLRISEFALL3METHODS_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLRISEFALL3METHODS_OptInputs[] = -{ +{ NULL }; @@ -1393,7 +1393,7 @@ static const TA_OutputParameterInfo *TA_CDLSEPARATINGLINES_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLSEPARATINGLINES_OptInputs[] = -{ +{ NULL }; @@ -1420,7 +1420,7 @@ static const TA_OutputParameterInfo *TA_CDLSHOOTINGSTAR_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLSHOOTINGSTAR_OptInputs[] = -{ +{ NULL }; @@ -1447,7 +1447,7 @@ static const TA_OutputParameterInfo *TA_CDLSHORTLINE_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLSHORTLINE_OptInputs[] = -{ +{ NULL }; @@ -1474,7 +1474,7 @@ static const TA_OutputParameterInfo *TA_CDLSPINNINGTOP_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLSPINNINGTOP_OptInputs[] = -{ +{ NULL }; @@ -1501,7 +1501,7 @@ static const TA_OutputParameterInfo *TA_CDLSTALLEDPATTERN_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLSTALLEDPATTERN_OptInputs[] = -{ +{ NULL }; @@ -1528,7 +1528,7 @@ static const TA_OutputParameterInfo *TA_CDLSTICKSANDWICH_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLSTICKSANDWICH_OptInputs[] = -{ +{ NULL }; @@ -1555,7 +1555,7 @@ static const TA_OutputParameterInfo *TA_CDLTAKURI_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLTAKURI_OptInputs[] = -{ +{ NULL }; @@ -1582,7 +1582,7 @@ static const TA_OutputParameterInfo *TA_CDLTASUKIGAP_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLTASUKIGAP_OptInputs[] = -{ +{ NULL }; @@ -1609,7 +1609,7 @@ static const TA_OutputParameterInfo *TA_CDLTHRUSTING_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLTHRUSTING_OptInputs[] = -{ +{ NULL }; @@ -1636,7 +1636,7 @@ static const TA_OutputParameterInfo *TA_CDLTRISTAR_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLTRISTAR_OptInputs[] = -{ +{ NULL }; @@ -1663,7 +1663,7 @@ static const TA_OutputParameterInfo *TA_CDLUNIQUE3RIVER_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLUNIQUE3RIVER_OptInputs[] = -{ +{ NULL }; @@ -1690,7 +1690,7 @@ static const TA_OutputParameterInfo *TA_CDLUPSIDEGAP2CROWS_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLUPSIDEGAP2CROWS_OptInputs[] = -{ +{ NULL }; @@ -1717,7 +1717,7 @@ static const TA_OutputParameterInfo *TA_CDLXSIDEGAP3METHODS_Outputs[] = }; static const TA_OptInputParameterInfo *TA_CDLXSIDEGAP3METHODS_OptInputs[] = -{ +{ NULL }; @@ -1854,16 +1854,16 @@ const TA_FuncDef *TA_DEF_TableC[] = ADD_TO_TABLE(CDLSEPARATINGLINES), ADD_TO_TABLE(CDLSHOOTINGSTAR), ADD_TO_TABLE(CDLSHORTLINE), - ADD_TO_TABLE(CDLSPINNINGTOP), - ADD_TO_TABLE(CDLSTALLEDPATTERN), - ADD_TO_TABLE(CDLSTICKSANDWICH), + ADD_TO_TABLE(CDLSPINNINGTOP), + ADD_TO_TABLE(CDLSTALLEDPATTERN), + ADD_TO_TABLE(CDLSTICKSANDWICH), ADD_TO_TABLE(CDLTAKURI), ADD_TO_TABLE(CDLTASUKIGAP), ADD_TO_TABLE(CDLTHRUSTING), ADD_TO_TABLE(CDLTRISTAR), - ADD_TO_TABLE(CDLUNIQUE3RIVER), - ADD_TO_TABLE(CDLUPSIDEGAP2CROWS), - ADD_TO_TABLE(CDLXSIDEGAP3METHODS), + ADD_TO_TABLE(CDLUNIQUE3RIVER), + ADD_TO_TABLE(CDLUPSIDEGAP2CROWS), + ADD_TO_TABLE(CDLXSIDEGAP3METHODS), ADD_TO_TABLE(CEIL), ADD_TO_TABLE(CMO), ADD_TO_TABLE(CORREL), diff --git a/src/ta_abstract/tables/table_d.c b/src/ta_abstract/tables/table_d.c index a34754d91..cb0ebb8f2 100644 --- a/src/ta_abstract/tables/table_d.c +++ b/src/ta_abstract/tables/table_d.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_abstract/tables/table_e.c b/src/ta_abstract/tables/table_e.c index d4291b141..f7b87190f 100644 --- a/src/ta_abstract/tables/table_e.c +++ b/src/ta_abstract/tables/table_e.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_abstract/tables/table_f.c b/src/ta_abstract/tables/table_f.c index 8d39818db..5f949e14e 100644 --- a/src/ta_abstract/tables/table_f.c +++ b/src/ta_abstract/tables/table_f.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_abstract/tables/table_g.c b/src/ta_abstract/tables/table_g.c index c1522cc12..dc4be37e2 100644 --- a/src/ta_abstract/tables/table_g.c +++ b/src/ta_abstract/tables/table_g.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_abstract/tables/table_h.c b/src/ta_abstract/tables/table_h.c index b4892e02c..f8490921c 100644 --- a/src/ta_abstract/tables/table_h.c +++ b/src/ta_abstract/tables/table_h.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -62,7 +62,7 @@ static const TA_OutputParameterInfo *TA_HT_DCPERIOD_Outputs[] = }; static const TA_OptInputParameterInfo *TA_HT_DCPERIOD_OptInputs[] = -{ +{ NULL }; @@ -88,7 +88,7 @@ static const TA_OutputParameterInfo *TA_HT_DCPHASE_Outputs[] = }; static const TA_OptInputParameterInfo *TA_HT_DCPHASE_OptInputs[] = -{ +{ NULL }; @@ -121,7 +121,7 @@ static const TA_OutputParameterInfo *TA_HT_PHASOR_Outputs[] = }; static const TA_OptInputParameterInfo *TA_HT_PHASOR_OptInputs[] = -{ +{ NULL }; @@ -154,7 +154,7 @@ static const TA_OutputParameterInfo *TA_HT_SINE_Outputs[] = }; static const TA_OptInputParameterInfo *TA_HT_SINE_OptInputs[] = -{ +{ NULL }; @@ -180,7 +180,7 @@ static const TA_OutputParameterInfo *TA_HT_TRENDLINE_Outputs[] = }; static const TA_OptInputParameterInfo *TA_HT_TRENDLINE_OptInputs[] = -{ +{ NULL }; @@ -206,7 +206,7 @@ static const TA_OutputParameterInfo *TA_HT_TRENDMODE_Outputs[] = }; static const TA_OptInputParameterInfo *TA_HT_TRENDMODE_OptInputs[] = -{ +{ NULL }; diff --git a/src/ta_abstract/tables/table_i.c b/src/ta_abstract/tables/table_i.c index a2d002e3f..11f32e842 100644 --- a/src/ta_abstract/tables/table_i.c +++ b/src/ta_abstract/tables/table_i.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_abstract/tables/table_j.c b/src/ta_abstract/tables/table_j.c index ae3dd41d2..e185726b2 100644 --- a/src/ta_abstract/tables/table_j.c +++ b/src/ta_abstract/tables/table_j.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_abstract/tables/table_k.c b/src/ta_abstract/tables/table_k.c index 154db88d6..79d39e35c 100644 --- a/src/ta_abstract/tables/table_k.c +++ b/src/ta_abstract/tables/table_k.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_abstract/tables/table_l.c b/src/ta_abstract/tables/table_l.c index 97cec1e90..e64c3a7e6 100644 --- a/src/ta_abstract/tables/table_l.c +++ b/src/ta_abstract/tables/table_l.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_abstract/tables/table_m.c b/src/ta_abstract/tables/table_m.c index 8fa976a97..7e832418c 100644 --- a/src/ta_abstract/tables/table_m.c +++ b/src/ta_abstract/tables/table_m.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -324,7 +324,7 @@ static const TA_OutputParameterInfo *TA_MAVP_Outputs[] = }; static const TA_OptInputParameterInfo *TA_MAVP_OptInputs[] = -{ +{ &TA_DEF_UI_MinPeriod, &TA_DEF_UI_MaxPeriod, &TA_DEF_UI_MA_Method, @@ -428,7 +428,7 @@ static const TA_OutputParameterInfo *TA_MFI_Outputs[] = NULL }; -static const TA_OptInputParameterInfo *TA_MFI_OptInputs[] = +static const TA_OptInputParameterInfo *TA_MFI_OptInputs[] = { &TA_DEF_UI_TimePeriod_14_MINIMUM2, NULL @@ -455,7 +455,7 @@ static const TA_OutputParameterInfo *TA_MIDPRICE_Outputs[] = NULL }; -static const TA_OptInputParameterInfo *TA_MIDPRICE_OptInputs[] = +static const TA_OptInputParameterInfo *TA_MIDPRICE_OptInputs[] = { &TA_DEF_UI_TimePeriod_14_MINIMUM2, NULL }; @@ -635,7 +635,7 @@ DEF_FUNCTION( MINUS_DI, /* name */ TA_GroupId_MomentumIndicators, /* groupId */ "Minus Directional Indicator", /* hint */ "MinusDI", /* CamelCase name */ - TA_FUNC_FLG_UNST_PER /* flags */ + TA_FUNC_FLG_UNST_PER /* flags */ ); /* MINUS_DI END */ diff --git a/src/ta_abstract/tables/table_n.c b/src/ta_abstract/tables/table_n.c index 736ed879f..0f0b7a2e8 100644 --- a/src/ta_abstract/tables/table_n.c +++ b/src/ta_abstract/tables/table_n.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_abstract/tables/table_o.c b/src/ta_abstract/tables/table_o.c index 4859a4981..c1000316f 100644 --- a/src/ta_abstract/tables/table_o.c +++ b/src/ta_abstract/tables/table_o.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_abstract/tables/table_p.c b/src/ta_abstract/tables/table_p.c index 01de69cf6..e5bbc2252 100644 --- a/src/ta_abstract/tables/table_p.c +++ b/src/ta_abstract/tables/table_p.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_abstract/tables/table_q.c b/src/ta_abstract/tables/table_q.c index b1a4f23a7..29de52ab6 100644 --- a/src/ta_abstract/tables/table_q.c +++ b/src/ta_abstract/tables/table_q.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_abstract/tables/table_r.c b/src/ta_abstract/tables/table_r.c index fcba055e9..732e320c0 100644 --- a/src/ta_abstract/tables/table_r.c +++ b/src/ta_abstract/tables/table_r.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_abstract/tables/table_s.c b/src/ta_abstract/tables/table_s.c index 350fb2642..3a33e355c 100644 --- a/src/ta_abstract/tables/table_s.c +++ b/src/ta_abstract/tables/table_s.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_abstract/tables/table_t.c b/src/ta_abstract/tables/table_t.c index 14f694c5d..44f0b9701 100644 --- a/src/ta_abstract/tables/table_t.c +++ b/src/ta_abstract/tables/table_t.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_abstract/tables/table_u.c b/src/ta_abstract/tables/table_u.c index 4e0a4f4cb..06147a037 100644 --- a/src/ta_abstract/tables/table_u.c +++ b/src/ta_abstract/tables/table_u.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_abstract/tables/table_v.c b/src/ta_abstract/tables/table_v.c index c0c7e7b5a..9865afce4 100644 --- a/src/ta_abstract/tables/table_v.c +++ b/src/ta_abstract/tables/table_v.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_abstract/tables/table_w.c b/src/ta_abstract/tables/table_w.c index eae2aaa0c..8875f8ce6 100644 --- a/src/ta_abstract/tables/table_w.c +++ b/src/ta_abstract/tables/table_w.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -93,7 +93,7 @@ DEF_FUNCTION( WILLR, /* name */ TA_GroupId_MomentumIndicators, /* groupId */ "Williams' %R", /* hint */ "WillR", /* CamelCase name */ - 0 /* flags */ + 0 /* flags */ ); /* WILLR END */ @@ -119,7 +119,7 @@ DEF_FUNCTION( WMA, /* name */ TA_GroupId_OverlapStudies, /* groupId */ "Weighted Moving Average", /* hint */ "Wma", /* CamelCase name */ - TA_FUNC_FLG_OVERLAP /* flags */ + TA_FUNC_FLG_OVERLAP /* flags */ ); /* WMA END */ diff --git a/src/ta_abstract/tables/table_x.c b/src/ta_abstract/tables/table_x.c index 69c45c80d..136dded8b 100644 --- a/src/ta_abstract/tables/table_x.c +++ b/src/ta_abstract/tables/table_x.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_abstract/tables/table_y.c b/src/ta_abstract/tables/table_y.c index c18dd6cd9..f80eca692 100644 --- a/src/ta_abstract/tables/table_y.c +++ b/src/ta_abstract/tables/table_y.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_abstract/tables/table_z.c b/src/ta_abstract/tables/table_z.c index 34f3ae424..1586082b1 100644 --- a/src/ta_abstract/tables/table_z.c +++ b/src/ta_abstract/tables/table_z.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_abstract/templates/CoreAnnotated.java.template b/src/ta_abstract/templates/CoreAnnotated.java.template index 8f1f39cd8..96cddbb06 100644 --- a/src/ta_abstract/templates/CoreAnnotated.java.template +++ b/src/ta_abstract/templates/CoreAnnotated.java.template @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -39,7 +39,7 @@ */ package com.tictactec.ta.lib; - + import com.tictactec.ta.lib.MAType; import com.tictactec.ta.lib.MInteger; import com.tictactec.ta.lib.RetCode; diff --git a/src/ta_abstract/templates/excel_glue.c.template b/src/ta_abstract/templates/excel_glue.c.template index 2a45c5478..a588e1436 100644 --- a/src/ta_abstract/templates/excel_glue.c.template +++ b/src/ta_abstract/templates/excel_glue.c.template @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -37,7 +37,7 @@ * If you are not re-building the excel library (which is most * likely the case), just ignore this file. */ - + %%%GENCODE%%% /*************** diff --git a/src/ta_abstract/templates/ta_frame.c.template b/src/ta_abstract/templates/ta_frame.c.template index 95897ee89..2a5c261b2 100644 --- a/src/ta_abstract/templates/ta_frame.c.template +++ b/src/ta_abstract/templates/ta_frame.c.template @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_abstract/templates/ta_func.h.template b/src/ta_abstract/templates/ta_func.h.template index 0c1ad1fc1..0e5170362 100644 --- a/src/ta_abstract/templates/ta_func.h.template +++ b/src/ta_abstract/templates/ta_func.h.template @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_abstract/templates/ta_func.swg.template b/src/ta_abstract/templates/ta_func.swg.template index b608620ce..a923961f9 100644 --- a/src/ta_abstract/templates/ta_func.swg.template +++ b/src/ta_abstract/templates/ta_func.swg.template @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -37,7 +37,7 @@ * If you are not re-building an interface with SWIG (which is most * likely the case), just ignore this file. */ - + %%%GENCODE%%% /*************** diff --git a/src/ta_abstract/templates/ta_func_api.c.template b/src/ta_abstract/templates/ta_func_api.c.template index 1e55ac8ba..ca75e2903 100644 --- a/src/ta_abstract/templates/ta_func_api.c.template +++ b/src/ta_abstract/templates/ta_func_api.c.template @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_abstract/templates/ta_java_defs.h.template b/src/ta_abstract/templates/ta_java_defs.h.template index 231465152..4cc386f3b 100644 --- a/src/ta_abstract/templates/ta_java_defs.h.template +++ b/src/ta_abstract/templates/ta_java_defs.h.template @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -37,7 +37,7 @@ * If you are not re-generating the java code (which is most * likely the case), just ignore this file. */ - + %%%GENCODE%%% /*************** diff --git a/src/ta_abstract/templates/ta_retcode.c.template b/src/ta_abstract/templates/ta_retcode.c.template index 3e1779df6..a6851ed05 100644 --- a/src/ta_abstract/templates/ta_retcode.c.template +++ b/src/ta_abstract/templates/ta_retcode.c.template @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -41,7 +41,7 @@ */ #include -typedef struct +typedef struct { TA_RetCode retCode; const char * const enumStr; @@ -58,7 +58,7 @@ static TA_InternalRetCodeInfo retCodeInfoTable[] = { void TA_SetRetCodeInfo( TA_RetCode theRetCode, TA_RetCodeInfo *retCodeInfo ) { unsigned int i; - + /* Trap internal error code */ if( (theRetCode >= 5000) && (theRetCode <= 5999) ) { @@ -66,7 +66,7 @@ void TA_SetRetCodeInfo( TA_RetCode theRetCode, TA_RetCodeInfo *retCodeInfo ) retCodeInfo->infoStr = "Unexpected Internal Error - Contact TA-Lib.org"; return; } - + /* Check among all the error code defined in ta_common.h */ for( i=0; i < (NB_RET_CODE_INFO-1); i++ ) { diff --git a/src/ta_abstract/templates/ta_x.c.template b/src/ta_abstract/templates/ta_x.c.template index fe027fdba..0a25f2a1f 100644 --- a/src/ta_abstract/templates/ta_x.c.template +++ b/src/ta_abstract/templates/ta_x.c.template @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_common/ta_global.c b/src/ta_common/ta_global.c index 9dd75228d..53965cfb8 100644 --- a/src/ta_common/ta_global.c +++ b/src/ta_common/ta_global.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_common/ta_pragma.h b/src/ta_common/ta_pragma.h index 040c18731..9b35c7314 100644 --- a/src/ta_common/ta_pragma.h +++ b/src/ta_common/ta_pragma.h @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -45,27 +45,27 @@ */ /* Description: - * + * * Visual Studio 2005 has extended the C Run-Time Library by including "secure" * runtime functions and deprecating the previous function prototypes. Since * we need to use the previous prototypes to maintain compatibility with other - * platform compilers we are going to disable the deprecation warnings when + * platform compilers we are going to disable the deprecation warnings when * compiling with Visual Studio 2005. - * - * Note: this header must be the first inclusion referenced by the code file + * + * Note: this header must be the first inclusion referenced by the code file * needing these settings!!!!! - * + * */ #ifndef TA_PRAGMA_H #define TA_PRAGMA_H #if (_MSC_VER >= 1400) // VC8+ nmake and VS2005 - + #ifndef _CRT_SECURE_NO_DEPRECATE //turn off MS 'safe' CRT library routines #define _CRT_SECURE_NO_DEPRECATE 1 #endif - + // There are additional macros that may be needed in the future, so we'll list them here //#ifndef _CRT_SECURE_NO_WARNINGS //turn off MS 'safe' CRT library routines // #define _CRT_SECURE_NO_WARNINGS 1 diff --git a/src/ta_common/ta_retcode.c b/src/ta_common/ta_retcode.c index ba0468639..f5600cec1 100644 --- a/src/ta_common/ta_retcode.c +++ b/src/ta_common/ta_retcode.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -41,7 +41,7 @@ */ #include -typedef struct +typedef struct { TA_RetCode retCode; const char * const enumStr; @@ -75,7 +75,7 @@ static TA_InternalRetCodeInfo retCodeInfoTable[] = { void TA_SetRetCodeInfo( TA_RetCode theRetCode, TA_RetCodeInfo *retCodeInfo ) { unsigned int i; - + /* Trap internal error code */ if( (theRetCode >= 5000) && (theRetCode <= 5999) ) { @@ -83,7 +83,7 @@ void TA_SetRetCodeInfo( TA_RetCode theRetCode, TA_RetCodeInfo *retCodeInfo ) retCodeInfo->infoStr = "Unexpected Internal Error - Contact TA-Lib.org"; return; } - + /* Check among all the error code defined in ta_common.h */ for( i=0; i < (NB_RET_CODE_INFO-1); i++ ) { diff --git a/src/ta_common/ta_version.c b/src/ta_common/ta_version.c index 591fe278e..3cc023904 100644 --- a/src/ta_common/ta_version.c +++ b/src/ta_common/ta_version.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_ACCBANDS.c b/src/ta_func/ta_ACCBANDS.c index 037de5fdb..694f8a27d 100644 --- a/src/ta_func/ta_ACCBANDS.c +++ b/src/ta_func/ta_ACCBANDS.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -244,7 +244,7 @@ outputSize = endIdx-startIdx+1; bufferSize = outputSize+lookbackTotal; ARRAY_ALLOC(tempBuffer1, bufferSize ); - #if !defined(_JAVA) + #if !defined(_JAVA) if( !tempBuffer1 ) { VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); @@ -254,7 +254,7 @@ #endif ARRAY_ALLOC(tempBuffer2, bufferSize ); - #if !defined(_JAVA) + #if !defined(_JAVA) if( !tempBuffer2 ) { ARRAY_FREE(tempBuffer1); @@ -265,9 +265,9 @@ #endif /* Calculate the upper/lower band at the same time (no SMA yet). - * Must start calculation back enough to cover the lookback + * Must start calculation back enough to cover the lookback * required later for the SMA. - */ + */ for(j=0, i=startIdx-lookbackTotal; i<=endIdx; i++, j++) { tempReal = inHigh[i]+inLow[i]; @@ -286,12 +286,12 @@ /* Calculate the middle band, which is a moving average of the close. */ retCode = FUNCTION_CALL(SMA)( startIdx, endIdx, inClose, - optInTimePeriod, + optInTimePeriod, VALUE_HANDLE_OUT(outBegIdxDummy), VALUE_HANDLE_OUT(outNbElementDummy), outRealMiddleBand ); if( (retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) || ((int)VALUE_HANDLE_GET(outNbElementDummy) != outputSize) ) { - ARRAY_FREE( tempBuffer1 ); + ARRAY_FREE( tempBuffer1 ); ARRAY_FREE( tempBuffer2 ); VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); @@ -301,13 +301,13 @@ /* Now let's take the SMA for the upper band. */ retCode = FUNCTION_CALL_DOUBLE(SMA)( 0, bufferSize-1, tempBuffer1, optInTimePeriod, - VALUE_HANDLE_OUT(outBegIdxDummy), VALUE_HANDLE_OUT(outNbElementDummy), + VALUE_HANDLE_OUT(outBegIdxDummy), VALUE_HANDLE_OUT(outNbElementDummy), outRealUpperBand ); if( (retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) || ((int)VALUE_HANDLE_GET(outNbElementDummy) != outputSize) ) { - ARRAY_FREE( tempBuffer1 ); - ARRAY_FREE( tempBuffer2 ); + ARRAY_FREE( tempBuffer1 ); + ARRAY_FREE( tempBuffer2 ); VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); return retCode; @@ -316,11 +316,11 @@ /* Now let's take the SMA for the lower band. */ retCode = FUNCTION_CALL_DOUBLE(SMA)( 0, bufferSize-1, tempBuffer2, optInTimePeriod, - VALUE_HANDLE_OUT(outBegIdxDummy), VALUE_HANDLE_OUT(outNbElementDummy), + VALUE_HANDLE_OUT(outBegIdxDummy), VALUE_HANDLE_OUT(outNbElementDummy), outRealLowerBand ); - ARRAY_FREE( tempBuffer1 ); - ARRAY_FREE( tempBuffer2 ); + ARRAY_FREE( tempBuffer1 ); + ARRAY_FREE( tempBuffer2 ); if( (retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) || ((int)VALUE_HANDLE_GET(outNbElementDummy) != outputSize) ) { @@ -435,7 +435,7 @@ /* Generated */ outputSize = endIdx-startIdx+1; /* Generated */ bufferSize = outputSize+lookbackTotal; /* Generated */ ARRAY_ALLOC(tempBuffer1, bufferSize ); -/* Generated */ #if !defined(_JAVA) +/* Generated */ #if !defined(_JAVA) /* Generated */ if( !tempBuffer1 ) /* Generated */ { /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); @@ -444,7 +444,7 @@ /* Generated */ } /* Generated */ #endif /* Generated */ ARRAY_ALLOC(tempBuffer2, bufferSize ); -/* Generated */ #if !defined(_JAVA) +/* Generated */ #if !defined(_JAVA) /* Generated */ if( !tempBuffer2 ) /* Generated */ { /* Generated */ ARRAY_FREE(tempBuffer1); @@ -469,11 +469,11 @@ /* Generated */ } /* Generated */ } /* Generated */ retCode = FUNCTION_CALL(SMA)( startIdx, endIdx, inClose, -/* Generated */ optInTimePeriod, +/* 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( tempBuffer1 ); /* Generated */ ARRAY_FREE( tempBuffer2 ); /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); @@ -481,22 +481,22 @@ /* Generated */ } /* Generated */ retCode = FUNCTION_CALL_DOUBLE(SMA)( 0, bufferSize-1, tempBuffer1, /* Generated */ optInTimePeriod, -/* Generated */ VALUE_HANDLE_OUT(outBegIdxDummy), VALUE_HANDLE_OUT(outNbElementDummy), +/* 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 */ 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 */ VALUE_HANDLE_OUT(outBegIdxDummy), VALUE_HANDLE_OUT(outNbElementDummy), /* Generated */ outRealLowerBand ); -/* Generated */ ARRAY_FREE( tempBuffer1 ); -/* Generated */ ARRAY_FREE( tempBuffer2 ); +/* 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); diff --git a/src/ta_func/ta_ACOS.c b/src/ta_func/ta_ACOS.c index e0340e7e1..e349867c8 100644 --- a/src/ta_func/ta_ACOS.c +++ b/src/ta_func/ta_ACOS.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_AD.c b/src/ta_func/ta_AD.c index 94aa9a133..49d92fddf 100644 --- a/src/ta_func/ta_AD.c +++ b/src/ta_func/ta_AD.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -190,7 +190,7 @@ /* Note: Results from this function might vary slightly * from Metastock outputs. The reason being that * Metastock use float instead of double and this - * cause a different floating-point precision to + * cause a different floating-point precision to * be used. * * For most function, this is not an apparent difference @@ -198,7 +198,7 @@ * this AD function), minor imprecision adds up and becomes * significative. * - * For better precision, TA-Lib use double in all its + * For better precision, TA-Lib use double in all its * its calculations. */ @@ -219,7 +219,7 @@ if( tmp > 0.0 ) ad += (((close-low)-(high-close))/tmp)*((double)inVolume[currentBar]); - + outReal[outIdx++] = ad; currentBar++; diff --git a/src/ta_func/ta_ADD.c b/src/ta_func/ta_ADD.c index cc2ea2715..1f169fbfc 100644 --- a/src/ta_func/ta_ADD.c +++ b/src/ta_func/ta_ADD.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_ADOSC.c b/src/ta_func/ta_ADOSC.c index 99882d1b5..161ff8355 100644 --- a/src/ta_func/ta_ADOSC.c +++ b/src/ta_func/ta_ADOSC.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -251,7 +251,7 @@ * * The ADOSC is always the (fastEMA - slowEMA) regardless * of the period specified. In other word: - * + * * ADOSC(3,10) = EMA(3,AD) - EMA(10,AD) * * while @@ -266,7 +266,7 @@ * experiment with unusual parameter settings. */ - /* Identify the slowest period. + /* Identify the slowest period. * This infomration is used soleley to bootstrap * the algorithm (skip the lookback period). */ @@ -319,7 +319,7 @@ * both EMA and simply seed with the first A/D value. * * Note: Metastock do the same. - */ + */ CALCULATE_AD; fastEMA = ad; slowEMA = ad; @@ -330,8 +330,8 @@ CALCULATE_AD; fastEMA = (fastk*ad)+(one_minus_fastk*fastEMA); slowEMA = (slowk*ad)+(one_minus_slowk*slowEMA); - } - + } + /* Perform the calculation for the requested range */ outIdx = 0; while( today <= endIdx ) @@ -472,7 +472,7 @@ /* Generated */ CALCULATE_AD; /* Generated */ fastEMA = (fastk*ad)+(one_minus_fastk*fastEMA); /* Generated */ slowEMA = (slowk*ad)+(one_minus_slowk*slowEMA); -/* Generated */ } +/* Generated */ } /* Generated */ outIdx = 0; /* Generated */ while( today <= endIdx ) /* Generated */ { diff --git a/src/ta_func/ta_ADX.c b/src/ta_func/ta_ADX.c index 72ff01362..06b82ab7f 100644 --- a/src/ta_func/ta_ADX.c +++ b/src/ta_func/ta_ADX.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -221,10 +221,10 @@ /* Insert TA function code here. */ - /* + /* * The DM1 (one period) is base on the largest part of * today's range that is outside of yesterdays range. - * + * * The following 7 cases explain how the +DM and -DM are * calculated on one period: * @@ -233,8 +233,8 @@ * | | C| * | +DM1 = (C-A) B| | +DM1 = 0 * | -DM1 = 0 | -DM1 = (B-D) - * A| | D| - * | D| + * A| | D| + * | D| * B| * * Case 3: Case 4: @@ -242,11 +242,11 @@ * | A| | * | +DM1 = (C-A) | | +DM1 = 0 * | -DM1 = 0 B| | -DM1 = (B-D) - * A| | | + * A| | | * | | D| * B| | * D| - * + * * Case 5: Case 6: * A| A| C| * | C| +DM1 = 0 | | +DM1 = 0 @@ -256,7 +256,7 @@ * * * Case 7: - * + * * C| * A| | * | | +DM=0 @@ -273,12 +273,12 @@ * equal the lows). * * When calculating the DM over a period > 1, the one-period DM - * for the desired period are initialy sum. In other word, - * for a -DM14, sum the -DM1 for the first 14 days (that's + * for the desired period are initialy sum. In other word, + * for a -DM14, sum the -DM1 for the first 14 days (that's * 13 values because there is no DM for the first day!) * Subsequent DM are calculated using the Wilder's * smoothing approach: - * + * * Previous -DM14 * Today's -DM14 = Previous -DM14 - -------------- + Today's -DM1 * 14 @@ -286,7 +286,7 @@ * (Same thing for +DM14) * * Calculation of a -DI14 is as follow: - * + * * -DM14 * -DI14 = -------- * TR14 @@ -303,7 +303,7 @@ * TA_TRANGE function on how to calculate the true range. * * Calculation of the DX14 is: - * + * * diffDI = ABS( (-DI14) - (+DI14) ) * sumDI = (-DI14) + (+DI14) * @@ -328,7 +328,7 @@ * * This was understandable in the context that at the time the book * was written, most user were doing the calculation by hand. - * + * * For a computer, rounding is unnecessary (and even problematic when inputs * are close to 1). * @@ -337,7 +337,7 @@ */ #undef round_pos #define round_pos(x) (x) - + lookbackTotal = (2*optInTimePeriod) + TA_GLOBALS_UNSTABLE_PERIOD(TA_FUNC_UNST_ADX,Adx) - 1; /* Adjust startIdx to account for the lookback period. */ diff --git a/src/ta_func/ta_ADXR.c b/src/ta_func/ta_ADXR.c index 2f31280c2..003f8887d 100644 --- a/src/ta_func/ta_ADXR.c +++ b/src/ta_func/ta_ADXR.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -211,7 +211,7 @@ * * This was understandable in the context that at the time the book * was written, most user were doing the calculation by hand. - * + * * For a computer, rounding is unnecessary (and even problematic when inputs * are close to 1). * @@ -248,7 +248,7 @@ inHigh, inLow, inClose, optInTimePeriod, outBegIdx, outNBElement, adx ); - if( retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) + if( retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) { ARRAY_FREE( adx ); return retCode; @@ -360,7 +360,7 @@ /* Generated */ retCode = FUNCTION_CALL(ADX)( startIdx-(optInTimePeriod-1), endIdx, /* Generated */ inHigh, inLow, inClose, /* Generated */ optInTimePeriod, outBegIdx, outNBElement, adx ); -/* Generated */ if( retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) +/* Generated */ if( retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) /* Generated */ { /* Generated */ ARRAY_FREE( adx ); /* Generated */ return retCode; diff --git a/src/ta_func/ta_APO.c b/src/ta_func/ta_APO.c index dcc975070..26d4bc4cf 100644 --- a/src/ta_func/ta_APO.c +++ b/src/ta_func/ta_APO.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -245,10 +245,10 @@ return ENUM_VALUE(RetCode,TA_ALLOC_ERR,AllocErr); #endif - retCode = FUNCTION_CALL(INT_PO)( startIdx, endIdx, + retCode = FUNCTION_CALL(INT_PO)( startIdx, endIdx, inReal, - optInFastPeriod, - optInSlowPeriod, + optInFastPeriod, + optInSlowPeriod, optInMAType, outBegIdx, outNBElement, @@ -273,8 +273,8 @@ enum class Core::RetCode Core::TA_INT_PO( int startIdx, int endIdx, SubArray^ inReal, - int optInFastPeriod, - int optInSlowPeriod, + int optInFastPeriod, + int optInSlowPeriod, MAType optInMethod_2, [Out]int% outBegIdx, [Out]int% outNBElement, @@ -286,8 +286,8 @@ enum class Core::RetCode Core::TA_INT_PO( int startIdx, int endIdx, cli::array^ inReal, - int optInFastPeriod, - int optInSlowPeriod, + int optInFastPeriod, + int optInSlowPeriod, MAType optInMethod_2, [Out]int% outBegIdx, [Out]int% outNBElement, @@ -298,8 +298,8 @@ RetCode TA_INT_PO( int startIdx, int endIdx, INPUT_TYPE inReal[], - int optInFastPeriod, - int optInSlowPeriod, + int optInFastPeriod, + int optInSlowPeriod, MAType optInMethod_2, MInteger outBegIdx, MInteger outNBElement, @@ -311,8 +311,8 @@ RetCode TA_INT_PO( int startIdx, TA_RetCode TA_PREFIX(INT_PO)( int startIdx, int endIdx, const INPUT_TYPE *inReal, - int optInFastPeriod, - int optInSlowPeriod, + int optInFastPeriod, + int optInSlowPeriod, TA_MAType optInMethod_2, int *outBegIdx, int *outNBElement, @@ -346,17 +346,17 @@ TA_RetCode TA_PREFIX(INT_PO)( int startIdx, /* Calculate the fast MA into the tempBuffer. */ retCode = FUNCTION_CALL(MA)( startIdx, endIdx, inReal, - optInFastPeriod, - optInMethod_2, + optInFastPeriod, + optInMethod_2, VALUE_HANDLE_OUT(outBegIdx2), VALUE_HANDLE_OUT(outNbElement2), tempBuffer ); if( retCode == ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) { /* Calculate the slow MA into the output. */ - retCode = FUNCTION_CALL(MA)( startIdx, endIdx, + retCode = FUNCTION_CALL(MA)( startIdx, endIdx, inReal, - optInSlowPeriod, + optInSlowPeriod, optInMethod_2, VALUE_HANDLE_OUT(outBegIdx1), VALUE_HANDLE_OUT(outNbElement1), outReal ); @@ -366,7 +366,7 @@ TA_RetCode TA_PREFIX(INT_PO)( int startIdx, tempInteger = VALUE_HANDLE_GET(outBegIdx1) - VALUE_HANDLE_GET(outBegIdx2); if( doPercentageOutput != 0 ) { - /* Calculate ((fast MA)-(slow MA))/(slow MA) in the output. */ + /* Calculate ((fast MA)-(slow MA))/(slow MA) in the output. */ for( i=0,j=tempInteger; i < VALUE_HANDLE_GET(outNbElement1); i++, j++ ) { tempReal = outReal[i]; @@ -378,7 +378,7 @@ TA_RetCode TA_PREFIX(INT_PO)( int startIdx, } else { - /* Calculate (fast MA)-(slow MA) in the output. */ + /* Calculate (fast MA)-(slow MA) in the output. */ for( i=0,j=tempInteger; i < VALUE_HANDLE_GET(outNbElement1); i++, j++ ) outReal[i] = tempBuffer[j]-outReal[i]; } @@ -483,10 +483,10 @@ TA_RetCode TA_PREFIX(INT_PO)( int startIdx, /* Generated */ if( !tempBuffer ) /* Generated */ return ENUM_VALUE(RetCode,TA_ALLOC_ERR,AllocErr); /* Generated */ #endif -/* Generated */ retCode = FUNCTION_CALL(INT_PO)( startIdx, endIdx, +/* Generated */ retCode = FUNCTION_CALL(INT_PO)( startIdx, endIdx, /* Generated */ inReal, -/* Generated */ optInFastPeriod, -/* Generated */ optInSlowPeriod, +/* Generated */ optInFastPeriod, +/* Generated */ optInSlowPeriod, /* Generated */ optInMAType, /* Generated */ outBegIdx, /* Generated */ outNBElement, @@ -503,8 +503,8 @@ TA_RetCode TA_PREFIX(INT_PO)( int startIdx, /* Generated */ enum class Core::RetCode Core::TA_INT_PO( int startIdx, /* Generated */ int endIdx, /* Generated */ SubArray^ inReal, -/* Generated */ int optInFastPeriod, -/* Generated */ int optInSlowPeriod, +/* Generated */ int optInFastPeriod, +/* Generated */ int optInSlowPeriod, /* Generated */ MAType optInMethod_2, /* Generated */ [Out]int% outBegIdx, /* Generated */ [Out]int% outNBElement, @@ -515,8 +515,8 @@ TA_RetCode TA_PREFIX(INT_PO)( int startIdx, /* Generated */ enum class Core::RetCode Core::TA_INT_PO( int startIdx, /* Generated */ int endIdx, /* Generated */ cli::array^ inReal, -/* Generated */ int optInFastPeriod, -/* Generated */ int optInSlowPeriod, +/* Generated */ int optInFastPeriod, +/* Generated */ int optInSlowPeriod, /* Generated */ MAType optInMethod_2, /* Generated */ [Out]int% outBegIdx, /* Generated */ [Out]int% outNBElement, @@ -527,8 +527,8 @@ TA_RetCode TA_PREFIX(INT_PO)( int startIdx, /* Generated */ RetCode TA_INT_PO( int startIdx, /* Generated */ int endIdx, /* Generated */ INPUT_TYPE inReal[], -/* Generated */ int optInFastPeriod, -/* Generated */ int optInSlowPeriod, +/* Generated */ int optInFastPeriod, +/* Generated */ int optInSlowPeriod, /* Generated */ MAType optInMethod_2, /* Generated */ MInteger outBegIdx, /* Generated */ MInteger outNBElement, @@ -539,8 +539,8 @@ TA_RetCode TA_PREFIX(INT_PO)( int startIdx, /* Generated */ TA_RetCode TA_PREFIX(INT_PO)( int startIdx, /* Generated */ int endIdx, /* Generated */ const INPUT_TYPE *inReal, -/* Generated */ int optInFastPeriod, -/* Generated */ int optInSlowPeriod, +/* Generated */ int optInFastPeriod, +/* Generated */ int optInSlowPeriod, /* Generated */ TA_MAType optInMethod_2, /* Generated */ int *outBegIdx, /* Generated */ int *outNBElement, @@ -565,15 +565,15 @@ TA_RetCode TA_PREFIX(INT_PO)( int startIdx, /* Generated */ } /* Generated */ retCode = FUNCTION_CALL(MA)( startIdx, endIdx, /* Generated */ inReal, -/* Generated */ optInFastPeriod, -/* Generated */ optInMethod_2, +/* Generated */ optInFastPeriod, +/* Generated */ optInMethod_2, /* Generated */ VALUE_HANDLE_OUT(outBegIdx2), VALUE_HANDLE_OUT(outNbElement2), /* Generated */ tempBuffer ); /* Generated */ if( retCode == ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) /* Generated */ { -/* Generated */ retCode = FUNCTION_CALL(MA)( startIdx, endIdx, +/* Generated */ retCode = FUNCTION_CALL(MA)( startIdx, endIdx, /* Generated */ inReal, -/* Generated */ optInSlowPeriod, +/* Generated */ optInSlowPeriod, /* Generated */ optInMethod_2, /* Generated */ VALUE_HANDLE_OUT(outBegIdx1), VALUE_HANDLE_OUT(outNbElement1), /* Generated */ outReal ); diff --git a/src/ta_func/ta_AROON.c b/src/ta_func/ta_AROON.c index 0c3c5894d..a8e2c30c9 100644 --- a/src/ta_func/ta_AROON.c +++ b/src/ta_func/ta_AROON.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -239,7 +239,7 @@ lowest = 0.0; highest = 0.0; factor = (double)100.0/(double)optInTimePeriod; - + while( today <= endIdx ) { /* Keep track of the lowestIdx */ @@ -296,7 +296,7 @@ outIdx++; trailingIdx++; - today++; + today++; } /* Keep the outBegIdx relative to the @@ -446,7 +446,7 @@ /* Generated */ outAroonDown[outIdx] = factor*(optInTimePeriod-(today-lowestIdx)); /* Generated */ outIdx++; /* Generated */ trailingIdx++; -/* Generated */ today++; +/* Generated */ today++; /* Generated */ } /* Generated */ VALUE_HANDLE_DEREF(outBegIdx) = startIdx; /* Generated */ VALUE_HANDLE_DEREF(outNBElement) = outIdx; diff --git a/src/ta_func/ta_AROONOSC.c b/src/ta_func/ta_AROONOSC.c index 539e4beb9..77e562140 100644 --- a/src/ta_func/ta_AROONOSC.c +++ b/src/ta_func/ta_AROONOSC.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -241,7 +241,7 @@ lowest = 0.0; highest = 0.0; factor = (double)100.0/(double)optInTimePeriod; - + while( today <= endIdx ) { /* Keep track of the lowestIdx */ @@ -307,7 +307,7 @@ outIdx++; trailingIdx++; - today++; + today++; } /* Keep the outBegIdx relative to the @@ -451,7 +451,7 @@ /* Generated */ outReal[outIdx] = aroon; /* Generated */ outIdx++; /* Generated */ trailingIdx++; -/* Generated */ today++; +/* Generated */ today++; /* Generated */ } /* Generated */ VALUE_HANDLE_DEREF(outBegIdx) = startIdx; /* Generated */ VALUE_HANDLE_DEREF(outNBElement) = outIdx; diff --git a/src/ta_func/ta_ASIN.c b/src/ta_func/ta_ASIN.c index df5816d53..d57fc609a 100644 --- a/src/ta_func/ta_ASIN.c +++ b/src/ta_func/ta_ASIN.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_ATAN.c b/src/ta_func/ta_ATAN.c index d62df62fb..a58e581a6 100644 --- a/src/ta_func/ta_ATAN.c +++ b/src/ta_func/ta_ATAN.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -170,7 +170,7 @@ for( i=startIdx, outIdx=0; i <= endIdx; i++, outIdx++ ) { outReal[outIdx] = std_atan(inReal[i]); - } + } VALUE_HANDLE_DEREF(outNBElement) = outIdx; VALUE_HANDLE_DEREF(outBegIdx) = startIdx; @@ -235,7 +235,7 @@ /* Generated */ for( i=startIdx, outIdx=0; i <= endIdx; i++, outIdx++ ) /* Generated */ { /* Generated */ outReal[outIdx] = std_atan(inReal[i]); -/* Generated */ } +/* Generated */ } /* Generated */ VALUE_HANDLE_DEREF(outNBElement) = outIdx; /* Generated */ VALUE_HANDLE_DEREF(outBegIdx) = startIdx; /* Generated */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success); diff --git a/src/ta_func/ta_ATR.c b/src/ta_func/ta_ATR.c index cc9c9ad45..5043d20cb 100644 --- a/src/ta_func/ta_ATR.c +++ b/src/ta_func/ta_ATR.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -215,11 +215,11 @@ /* Generated */ /**** END GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/ - /* Average True Range is the greatest of the following: + /* Average True Range is the greatest of the following: * * val1 = distance from today's high to today's low. * val2 = distance from yesterday's close to today's high. - * val3 = distance from yesterday's close to today's low. + * val3 = distance from yesterday's close to today's low. * * These value are averaged for the specified period using * Wilder method. This method have an unstable period comparable @@ -274,14 +274,14 @@ if( retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) { ARRAY_FREE( tempBuffer ); - return retCode; + return retCode; } prevATR = prevATRTemp[0]; /* Subsequent value are smoothed using the * previous ATR value (Wilder's approach). - * 1) Multiply the previous ATR by 'period-1'. - * 2) Add today TR value. + * 1) Multiply the previous ATR by 'period-1'. + * 2) Add today TR value. * 3) Divide by 'period'. */ today = optInTimePeriod; @@ -295,7 +295,7 @@ outIdx--; } - /* Now start to write the final ATR in the caller + /* Now start to write the final ATR in the caller * provided outReal. */ outIdx = 1; @@ -314,9 +314,9 @@ VALUE_HANDLE_DEREF(outBegIdx) = startIdx; VALUE_HANDLE_DEREF(outNBElement) = outIdx; - + ARRAY_FREE( tempBuffer ); - + return retCode; } @@ -428,7 +428,7 @@ /* Generated */ if( retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) /* Generated */ { /* Generated */ ARRAY_FREE( tempBuffer ); -/* Generated */ return retCode; +/* Generated */ return retCode; /* Generated */ } /* Generated */ prevATR = prevATRTemp[0]; /* Generated */ today = optInTimePeriod; diff --git a/src/ta_func/ta_AVGDEV.c b/src/ta_func/ta_AVGDEV.c index 37eee0c89..5a84d42aa 100644 --- a/src/ta_func/ta_AVGDEV.c +++ b/src/ta_func/ta_AVGDEV.c @@ -1,50 +1,50 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * - Neither name of author nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* List of contributors: - * - * Initial Name/description - * ------------------------------------------------------------------- - * AB Anatoliy Belsky - * - * Change history: - * - * MMDDYY BY Description - * ------------------------------------------------------------------- - * 090812 AB Initial Version - */ - -/**** START GENCODE SECTION 1 - DO NOT DELETE THIS LINE ****/ +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * - Neither name of author nor the names of its contributors + * may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* List of contributors: + * + * Initial Name/description + * ------------------------------------------------------------------- + * AB Anatoliy Belsky + * + * Change history: + * + * MMDDYY BY Description + * ------------------------------------------------------------------- + * 090812 AB Initial Version + */ + +/**** START GENCODE SECTION 1 - DO NOT DELETE THIS LINE ****/ /* All code within this section is automatically * generated by gen_code. Any modification will be lost * next time gen_code is run. @@ -85,11 +85,11 @@ /* Generated */ TA_LIB_API int TA_AVGDEV_Lookback( int optInTimePeriod ) /* From 2 to 100000 */ /* Generated */ /* Generated */ #endif -/**** END GENCODE SECTION 1 - DO NOT DELETE THIS LINE ****/ -{ - /* insert local variable here */ - -/**** START GENCODE SECTION 2 - DO NOT DELETE THIS LINE ****/ +/**** END GENCODE SECTION 1 - DO NOT DELETE THIS LINE ****/ +{ + /* insert local variable here */ + +/**** START GENCODE SECTION 2 - DO NOT DELETE THIS LINE ****/ /* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK /* Generated */ /* min/max are checked for optInTimePeriod. */ /* Generated */ if( (int)optInTimePeriod == TA_INTEGER_DEFAULT ) @@ -98,14 +98,14 @@ /* Generated */ return -1; /* Generated */ /* Generated */ #endif /* TA_FUNC_NO_RANGE_CHECK */ -/**** END GENCODE SECTION 2 - DO NOT DELETE THIS LINE ****/ - - /* insert lookback code here. */ - - return optInTimePeriod-1; -} - -/**** START GENCODE SECTION 3 - DO NOT DELETE THIS LINE ****/ +/**** END GENCODE SECTION 2 - DO NOT DELETE THIS LINE ****/ + + /* insert lookback code here. */ + + return optInTimePeriod-1; +} + +/**** START GENCODE SECTION 3 - DO NOT DELETE THIS LINE ****/ /* * TA_AVGDEV - Average Deviation * @@ -153,12 +153,12 @@ /* Generated */ int *outNBElement, /* Generated */ double outReal[] ) /* Generated */ #endif -/**** END GENCODE SECTION 3 - DO NOT DELETE THIS LINE ****/ -{ - /* insert local variable here */ - int today, outIdx, lookback; - -/**** START GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/ +/**** END GENCODE SECTION 3 - DO NOT DELETE THIS LINE ****/ +{ + /* insert local variable here */ + int today, outIdx, lookback; + +/**** START GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/ /* Generated */ /* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK /* Generated */ @@ -184,52 +184,52 @@ /* Generated */ #endif /* !defined(_JAVA) */ /* Generated */ #endif /* TA_FUNC_NO_RANGE_CHECK */ /* Generated */ -/**** END GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/ - - lookback = optInTimePeriod - 1; - - if (startIdx < lookback) { - startIdx = lookback; - } - today = startIdx; - - /* Make sure there is still something to evaluate. */ - if( today > endIdx ) { - VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); - VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); - return ENUM_VALUE(RetCode,TA_SUCCESS,Success); - } - - /* Process the initial DM and TR */ - VALUE_HANDLE_DEREF(outBegIdx) = today; - - outIdx = 0; - - while (today <= endIdx) { - double todaySum, todayDev; - int i; - - todaySum = 0.0; - for (i = 0; i < optInTimePeriod; i++) { - todaySum += inReal[today-i]; - } - - todayDev = 0.0; - for (i = 0; i < optInTimePeriod; i++) { - todayDev += std_fabs(inReal[today-i] - todaySum/optInTimePeriod); - } - outReal[outIdx] = todayDev/optInTimePeriod; - - outIdx++; - today++; - } - - VALUE_HANDLE_DEREF(outNBElement) = outIdx; - - return ENUM_VALUE(RetCode,TA_SUCCESS,Success); -} - -/**** START GENCODE SECTION 5 - DO NOT DELETE THIS LINE ****/ +/**** END GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/ + + lookback = optInTimePeriod - 1; + + if (startIdx < lookback) { + startIdx = lookback; + } + today = startIdx; + + /* Make sure there is still something to evaluate. */ + if( today > endIdx ) { + VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); + VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); + return ENUM_VALUE(RetCode,TA_SUCCESS,Success); + } + + /* Process the initial DM and TR */ + VALUE_HANDLE_DEREF(outBegIdx) = today; + + outIdx = 0; + + while (today <= endIdx) { + double todaySum, todayDev; + int i; + + todaySum = 0.0; + for (i = 0; i < optInTimePeriod; i++) { + todaySum += inReal[today-i]; + } + + todayDev = 0.0; + for (i = 0; i < optInTimePeriod; i++) { + todayDev += std_fabs(inReal[today-i] - todaySum/optInTimePeriod); + } + outReal[outIdx] = todayDev/optInTimePeriod; + + outIdx++; + today++; + } + + VALUE_HANDLE_DEREF(outNBElement) = outIdx; + + return ENUM_VALUE(RetCode,TA_SUCCESS,Success); +} + +/**** START GENCODE SECTION 5 - DO NOT DELETE THIS LINE ****/ /* Generated */ /* Generated */ #define USE_SINGLE_PRECISION_INPUT /* Generated */ #if !defined( _MANAGED ) && !defined( _JAVA ) @@ -271,8 +271,8 @@ /* Generated */ int *outNBElement, /* Generated */ double outReal[] ) /* Generated */ #endif -/* Generated */ { -/* Generated */ int today, outIdx, lookback; +/* Generated */ { +/* Generated */ int today, outIdx, lookback; /* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK /* Generated */ if( startIdx < 0 ) /* Generated */ return ENUM_VALUE(RetCode,TA_OUT_OF_RANGE_START_INDEX,OutOfRangeStartIndex); @@ -290,39 +290,39 @@ /* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam); /* Generated */ #endif /* Generated */ #endif -/* Generated */ lookback = optInTimePeriod - 1; -/* Generated */ if (startIdx < lookback) { -/* Generated */ startIdx = lookback; -/* Generated */ } -/* Generated */ today = startIdx; -/* Generated */ if( today > endIdx ) { -/* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); -/* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); -/* Generated */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success); -/* Generated */ } -/* Generated */ VALUE_HANDLE_DEREF(outBegIdx) = today; -/* Generated */ outIdx = 0; -/* Generated */ while (today <= endIdx) { -/* Generated */ double todaySum, todayDev; -/* Generated */ int i; -/* Generated */ todaySum = 0.0; -/* Generated */ for (i = 0; i < optInTimePeriod; i++) { -/* Generated */ todaySum += inReal[today-i]; -/* Generated */ } -/* Generated */ todayDev = 0.0; -/* Generated */ for (i = 0; i < optInTimePeriod; i++) { -/* Generated */ todayDev += std_fabs(inReal[today-i] - todaySum/optInTimePeriod); -/* Generated */ } -/* Generated */ outReal[outIdx] = todayDev/optInTimePeriod; -/* Generated */ outIdx++; -/* Generated */ today++; -/* Generated */ } -/* Generated */ VALUE_HANDLE_DEREF(outNBElement) = outIdx; -/* Generated */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success); -/* Generated */ } +/* Generated */ lookback = optInTimePeriod - 1; +/* Generated */ if (startIdx < lookback) { +/* Generated */ startIdx = lookback; +/* Generated */ } +/* Generated */ today = startIdx; +/* Generated */ if( today > endIdx ) { +/* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); +/* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); +/* Generated */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success); +/* Generated */ } +/* Generated */ VALUE_HANDLE_DEREF(outBegIdx) = today; +/* Generated */ outIdx = 0; +/* Generated */ while (today <= endIdx) { +/* Generated */ double todaySum, todayDev; +/* Generated */ int i; +/* Generated */ todaySum = 0.0; +/* Generated */ for (i = 0; i < optInTimePeriod; i++) { +/* Generated */ todaySum += inReal[today-i]; +/* Generated */ } +/* Generated */ todayDev = 0.0; +/* Generated */ for (i = 0; i < optInTimePeriod; i++) { +/* Generated */ todayDev += std_fabs(inReal[today-i] - todaySum/optInTimePeriod); +/* Generated */ } +/* Generated */ outReal[outIdx] = todayDev/optInTimePeriod; +/* Generated */ outIdx++; +/* Generated */ today++; +/* Generated */ } +/* Generated */ VALUE_HANDLE_DEREF(outNBElement) = outIdx; +/* Generated */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success); +/* Generated */ } /* Generated */ /* Generated */ #if defined( _MANAGED ) /* Generated */ }}} // Close namespace TicTacTec.TA.Lib /* Generated */ #endif -/**** END GENCODE SECTION 5 - DO NOT DELETE THIS LINE ****/ - +/**** END GENCODE SECTION 5 - DO NOT DELETE THIS LINE ****/ + diff --git a/src/ta_func/ta_AVGPRICE.c b/src/ta_func/ta_AVGPRICE.c index e2d11aa2d..69a321c29 100644 --- a/src/ta_func/ta_AVGPRICE.c +++ b/src/ta_func/ta_AVGPRICE.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_BBANDS.c b/src/ta_func/ta_BBANDS.c index 568d0df49..ee73bab2b 100644 --- a/src/ta_func/ta_BBANDS.c +++ b/src/ta_func/ta_BBANDS.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -133,7 +133,7 @@ UNUSED_VARIABLE(optInNbDevDn); /* The lookback is driven by the middle band moving average. */ - return LOOKBACK_CALL(MA)( optInTimePeriod, optInMAType ); + return LOOKBACK_CALL(MA)( optInTimePeriod, optInMAType ); } /**** START GENCODE SECTION 3 - DO NOT DELETE THIS LINE ****/ @@ -307,7 +307,7 @@ tempBuffer1 = outRealMiddleBand; tempBuffer2 = outRealUpperBand; } - /* Check that the caller is not doing tricky things. + /* Check that the caller is not doing tricky things. * (like using the input buffer in two output!) */ if( (tempBuffer1 == inReal) || (tempBuffer2 == inReal) ) @@ -335,7 +335,7 @@ /* A small speed optimization by re-using the * already calculated SMA. */ - FUNCTION_CALL(INT_stddev_using_precalc_ma)( inReal, tempBuffer1, + FUNCTION_CALL(INT_stddev_using_precalc_ma)( inReal, tempBuffer1, (int)VALUE_HANDLE_DEREF(outBegIdx), (int)VALUE_HANDLE_DEREF(outNBElement), optInTimePeriod, tempBuffer2 ); } @@ -364,7 +364,7 @@ #endif /* Now do a tight loop to calculate the upper/lower band at - * the same time. + * the same time. * * All the following 5 loops are doing the same, except there * is an attempt to speed optimize by eliminating uneeded @@ -428,7 +428,7 @@ outRealLowerBand[i] = tempReal2 - (tempReal * optInNbDevDn); } } - + return ENUM_VALUE(RetCode,TA_SUCCESS,Success); } @@ -572,7 +572,7 @@ /* Generated */ } /* Generated */ if( optInMAType == ENUM_VALUE(MAType,TA_MAType_SMA,Sma) ) /* Generated */ { -/* Generated */ FUNCTION_CALL(INT_stddev_using_precalc_ma)( inReal, tempBuffer1, +/* Generated */ FUNCTION_CALL(INT_stddev_using_precalc_ma)( inReal, tempBuffer1, /* Generated */ (int)VALUE_HANDLE_DEREF(outBegIdx), (int)VALUE_HANDLE_DEREF(outNBElement), /* Generated */ optInTimePeriod, tempBuffer2 ); /* Generated */ } diff --git a/src/ta_func/ta_BETA.c b/src/ta_func/ta_BETA.c index f16a8f685..38f571081 100644 --- a/src/ta_func/ta_BETA.c +++ b/src/ta_func/ta_BETA.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -234,7 +234,7 @@ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); return ENUM_VALUE(RetCode,TA_SUCCESS,Success); - } + } /* Consume first input. */ trailingIdx = startIdx-nbInitialElementNeeded; @@ -263,9 +263,9 @@ S_xx += x*x; S_xy += x*y; S_x += x; - S_y += y; + S_y += y; } - + outIdx = 0; /* First output always start at index zero */ n = (double)optInTimePeriod; @@ -318,7 +318,7 @@ S_xx -= x*x; S_xy -= x*y; S_x -= x; - S_y -= y; + S_y -= y; } while( i <= endIdx ); /* All done. Indicate the output limits and return. */ @@ -415,7 +415,7 @@ /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); /* Generated */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success); -/* Generated */ } +/* Generated */ } /* Generated */ trailingIdx = startIdx-nbInitialElementNeeded; /* Generated */ last_price_x = trailing_last_price_x = inReal0[trailingIdx]; /* Generated */ last_price_y = trailing_last_price_y = inReal1[trailingIdx]; @@ -437,7 +437,7 @@ /* Generated */ S_xx += x*x; /* Generated */ S_xy += x*y; /* Generated */ S_x += x; -/* Generated */ S_y += y; +/* Generated */ S_y += y; /* Generated */ } /* Generated */ outIdx = 0; /* Generated */ n = (double)optInTimePeriod; @@ -479,7 +479,7 @@ /* Generated */ S_xx -= x*x; /* Generated */ S_xy -= x*y; /* Generated */ S_x -= x; -/* Generated */ S_y -= y; +/* Generated */ S_y -= y; /* Generated */ } while( i <= endIdx ); /* Generated */ VALUE_HANDLE_DEREF(outNBElement) = outIdx; /* Generated */ VALUE_HANDLE_DEREF(outBegIdx) = startIdx; diff --git a/src/ta_func/ta_BOP.c b/src/ta_func/ta_BOP.c index ce613474d..367dfa5ff 100644 --- a/src/ta_func/ta_BOP.c +++ b/src/ta_func/ta_BOP.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CCI.c b/src/ta_func/ta_CCI.c index dcb282d47..b3bbd081e 100644 --- a/src/ta_func/ta_CCI.c +++ b/src/ta_func/ta_CCI.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -209,7 +209,7 @@ /**** END GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/ /* Insert TA function code here. */ - + /* Identify the minimum number of price bar needed * to calculate at least one output. */ @@ -233,10 +233,10 @@ * period. */ CIRCBUF_INIT( circBuffer, double, optInTimePeriod ); - + /* Do the MA calculation using tight loops. */ - /* Add-up the initial period, except for the last value. + /* Add-up the initial period, except for the last value. * Fill up the circular buffer at the same time. */ i=startIdx-lookbackTotal; @@ -282,7 +282,7 @@ } else outReal[outIdx++] = 0.0; - + /* Move forward the circular buffer indexes. */ CIRCBUF_NEXT(circBuffer); diff --git a/src/ta_func/ta_CDL2CROWS.c b/src/ta_func/ta_CDL2CROWS.c index f0b45a256..aad56fafb 100644 --- a/src/ta_func/ta_CDL2CROWS.c +++ b/src/ta_func/ta_CDL2CROWS.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDL3BLACKCROWS.c b/src/ta_func/ta_CDL3BLACKCROWS.c index c7e02e956..b9ae5b6e8 100644 --- a/src/ta_func/ta_CDL3BLACKCROWS.c +++ b/src/ta_func/ta_CDL3BLACKCROWS.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDL3INSIDE.c b/src/ta_func/ta_CDL3INSIDE.c index 89c5dc01d..8c38497a3 100644 --- a/src/ta_func/ta_CDL3INSIDE.c +++ b/src/ta_func/ta_CDL3INSIDE.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDL3LINESTRIKE.c b/src/ta_func/ta_CDL3LINESTRIKE.c index 66df46774..b8d04ff9f 100644 --- a/src/ta_func/ta_CDL3LINESTRIKE.c +++ b/src/ta_func/ta_CDL3LINESTRIKE.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDL3OUTSIDE.c b/src/ta_func/ta_CDL3OUTSIDE.c index dcc28c534..63841c0f7 100644 --- a/src/ta_func/ta_CDL3OUTSIDE.c +++ b/src/ta_func/ta_CDL3OUTSIDE.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDL3STARSINSOUTH.c b/src/ta_func/ta_CDL3STARSINSOUTH.c index 3c93be897..0e3e95f52 100644 --- a/src/ta_func/ta_CDL3STARSINSOUTH.c +++ b/src/ta_func/ta_CDL3STARSINSOUTH.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDL3WHITESOLDIERS.c b/src/ta_func/ta_CDL3WHITESOLDIERS.c index 55b9a2abf..6027da7c9 100644 --- a/src/ta_func/ta_CDL3WHITESOLDIERS.c +++ b/src/ta_func/ta_CDL3WHITESOLDIERS.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLABANDONEDBABY.c b/src/ta_func/ta_CDLABANDONEDBABY.c index 979d7d150..7100de62a 100644 --- a/src/ta_func/ta_CDLABANDONEDBABY.c +++ b/src/ta_func/ta_CDLABANDONEDBABY.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLADVANCEBLOCK.c b/src/ta_func/ta_CDLADVANCEBLOCK.c index f0cbf717f..2247e1ce1 100644 --- a/src/ta_func/ta_CDLADVANCEBLOCK.c +++ b/src/ta_func/ta_CDLADVANCEBLOCK.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLBELTHOLD.c b/src/ta_func/ta_CDLBELTHOLD.c index 1e7abad01..f251de5d5 100644 --- a/src/ta_func/ta_CDLBELTHOLD.c +++ b/src/ta_func/ta_CDLBELTHOLD.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -42,7 +42,7 @@ * * MMDDYY BY Description * ------------------------------------------------------------------- - * 010605 AC Creation + * 010605 AC Creation * */ @@ -206,7 +206,7 @@ BodyLongTrailingIdx = startIdx - TA_CANDLEAVGPERIOD(BodyLong); ShadowVeryShortPeriodTotal = 0; ShadowVeryShortTrailingIdx = startIdx - TA_CANDLEAVGPERIOD(ShadowVeryShort); - + i = BodyLongTrailingIdx; while( i < startIdx ) { BodyLongPeriodTotal += TA_CANDLERANGE( BodyLong, i ); @@ -229,26 +229,26 @@ do { if( TA_REALBODY(i) > TA_CANDLEAVERAGE( BodyLong, BodyLongPeriodTotal, i ) && // long body - ( + ( ( // white body and very short lower shadow - TA_CANDLECOLOR(i) == 1 && - TA_LOWERSHADOW(i) < TA_CANDLEAVERAGE( ShadowVeryShort, ShadowVeryShortPeriodTotal, i ) + TA_CANDLECOLOR(i) == 1 && + TA_LOWERSHADOW(i) < TA_CANDLEAVERAGE( ShadowVeryShort, ShadowVeryShortPeriodTotal, i ) ) || ( // black body and very short upper shadow - TA_CANDLECOLOR(i) == -1 && + TA_CANDLECOLOR(i) == -1 && TA_UPPERSHADOW(i) < TA_CANDLEAVERAGE( ShadowVeryShort, ShadowVeryShortPeriodTotal, i ) - ) + ) ) ) outInteger[outIdx++] = TA_CANDLECOLOR(i) * 100; else outInteger[outIdx++] = 0; - /* add the current range and subtract the first range: this is done after the pattern recognition + /* add the current range and subtract the first range: this is done after the pattern recognition * when avgPeriod is not 0, that means "compare with the previous candles" (it excludes the current candle) */ BodyLongPeriodTotal += TA_CANDLERANGE( BodyLong, i ) - TA_CANDLERANGE( BodyLong, BodyLongTrailingIdx ); - ShadowVeryShortPeriodTotal += TA_CANDLERANGE( ShadowVeryShort, i ) + ShadowVeryShortPeriodTotal += TA_CANDLERANGE( ShadowVeryShort, i ) - TA_CANDLERANGE( ShadowVeryShort, ShadowVeryShortTrailingIdx ); - i++; + i++; BodyLongTrailingIdx++; ShadowVeryShortTrailingIdx++; } while( i <= endIdx ); @@ -354,23 +354,23 @@ /* Generated */ do /* Generated */ { /* Generated */ if( TA_REALBODY(i) > TA_CANDLEAVERAGE( BodyLong, BodyLongPeriodTotal, i ) && // long body -/* Generated */ ( +/* Generated */ ( /* Generated */ ( // white body and very short lower shadow -/* Generated */ TA_CANDLECOLOR(i) == 1 && -/* Generated */ TA_LOWERSHADOW(i) < TA_CANDLEAVERAGE( ShadowVeryShort, ShadowVeryShortPeriodTotal, i ) +/* Generated */ TA_CANDLECOLOR(i) == 1 && +/* Generated */ TA_LOWERSHADOW(i) < TA_CANDLEAVERAGE( ShadowVeryShort, ShadowVeryShortPeriodTotal, i ) /* Generated */ ) || /* Generated */ ( // black body and very short upper shadow -/* Generated */ TA_CANDLECOLOR(i) == -1 && +/* Generated */ TA_CANDLECOLOR(i) == -1 && /* Generated */ TA_UPPERSHADOW(i) < TA_CANDLEAVERAGE( ShadowVeryShort, ShadowVeryShortPeriodTotal, i ) -/* Generated */ ) +/* Generated */ ) /* Generated */ ) ) /* Generated */ outInteger[outIdx++] = TA_CANDLECOLOR(i) * 100; /* Generated */ else /* Generated */ outInteger[outIdx++] = 0; /* Generated */ BodyLongPeriodTotal += TA_CANDLERANGE( BodyLong, i ) - TA_CANDLERANGE( BodyLong, BodyLongTrailingIdx ); -/* Generated */ ShadowVeryShortPeriodTotal += TA_CANDLERANGE( ShadowVeryShort, i ) +/* Generated */ ShadowVeryShortPeriodTotal += TA_CANDLERANGE( ShadowVeryShort, i ) /* Generated */ - TA_CANDLERANGE( ShadowVeryShort, ShadowVeryShortTrailingIdx ); -/* Generated */ i++; +/* Generated */ i++; /* Generated */ BodyLongTrailingIdx++; /* Generated */ ShadowVeryShortTrailingIdx++; /* Generated */ } while( i <= endIdx ); diff --git a/src/ta_func/ta_CDLBREAKAWAY.c b/src/ta_func/ta_CDLBREAKAWAY.c index 76c8c2388..e70299160 100644 --- a/src/ta_func/ta_CDLBREAKAWAY.c +++ b/src/ta_func/ta_CDLBREAKAWAY.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLCLOSINGMARUBOZU.c b/src/ta_func/ta_CDLCLOSINGMARUBOZU.c index 0b9ea4897..4edcddbf3 100644 --- a/src/ta_func/ta_CDLCLOSINGMARUBOZU.c +++ b/src/ta_func/ta_CDLCLOSINGMARUBOZU.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLCONCEALBABYSWALL.c b/src/ta_func/ta_CDLCONCEALBABYSWALL.c index d8766f251..56185ebec 100644 --- a/src/ta_func/ta_CDLCONCEALBABYSWALL.c +++ b/src/ta_func/ta_CDLCONCEALBABYSWALL.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLCOUNTERATTACK.c b/src/ta_func/ta_CDLCOUNTERATTACK.c index 7ff929203..8dbeeda4e 100644 --- a/src/ta_func/ta_CDLCOUNTERATTACK.c +++ b/src/ta_func/ta_CDLCOUNTERATTACK.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLDARKCLOUDCOVER.c b/src/ta_func/ta_CDLDARKCLOUDCOVER.c index 5efae8709..75727fc68 100644 --- a/src/ta_func/ta_CDLDARKCLOUDCOVER.c +++ b/src/ta_func/ta_CDLDARKCLOUDCOVER.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLDOJI.c b/src/ta_func/ta_CDLDOJI.c index 80d96dffd..a190f3840 100644 --- a/src/ta_func/ta_CDLDOJI.c +++ b/src/ta_func/ta_CDLDOJI.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLDOJISTAR.c b/src/ta_func/ta_CDLDOJISTAR.c index 7dbf455ac..266855701 100644 --- a/src/ta_func/ta_CDLDOJISTAR.c +++ b/src/ta_func/ta_CDLDOJISTAR.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLDRAGONFLYDOJI.c b/src/ta_func/ta_CDLDRAGONFLYDOJI.c index 67b7e1a01..9effea37c 100644 --- a/src/ta_func/ta_CDLDRAGONFLYDOJI.c +++ b/src/ta_func/ta_CDLDRAGONFLYDOJI.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLENGULFING.c b/src/ta_func/ta_CDLENGULFING.c index 19476b3bf..ed0f97b2e 100644 --- a/src/ta_func/ta_CDLENGULFING.c +++ b/src/ta_func/ta_CDLENGULFING.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLEVENINGDOJISTAR.c b/src/ta_func/ta_CDLEVENINGDOJISTAR.c index f5984fe99..917ba2899 100644 --- a/src/ta_func/ta_CDLEVENINGDOJISTAR.c +++ b/src/ta_func/ta_CDLEVENINGDOJISTAR.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLEVENINGSTAR.c b/src/ta_func/ta_CDLEVENINGSTAR.c index 9d011e0d5..b19dd71c2 100644 --- a/src/ta_func/ta_CDLEVENINGSTAR.c +++ b/src/ta_func/ta_CDLEVENINGSTAR.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLGAPSIDESIDEWHITE.c b/src/ta_func/ta_CDLGAPSIDESIDEWHITE.c index a1343fb0c..bc1c1d80f 100644 --- a/src/ta_func/ta_CDLGAPSIDESIDEWHITE.c +++ b/src/ta_func/ta_CDLGAPSIDESIDEWHITE.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -42,7 +42,7 @@ * * MMDDYY BY Description * ------------------------------------------------------------------- - * 020605 AC Creation + * 020605 AC Creation * */ @@ -206,7 +206,7 @@ EqualPeriodTotal = 0; NearTrailingIdx = startIdx - TA_CANDLEAVGPERIOD(Near); EqualTrailingIdx = startIdx - TA_CANDLEAVGPERIOD(Equal); - + i = NearTrailingIdx; while( i < startIdx ) { NearPeriodTotal += TA_CANDLERANGE( Near, i-1 ); @@ -223,18 +223,18 @@ * Must have: * - upside or downside gap (between the bodies) * - first candle after the window: white candlestick - * - second candle after the window: white candlestick with similar size (near the same) and about the same + * - second candle after the window: white candlestick with similar size (near the same) and about the same * open (equal) of the previous candle * - the second candle does not close the window * The meaning of "near" and "equal" is specified with TA_SetCandleSettings - * outInteger is positive (1 to 100) or negative (-1 to -100): the user should consider that upside - * or downside gap side-by-side white lines is significant when it appears in a trend, while this function + * outInteger is positive (1 to 100) or negative (-1 to -100): the user should consider that upside + * or downside gap side-by-side white lines is significant when it appears in a trend, while this function * does not consider the trend */ outIdx = 0; do { - if( + if( ( // upside or downside gap between the 1st candle and both the next 2 candles ( TA_REALBODYGAPUP(i-1,i-2) && TA_REALBODYGAPUP(i,i-2) ) || @@ -250,12 +250,12 @@ outInteger[outIdx++] = ( TA_REALBODYGAPUP(i-1,i-2) ? 100 : -100 ); else outInteger[outIdx++] = 0; - /* add the current range and subtract the first range: this is done after the pattern recognition + /* add the current range and subtract the first range: this is done after the pattern recognition * when avgPeriod is not 0, that means "compare with the previous candles" (it excludes the current candle) */ NearPeriodTotal += TA_CANDLERANGE( Near, i-1 ) - TA_CANDLERANGE( Near, NearTrailingIdx-1 ); EqualPeriodTotal += TA_CANDLERANGE( Equal, i-1 ) - TA_CANDLERANGE( Equal, EqualTrailingIdx-1 ); - i++; + i++; NearTrailingIdx++; EqualTrailingIdx++; } while( i <= endIdx ); @@ -361,7 +361,7 @@ /* Generated */ outIdx = 0; /* Generated */ do /* Generated */ { -/* Generated */ if( +/* Generated */ if( /* Generated */ ( // upside or downside gap between the 1st candle and both the next 2 candles /* Generated */ ( TA_REALBODYGAPUP(i-1,i-2) && TA_REALBODYGAPUP(i,i-2) ) /* Generated */ || @@ -379,7 +379,7 @@ /* Generated */ outInteger[outIdx++] = 0; /* Generated */ NearPeriodTotal += TA_CANDLERANGE( Near, i-1 ) - TA_CANDLERANGE( Near, NearTrailingIdx-1 ); /* Generated */ EqualPeriodTotal += TA_CANDLERANGE( Equal, i-1 ) - TA_CANDLERANGE( Equal, EqualTrailingIdx-1 ); -/* Generated */ i++; +/* Generated */ i++; /* Generated */ NearTrailingIdx++; /* Generated */ EqualTrailingIdx++; /* Generated */ } while( i <= endIdx ); diff --git a/src/ta_func/ta_CDLGRAVESTONEDOJI.c b/src/ta_func/ta_CDLGRAVESTONEDOJI.c index ccf15b4a9..8908dfe5e 100644 --- a/src/ta_func/ta_CDLGRAVESTONEDOJI.c +++ b/src/ta_func/ta_CDLGRAVESTONEDOJI.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -42,7 +42,7 @@ * * MMDDYY BY Description * ------------------------------------------------------------------- - * 011505 AC Creation + * 011505 AC Creation * */ @@ -206,7 +206,7 @@ BodyDojiTrailingIdx = startIdx - TA_CANDLEAVGPERIOD(BodyDoji); ShadowVeryShortPeriodTotal = 0; ShadowVeryShortTrailingIdx = startIdx - TA_CANDLEAVGPERIOD(ShadowVeryShort); - + i = BodyDojiTrailingIdx; while( i < startIdx ) { BodyDojiPeriodTotal += TA_CANDLERANGE( BodyDoji, i ); @@ -238,13 +238,13 @@ outInteger[outIdx++] = 100; else outInteger[outIdx++] = 0; - /* add the current range and subtract the first range: this is done after the pattern recognition + /* add the current range and subtract the first range: this is done after the pattern recognition * when avgPeriod is not 0, that means "compare with the previous candles" (it excludes the current candle) */ BodyDojiPeriodTotal += TA_CANDLERANGE( BodyDoji, i ) - TA_CANDLERANGE( BodyDoji, BodyDojiTrailingIdx ); - ShadowVeryShortPeriodTotal += TA_CANDLERANGE( ShadowVeryShort, i ) + ShadowVeryShortPeriodTotal += TA_CANDLERANGE( ShadowVeryShort, i ) - TA_CANDLERANGE( ShadowVeryShort, ShadowVeryShortTrailingIdx ); - i++; + i++; BodyDojiTrailingIdx++; ShadowVeryShortTrailingIdx++; } while( i <= endIdx ); @@ -357,9 +357,9 @@ /* Generated */ else /* Generated */ outInteger[outIdx++] = 0; /* Generated */ BodyDojiPeriodTotal += TA_CANDLERANGE( BodyDoji, i ) - TA_CANDLERANGE( BodyDoji, BodyDojiTrailingIdx ); -/* Generated */ ShadowVeryShortPeriodTotal += TA_CANDLERANGE( ShadowVeryShort, i ) +/* Generated */ ShadowVeryShortPeriodTotal += TA_CANDLERANGE( ShadowVeryShort, i ) /* Generated */ - TA_CANDLERANGE( ShadowVeryShort, ShadowVeryShortTrailingIdx ); -/* Generated */ i++; +/* Generated */ i++; /* Generated */ BodyDojiTrailingIdx++; /* Generated */ ShadowVeryShortTrailingIdx++; /* Generated */ } while( i <= endIdx ); diff --git a/src/ta_func/ta_CDLHAMMER.c b/src/ta_func/ta_CDLHAMMER.c index 9f5a652e3..906ea2db9 100644 --- a/src/ta_func/ta_CDLHAMMER.c +++ b/src/ta_func/ta_CDLHAMMER.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -42,7 +42,7 @@ * * MMDDYY BY Description * ------------------------------------------------------------------- - * 102304 AC Creation + * 102304 AC Creation * */ @@ -97,7 +97,7 @@ /* insert lookback code here. */ return max( max( max( TA_CANDLEAVGPERIOD(BodyShort), TA_CANDLEAVGPERIOD(ShadowLong) ), - TA_CANDLEAVGPERIOD(ShadowVeryShort) ), + TA_CANDLEAVGPERIOD(ShadowVeryShort) ), TA_CANDLEAVGPERIOD(Near) ) + 1; } @@ -213,7 +213,7 @@ ShadowVeryShortTrailingIdx = startIdx - TA_CANDLEAVGPERIOD(ShadowVeryShort); NearPeriodTotal = 0; NearTrailingIdx = startIdx -1 - TA_CANDLEAVGPERIOD(Near); - + i = BodyTrailingIdx; while( i < startIdx ) { BodyPeriodTotal += TA_CANDLERANGE( BodyShort, i ); @@ -257,18 +257,18 @@ outInteger[outIdx++] = 100; else outInteger[outIdx++] = 0; - /* add the current range and subtract the first range: this is done after the pattern recognition + /* add the current range and subtract the first range: this is done after the pattern recognition * when avgPeriod is not 0, that means "compare with the previous candles" (it excludes the current candle) */ - BodyPeriodTotal += TA_CANDLERANGE( BodyShort, i ) + BodyPeriodTotal += TA_CANDLERANGE( BodyShort, i ) - TA_CANDLERANGE( BodyShort, BodyTrailingIdx ); - ShadowLongPeriodTotal += TA_CANDLERANGE( ShadowLong, i ) + ShadowLongPeriodTotal += TA_CANDLERANGE( ShadowLong, i ) - TA_CANDLERANGE( ShadowLong, ShadowLongTrailingIdx ); - ShadowVeryShortPeriodTotal += TA_CANDLERANGE( ShadowVeryShort, i ) + ShadowVeryShortPeriodTotal += TA_CANDLERANGE( ShadowVeryShort, i ) - TA_CANDLERANGE( ShadowVeryShort, ShadowVeryShortTrailingIdx ); - NearPeriodTotal += TA_CANDLERANGE( Near, i-1 ) + NearPeriodTotal += TA_CANDLERANGE( Near, i-1 ) - TA_CANDLERANGE( Near, NearTrailingIdx ); - i++; + i++; BodyTrailingIdx++; ShadowLongTrailingIdx++; ShadowVeryShortTrailingIdx++; @@ -398,15 +398,15 @@ /* Generated */ outInteger[outIdx++] = 100; /* Generated */ else /* Generated */ outInteger[outIdx++] = 0; -/* Generated */ BodyPeriodTotal += TA_CANDLERANGE( BodyShort, i ) +/* Generated */ BodyPeriodTotal += TA_CANDLERANGE( BodyShort, i ) /* Generated */ - TA_CANDLERANGE( BodyShort, BodyTrailingIdx ); -/* Generated */ ShadowLongPeriodTotal += TA_CANDLERANGE( ShadowLong, i ) +/* Generated */ ShadowLongPeriodTotal += TA_CANDLERANGE( ShadowLong, i ) /* Generated */ - TA_CANDLERANGE( ShadowLong, ShadowLongTrailingIdx ); -/* Generated */ ShadowVeryShortPeriodTotal += TA_CANDLERANGE( ShadowVeryShort, i ) +/* Generated */ ShadowVeryShortPeriodTotal += TA_CANDLERANGE( ShadowVeryShort, i ) /* Generated */ - TA_CANDLERANGE( ShadowVeryShort, ShadowVeryShortTrailingIdx ); -/* Generated */ NearPeriodTotal += TA_CANDLERANGE( Near, i-1 ) +/* Generated */ NearPeriodTotal += TA_CANDLERANGE( Near, i-1 ) /* Generated */ - TA_CANDLERANGE( Near, NearTrailingIdx ); -/* Generated */ i++; +/* Generated */ i++; /* Generated */ BodyTrailingIdx++; /* Generated */ ShadowLongTrailingIdx++; /* Generated */ ShadowVeryShortTrailingIdx++; diff --git a/src/ta_func/ta_CDLHANGINGMAN.c b/src/ta_func/ta_CDLHANGINGMAN.c index 09e774cd1..3cf3e08eb 100644 --- a/src/ta_func/ta_CDLHANGINGMAN.c +++ b/src/ta_func/ta_CDLHANGINGMAN.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -42,7 +42,7 @@ * * MMDDYY BY Description * ------------------------------------------------------------------- - * 102304 AC Creation + * 102304 AC Creation * */ @@ -213,7 +213,7 @@ ShadowVeryShortTrailingIdx = startIdx - TA_CANDLEAVGPERIOD(ShadowVeryShort); NearPeriodTotal = 0; NearTrailingIdx = startIdx -1 - TA_CANDLEAVGPERIOD(Near); - + i = BodyTrailingIdx; while( i < startIdx ) { BodyPeriodTotal += TA_CANDLERANGE( BodyShort, i ); @@ -257,18 +257,18 @@ outInteger[outIdx++] = -100; else outInteger[outIdx++] = 0; - /* add the current range and subtract the first range: this is done after the pattern recognition + /* add the current range and subtract the first range: this is done after the pattern recognition * when avgPeriod is not 0, that means "compare with the previous candles" (it excludes the current candle) */ - BodyPeriodTotal += TA_CANDLERANGE( BodyShort, i ) + BodyPeriodTotal += TA_CANDLERANGE( BodyShort, i ) - TA_CANDLERANGE( BodyShort, BodyTrailingIdx ); - ShadowLongPeriodTotal += TA_CANDLERANGE( ShadowLong, i ) + ShadowLongPeriodTotal += TA_CANDLERANGE( ShadowLong, i ) - TA_CANDLERANGE( ShadowLong, ShadowLongTrailingIdx ); - ShadowVeryShortPeriodTotal += TA_CANDLERANGE( ShadowVeryShort, i ) + ShadowVeryShortPeriodTotal += TA_CANDLERANGE( ShadowVeryShort, i ) - TA_CANDLERANGE( ShadowVeryShort, ShadowVeryShortTrailingIdx ); - NearPeriodTotal += TA_CANDLERANGE( Near, i-1 ) + NearPeriodTotal += TA_CANDLERANGE( Near, i-1 ) - TA_CANDLERANGE( Near, NearTrailingIdx ); - i++; + i++; BodyTrailingIdx++; ShadowLongTrailingIdx++; ShadowVeryShortTrailingIdx++; @@ -398,15 +398,15 @@ /* Generated */ outInteger[outIdx++] = -100; /* Generated */ else /* Generated */ outInteger[outIdx++] = 0; -/* Generated */ BodyPeriodTotal += TA_CANDLERANGE( BodyShort, i ) +/* Generated */ BodyPeriodTotal += TA_CANDLERANGE( BodyShort, i ) /* Generated */ - TA_CANDLERANGE( BodyShort, BodyTrailingIdx ); -/* Generated */ ShadowLongPeriodTotal += TA_CANDLERANGE( ShadowLong, i ) +/* Generated */ ShadowLongPeriodTotal += TA_CANDLERANGE( ShadowLong, i ) /* Generated */ - TA_CANDLERANGE( ShadowLong, ShadowLongTrailingIdx ); -/* Generated */ ShadowVeryShortPeriodTotal += TA_CANDLERANGE( ShadowVeryShort, i ) +/* Generated */ ShadowVeryShortPeriodTotal += TA_CANDLERANGE( ShadowVeryShort, i ) /* Generated */ - TA_CANDLERANGE( ShadowVeryShort, ShadowVeryShortTrailingIdx ); -/* Generated */ NearPeriodTotal += TA_CANDLERANGE( Near, i-1 ) +/* Generated */ NearPeriodTotal += TA_CANDLERANGE( Near, i-1 ) /* Generated */ - TA_CANDLERANGE( Near, NearTrailingIdx ); -/* Generated */ i++; +/* Generated */ i++; /* Generated */ BodyTrailingIdx++; /* Generated */ ShadowLongTrailingIdx++; /* Generated */ ShadowVeryShortTrailingIdx++; diff --git a/src/ta_func/ta_CDLHARAMI.c b/src/ta_func/ta_CDLHARAMI.c index 2be0f0867..cb7ffd330 100644 --- a/src/ta_func/ta_CDLHARAMI.c +++ b/src/ta_func/ta_CDLHARAMI.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLHARAMICROSS.c b/src/ta_func/ta_CDLHARAMICROSS.c index 7aa79430d..6ecad2f88 100644 --- a/src/ta_func/ta_CDLHARAMICROSS.c +++ b/src/ta_func/ta_CDLHARAMICROSS.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLHIGHWAVE.c b/src/ta_func/ta_CDLHIGHWAVE.c index afea9c8c8..b7a1754e1 100644 --- a/src/ta_func/ta_CDLHIGHWAVE.c +++ b/src/ta_func/ta_CDLHIGHWAVE.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -42,7 +42,7 @@ * * MMDDYY BY Description * ------------------------------------------------------------------- - * 072404 AC Creation + * 072404 AC Creation * */ @@ -206,7 +206,7 @@ BodyTrailingIdx = startIdx - TA_CANDLEAVGPERIOD(BodyShort); ShadowPeriodTotal = 0; ShadowTrailingIdx = startIdx - TA_CANDLEAVGPERIOD(ShadowVeryLong); - + i = BodyTrailingIdx; while( i < startIdx ) { BodyPeriodTotal += TA_CANDLERANGE( BodyShort, i ); @@ -229,18 +229,18 @@ outIdx = 0; do { - if( TA_REALBODY(i) < TA_CANDLEAVERAGE( BodyShort, BodyPeriodTotal, i ) && + if( TA_REALBODY(i) < TA_CANDLEAVERAGE( BodyShort, BodyPeriodTotal, i ) && TA_UPPERSHADOW(i) > TA_CANDLEAVERAGE( ShadowVeryLong, ShadowPeriodTotal, i ) && TA_LOWERSHADOW(i) > TA_CANDLEAVERAGE( ShadowVeryLong, ShadowPeriodTotal, i ) ) outInteger[outIdx++] = TA_CANDLECOLOR(i) * 100; else outInteger[outIdx++] = 0; - /* add the current range and subtract the first range: this is done after the pattern recognition + /* add the current range and subtract the first range: this is done after the pattern recognition * when avgPeriod is not 0, that means "compare with the previous candles" (it excludes the current candle) */ BodyPeriodTotal += TA_CANDLERANGE( BodyShort, i ) - TA_CANDLERANGE( BodyShort, BodyTrailingIdx ); ShadowPeriodTotal += TA_CANDLERANGE( ShadowVeryLong, i ) - TA_CANDLERANGE( ShadowVeryLong, ShadowTrailingIdx ); - i++; + i++; BodyTrailingIdx++; ShadowTrailingIdx++; } while( i <= endIdx ); @@ -345,7 +345,7 @@ /* Generated */ outIdx = 0; /* Generated */ do /* Generated */ { -/* Generated */ if( TA_REALBODY(i) < TA_CANDLEAVERAGE( BodyShort, BodyPeriodTotal, i ) && +/* Generated */ if( TA_REALBODY(i) < TA_CANDLEAVERAGE( BodyShort, BodyPeriodTotal, i ) && /* Generated */ TA_UPPERSHADOW(i) > TA_CANDLEAVERAGE( ShadowVeryLong, ShadowPeriodTotal, i ) && /* Generated */ TA_LOWERSHADOW(i) > TA_CANDLEAVERAGE( ShadowVeryLong, ShadowPeriodTotal, i ) ) /* Generated */ outInteger[outIdx++] = TA_CANDLECOLOR(i) * 100; @@ -353,7 +353,7 @@ /* Generated */ outInteger[outIdx++] = 0; /* Generated */ BodyPeriodTotal += TA_CANDLERANGE( BodyShort, i ) - TA_CANDLERANGE( BodyShort, BodyTrailingIdx ); /* Generated */ ShadowPeriodTotal += TA_CANDLERANGE( ShadowVeryLong, i ) - TA_CANDLERANGE( ShadowVeryLong, ShadowTrailingIdx ); -/* Generated */ i++; +/* Generated */ i++; /* Generated */ BodyTrailingIdx++; /* Generated */ ShadowTrailingIdx++; /* Generated */ } while( i <= endIdx ); diff --git a/src/ta_func/ta_CDLHIKKAKE.c b/src/ta_func/ta_CDLHIKKAKE.c index 0f71b8bc6..4a83e8fd8 100644 --- a/src/ta_func/ta_CDLHIKKAKE.c +++ b/src/ta_func/ta_CDLHIKKAKE.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -42,7 +42,7 @@ * * MMDDYY BY Description * ------------------------------------------------------------------- - * 120305 AC Creation + * 120305 AC Creation * */ @@ -153,7 +153,7 @@ { /* Insert local variables here. */ int i, outIdx, lookbackTotal, patternIdx, patternResult; - + /**** START GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/ /* Generated */ /* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK @@ -224,7 +224,7 @@ ) ) patternIdx = 0; - i++; + i++; } i = startIdx; @@ -264,7 +264,7 @@ patternIdx = 0; } else outInteger[outIdx++] = 0; - i++; + i++; } while( i <= endIdx ); /* All done. Indicate the output limits and return. */ @@ -369,7 +369,7 @@ /* Generated */ ) /* Generated */ ) /* Generated */ patternIdx = 0; -/* Generated */ i++; +/* Generated */ i++; /* Generated */ } /* Generated */ i = startIdx; /* Generated */ outIdx = 0; @@ -395,7 +395,7 @@ /* Generated */ patternIdx = 0; /* Generated */ } else /* Generated */ outInteger[outIdx++] = 0; -/* Generated */ i++; +/* Generated */ i++; /* Generated */ } while( i <= endIdx ); /* Generated */ VALUE_HANDLE_DEREF(outNBElement) = outIdx; /* Generated */ VALUE_HANDLE_DEREF(outBegIdx) = startIdx; diff --git a/src/ta_func/ta_CDLHIKKAKEMOD.c b/src/ta_func/ta_CDLHIKKAKEMOD.c index 8a9129f02..7df18ab4f 100644 --- a/src/ta_func/ta_CDLHIKKAKEMOD.c +++ b/src/ta_func/ta_CDLHIKKAKEMOD.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -42,7 +42,7 @@ * * MMDDYY BY Description * ------------------------------------------------------------------- - * 122605 AC Creation + * 122605 AC Creation * */ @@ -154,7 +154,7 @@ /* Insert local variables here. */ double NearPeriodTotal; int i, outIdx, NearTrailingIdx, lookbackTotal, patternIdx, patternResult; - + /**** START GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/ /* Generated */ /* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK @@ -219,7 +219,7 @@ if( inHigh[i-2] < inHigh[i-3] && inLow[i-2] > inLow[i-3] && // 2nd: lower high and higher low than 1st inHigh[i-1] < inHigh[i-2] && inLow[i-1] > inLow[i-2] && // 3rd: lower high and higher low than 2nd ( ( inHigh[i] < inHigh[i-1] && inLow[i] < inLow[i-1] && // (bull) 4th: lower high and lower low - inClose[i-2] <= inLow[i-2] + TA_CANDLEAVERAGE( Near, NearPeriodTotal, i-2 ) + inClose[i-2] <= inLow[i-2] + TA_CANDLEAVERAGE( Near, NearPeriodTotal, i-2 ) // (bull) 2nd: close near the low ) || @@ -238,11 +238,11 @@ || ( patternResult < 0 && inClose[i] < inLow[patternIdx-1] ) // close lower than the low of 3rd ) - ) + ) patternIdx = 0; NearPeriodTotal += TA_CANDLERANGE( Near, i-2 ) - TA_CANDLERANGE( Near, NearTrailingIdx-2 ); NearTrailingIdx++; - i++; + i++; } i = startIdx; @@ -259,8 +259,8 @@ * outInteger[confirmationbar] is equal to 100 + the bullish hikkake result or -100 - the bearish hikkake result * Note: if confirmation and a new hikkake come at the same bar, only the new hikkake is reported (the new hikkake * overwrites the confirmation of the old hikkake); - * the user should consider that modified hikkake is a reversal pattern, while hikkake could be both a reversal - * or a continuation pattern, so bullish (bearish) modified hikkake is significant when appearing in a downtrend + * the user should consider that modified hikkake is a reversal pattern, while hikkake could be both a reversal + * or a continuation pattern, so bullish (bearish) modified hikkake is significant when appearing in a downtrend * (uptrend) */ outIdx = 0; @@ -269,7 +269,7 @@ if( inHigh[i-2] < inHigh[i-3] && inLow[i-2] > inLow[i-3] && // 2nd: lower high and higher low than 1st inHigh[i-1] < inHigh[i-2] && inLow[i-1] > inLow[i-2] && // 3rd: lower high and higher low than 2nd ( ( inHigh[i] < inHigh[i-1] && inLow[i] < inLow[i-1] && // (bull) 4th: lower high and lower low - inClose[i-2] <= inLow[i-2] + TA_CANDLEAVERAGE( Near, NearPeriodTotal, i-2 ) + inClose[i-2] <= inLow[i-2] + TA_CANDLEAVERAGE( Near, NearPeriodTotal, i-2 ) // (bull) 2nd: close near the low ) || @@ -296,7 +296,7 @@ outInteger[outIdx++] = 0; NearPeriodTotal += TA_CANDLERANGE( Near, i-2 ) - TA_CANDLERANGE( Near, NearTrailingIdx-2 ); NearTrailingIdx++; - i++; + i++; } while( i <= endIdx ); /* All done. Indicate the output limits and return. */ @@ -396,7 +396,7 @@ /* Generated */ if( inHigh[i-2] < inHigh[i-3] && inLow[i-2] > inLow[i-3] && // 2nd: lower high and higher low than 1st /* Generated */ inHigh[i-1] < inHigh[i-2] && inLow[i-1] > inLow[i-2] && // 3rd: lower high and higher low than 2nd /* Generated */ ( ( inHigh[i] < inHigh[i-1] && inLow[i] < inLow[i-1] && // (bull) 4th: lower high and lower low -/* Generated */ inClose[i-2] <= inLow[i-2] + TA_CANDLEAVERAGE( Near, NearPeriodTotal, i-2 ) +/* Generated */ inClose[i-2] <= inLow[i-2] + TA_CANDLEAVERAGE( Near, NearPeriodTotal, i-2 ) /* Generated */ // (bull) 2nd: close near the low /* Generated */ ) /* Generated */ || @@ -414,11 +414,11 @@ /* Generated */ || /* Generated */ ( patternResult < 0 && inClose[i] < inLow[patternIdx-1] ) // close lower than the low of 3rd /* Generated */ ) -/* Generated */ ) +/* Generated */ ) /* Generated */ patternIdx = 0; /* Generated */ NearPeriodTotal += TA_CANDLERANGE( Near, i-2 ) - TA_CANDLERANGE( Near, NearTrailingIdx-2 ); /* Generated */ NearTrailingIdx++; -/* Generated */ i++; +/* Generated */ i++; /* Generated */ } /* Generated */ i = startIdx; /* Generated */ outIdx = 0; @@ -427,7 +427,7 @@ /* Generated */ if( inHigh[i-2] < inHigh[i-3] && inLow[i-2] > inLow[i-3] && // 2nd: lower high and higher low than 1st /* Generated */ inHigh[i-1] < inHigh[i-2] && inLow[i-1] > inLow[i-2] && // 3rd: lower high and higher low than 2nd /* Generated */ ( ( inHigh[i] < inHigh[i-1] && inLow[i] < inLow[i-1] && // (bull) 4th: lower high and lower low -/* Generated */ inClose[i-2] <= inLow[i-2] + TA_CANDLEAVERAGE( Near, NearPeriodTotal, i-2 ) +/* Generated */ inClose[i-2] <= inLow[i-2] + TA_CANDLEAVERAGE( Near, NearPeriodTotal, i-2 ) /* Generated */ // (bull) 2nd: close near the low /* Generated */ ) /* Generated */ || @@ -453,7 +453,7 @@ /* Generated */ outInteger[outIdx++] = 0; /* Generated */ NearPeriodTotal += TA_CANDLERANGE( Near, i-2 ) - TA_CANDLERANGE( Near, NearTrailingIdx-2 ); /* Generated */ NearTrailingIdx++; -/* Generated */ i++; +/* Generated */ i++; /* Generated */ } while( i <= endIdx ); /* Generated */ VALUE_HANDLE_DEREF(outNBElement) = outIdx; /* Generated */ VALUE_HANDLE_DEREF(outBegIdx) = startIdx; diff --git a/src/ta_func/ta_CDLHOMINGPIGEON.c b/src/ta_func/ta_CDLHOMINGPIGEON.c index d8ca9e549..2a5850226 100644 --- a/src/ta_func/ta_CDLHOMINGPIGEON.c +++ b/src/ta_func/ta_CDLHOMINGPIGEON.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLIDENTICAL3CROWS.c b/src/ta_func/ta_CDLIDENTICAL3CROWS.c index 7d40116dc..7163c8f58 100644 --- a/src/ta_func/ta_CDLIDENTICAL3CROWS.c +++ b/src/ta_func/ta_CDLIDENTICAL3CROWS.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLINNECK.c b/src/ta_func/ta_CDLINNECK.c index 213ccf7f6..1c7430a9e 100644 --- a/src/ta_func/ta_CDLINNECK.c +++ b/src/ta_func/ta_CDLINNECK.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLINVERTEDHAMMER.c b/src/ta_func/ta_CDLINVERTEDHAMMER.c index 30c5754b2..4190e284c 100644 --- a/src/ta_func/ta_CDLINVERTEDHAMMER.c +++ b/src/ta_func/ta_CDLINVERTEDHAMMER.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLKICKING.c b/src/ta_func/ta_CDLKICKING.c index 0da98a44f..fb2a210b7 100644 --- a/src/ta_func/ta_CDLKICKING.c +++ b/src/ta_func/ta_CDLKICKING.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLKICKINGBYLENGTH.c b/src/ta_func/ta_CDLKICKINGBYLENGTH.c index a8e32f400..f34ede7b8 100644 --- a/src/ta_func/ta_CDLKICKINGBYLENGTH.c +++ b/src/ta_func/ta_CDLKICKINGBYLENGTH.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLLADDERBOTTOM.c b/src/ta_func/ta_CDLLADDERBOTTOM.c index 0b9064af3..6ff333e7c 100644 --- a/src/ta_func/ta_CDLLADDERBOTTOM.c +++ b/src/ta_func/ta_CDLLADDERBOTTOM.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLLONGLEGGEDDOJI.c b/src/ta_func/ta_CDLLONGLEGGEDDOJI.c index 29107cc4f..5d03ffab0 100644 --- a/src/ta_func/ta_CDLLONGLEGGEDDOJI.c +++ b/src/ta_func/ta_CDLLONGLEGGEDDOJI.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -42,7 +42,7 @@ * * MMDDYY BY Description * ------------------------------------------------------------------- - * 011505 AC Creation + * 011505 AC Creation * */ @@ -206,7 +206,7 @@ BodyDojiTrailingIdx = startIdx - TA_CANDLEAVGPERIOD(BodyDoji); ShadowLongPeriodTotal = 0; ShadowLongTrailingIdx = startIdx - TA_CANDLEAVGPERIOD(ShadowLong); - + i = BodyDojiTrailingIdx; while( i < startIdx ) { BodyDojiPeriodTotal += TA_CANDLERANGE( BodyDoji, i ); @@ -230,7 +230,7 @@ do { if( TA_REALBODY(i) <= TA_CANDLEAVERAGE( BodyDoji, BodyDojiPeriodTotal, i ) && - ( TA_LOWERSHADOW(i) > TA_CANDLEAVERAGE( ShadowLong, ShadowLongPeriodTotal, i ) + ( TA_LOWERSHADOW(i) > TA_CANDLEAVERAGE( ShadowLong, ShadowLongPeriodTotal, i ) || TA_UPPERSHADOW(i) > TA_CANDLEAVERAGE( ShadowLong, ShadowLongPeriodTotal, i ) ) @@ -238,12 +238,12 @@ outInteger[outIdx++] = 100; else outInteger[outIdx++] = 0; - /* add the current range and subtract the first range: this is done after the pattern recognition + /* add the current range and subtract the first range: this is done after the pattern recognition * when avgPeriod is not 0, that means "compare with the previous candles" (it excludes the current candle) */ BodyDojiPeriodTotal += TA_CANDLERANGE( BodyDoji, i ) - TA_CANDLERANGE( BodyDoji, BodyDojiTrailingIdx ); ShadowLongPeriodTotal += TA_CANDLERANGE( ShadowLong, i ) - TA_CANDLERANGE( ShadowLong, ShadowLongTrailingIdx ); - i++; + i++; BodyDojiTrailingIdx++; ShadowLongTrailingIdx++; } while( i <= endIdx ); @@ -349,7 +349,7 @@ /* Generated */ do /* Generated */ { /* Generated */ if( TA_REALBODY(i) <= TA_CANDLEAVERAGE( BodyDoji, BodyDojiPeriodTotal, i ) && -/* Generated */ ( TA_LOWERSHADOW(i) > TA_CANDLEAVERAGE( ShadowLong, ShadowLongPeriodTotal, i ) +/* Generated */ ( TA_LOWERSHADOW(i) > TA_CANDLEAVERAGE( ShadowLong, ShadowLongPeriodTotal, i ) /* Generated */ || /* Generated */ TA_UPPERSHADOW(i) > TA_CANDLEAVERAGE( ShadowLong, ShadowLongPeriodTotal, i ) /* Generated */ ) @@ -359,7 +359,7 @@ /* Generated */ outInteger[outIdx++] = 0; /* Generated */ BodyDojiPeriodTotal += TA_CANDLERANGE( BodyDoji, i ) - TA_CANDLERANGE( BodyDoji, BodyDojiTrailingIdx ); /* Generated */ ShadowLongPeriodTotal += TA_CANDLERANGE( ShadowLong, i ) - TA_CANDLERANGE( ShadowLong, ShadowLongTrailingIdx ); -/* Generated */ i++; +/* Generated */ i++; /* Generated */ BodyDojiTrailingIdx++; /* Generated */ ShadowLongTrailingIdx++; /* Generated */ } while( i <= endIdx ); diff --git a/src/ta_func/ta_CDLLONGLINE.c b/src/ta_func/ta_CDLLONGLINE.c index 50a940e26..04ce4f1d1 100644 --- a/src/ta_func/ta_CDLLONGLINE.c +++ b/src/ta_func/ta_CDLLONGLINE.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLMARUBOZU.c b/src/ta_func/ta_CDLMARUBOZU.c index 5ed50434e..015d4e0c9 100644 --- a/src/ta_func/ta_CDLMARUBOZU.c +++ b/src/ta_func/ta_CDLMARUBOZU.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -42,7 +42,7 @@ * * MMDDYY BY Description * ------------------------------------------------------------------- - * 010605 AC Creation + * 010605 AC Creation * */ @@ -206,7 +206,7 @@ BodyLongTrailingIdx = startIdx - TA_CANDLEAVGPERIOD(BodyLong); ShadowVeryShortPeriodTotal = 0; ShadowVeryShortTrailingIdx = startIdx - TA_CANDLEAVGPERIOD(ShadowVeryShort); - + i = BodyLongTrailingIdx; while( i < startIdx ) { BodyLongPeriodTotal += TA_CANDLERANGE( BodyLong, i ); @@ -234,13 +234,13 @@ outInteger[outIdx++] = TA_CANDLECOLOR(i) * 100; else outInteger[outIdx++] = 0; - /* add the current range and subtract the first range: this is done after the pattern recognition + /* add the current range and subtract the first range: this is done after the pattern recognition * when avgPeriod is not 0, that means "compare with the previous candles" (it excludes the current candle) */ BodyLongPeriodTotal += TA_CANDLERANGE( BodyLong, i ) - TA_CANDLERANGE( BodyLong, BodyLongTrailingIdx ); - ShadowVeryShortPeriodTotal += TA_CANDLERANGE( ShadowVeryShort, i ) + ShadowVeryShortPeriodTotal += TA_CANDLERANGE( ShadowVeryShort, i ) - TA_CANDLERANGE( ShadowVeryShort, ShadowVeryShortTrailingIdx ); - i++; + i++; BodyLongTrailingIdx++; ShadowVeryShortTrailingIdx++; } while( i <= endIdx ); @@ -352,9 +352,9 @@ /* Generated */ else /* Generated */ outInteger[outIdx++] = 0; /* Generated */ BodyLongPeriodTotal += TA_CANDLERANGE( BodyLong, i ) - TA_CANDLERANGE( BodyLong, BodyLongTrailingIdx ); -/* Generated */ ShadowVeryShortPeriodTotal += TA_CANDLERANGE( ShadowVeryShort, i ) +/* Generated */ ShadowVeryShortPeriodTotal += TA_CANDLERANGE( ShadowVeryShort, i ) /* Generated */ - TA_CANDLERANGE( ShadowVeryShort, ShadowVeryShortTrailingIdx ); -/* Generated */ i++; +/* Generated */ i++; /* Generated */ BodyLongTrailingIdx++; /* Generated */ ShadowVeryShortTrailingIdx++; /* Generated */ } while( i <= endIdx ); diff --git a/src/ta_func/ta_CDLMATCHINGLOW.c b/src/ta_func/ta_CDLMATCHINGLOW.c index 02826a2b7..47d4b5adf 100644 --- a/src/ta_func/ta_CDLMATCHINGLOW.c +++ b/src/ta_func/ta_CDLMATCHINGLOW.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLMATHOLD.c b/src/ta_func/ta_CDLMATHOLD.c index b9744e2e8..b82868cef 100644 --- a/src/ta_func/ta_CDLMATHOLD.c +++ b/src/ta_func/ta_CDLMATHOLD.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLMORNINGDOJISTAR.c b/src/ta_func/ta_CDLMORNINGDOJISTAR.c index 03f0f2740..b6de56efc 100644 --- a/src/ta_func/ta_CDLMORNINGDOJISTAR.c +++ b/src/ta_func/ta_CDLMORNINGDOJISTAR.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLMORNINGSTAR.c b/src/ta_func/ta_CDLMORNINGSTAR.c index 924cd8649..1586d3487 100644 --- a/src/ta_func/ta_CDLMORNINGSTAR.c +++ b/src/ta_func/ta_CDLMORNINGSTAR.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -42,7 +42,7 @@ * * MMDDYY BY Description * ------------------------------------------------------------------- - * 100304 AC Creation + * 100304 AC Creation * */ @@ -229,7 +229,7 @@ BodyShortPeriodTotal2 = 0; BodyLongTrailingIdx = startIdx -2 - TA_CANDLEAVGPERIOD(BodyLong); BodyShortTrailingIdx = startIdx -1 - TA_CANDLEAVGPERIOD(BodyShort); - + i = BodyLongTrailingIdx; while( i < startIdx-2 ) { BodyLongPeriodTotal += TA_CANDLERANGE( BodyLong, i ); @@ -252,8 +252,8 @@ * The meaning of "moves well within" is specified with optInPenetration and "moves" should mean the real body should * not be short ("short" is specified with TA_SetCandleSettings) - Greg Morris wants it to be long, someone else want * it to be relatively long - * outInteger is positive (1 to 100): morning star is always bullish; - * the user should consider that a morning star is significant when it appears in a downtrend, + * outInteger is positive (1 to 100): morning star is always bullish; + * the user should consider that a morning star is significant when it appears in a downtrend, * while this function does not consider the trend */ outIdx = 0; @@ -270,13 +270,13 @@ outInteger[outIdx++] = 100; else outInteger[outIdx++] = 0; - /* add the current range and subtract the first range: this is done after the pattern recognition + /* add the current range and subtract the first range: this is done after the pattern recognition * when avgPeriod is not 0, that means "compare with the previous candles" (it excludes the current candle) */ BodyLongPeriodTotal += TA_CANDLERANGE( BodyLong, i-2 ) - TA_CANDLERANGE( BodyLong, BodyLongTrailingIdx ); BodyShortPeriodTotal += TA_CANDLERANGE( BodyShort, i-1 ) - TA_CANDLERANGE( BodyShort, BodyShortTrailingIdx ); BodyShortPeriodTotal2 += TA_CANDLERANGE( BodyShort, i ) - TA_CANDLERANGE( BodyShort, BodyShortTrailingIdx+1 ); - i++; + i++; BodyLongTrailingIdx++; BodyShortTrailingIdx++; } while( i <= endIdx ); @@ -406,7 +406,7 @@ /* Generated */ BodyLongPeriodTotal += TA_CANDLERANGE( BodyLong, i-2 ) - TA_CANDLERANGE( BodyLong, BodyLongTrailingIdx ); /* Generated */ BodyShortPeriodTotal += TA_CANDLERANGE( BodyShort, i-1 ) - TA_CANDLERANGE( BodyShort, BodyShortTrailingIdx ); /* Generated */ BodyShortPeriodTotal2 += TA_CANDLERANGE( BodyShort, i ) - TA_CANDLERANGE( BodyShort, BodyShortTrailingIdx+1 ); -/* Generated */ i++; +/* Generated */ i++; /* Generated */ BodyLongTrailingIdx++; /* Generated */ BodyShortTrailingIdx++; /* Generated */ } while( i <= endIdx ); diff --git a/src/ta_func/ta_CDLONNECK.c b/src/ta_func/ta_CDLONNECK.c index 51c69a650..102e2297b 100644 --- a/src/ta_func/ta_CDLONNECK.c +++ b/src/ta_func/ta_CDLONNECK.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -42,7 +42,7 @@ * * MMDDYY BY Description * ------------------------------------------------------------------- - * 121104 AC Creation + * 121104 AC Creation * */ @@ -226,7 +226,7 @@ * - second candle: white candle with open below previous day low and close equal to previous day low * The meaning of "equal" is specified with TA_SetCandleSettings * outInteger is negative (-1 to -100): on-neck is always bearish - * the user should consider that on-neck is significant when it appears in a downtrend, while this function + * the user should consider that on-neck is significant when it appears in a downtrend, while this function * does not consider it */ outIdx = 0; @@ -242,11 +242,11 @@ outInteger[outIdx++] = -100; else outInteger[outIdx++] = 0; - /* add the current range and subtract the first range: this is done after the pattern recognition + /* add the current range and subtract the first range: this is done after the pattern recognition * when avgPeriod is not 0, that means "compare with the previous candles" (it excludes the current candle) */ EqualPeriodTotal += TA_CANDLERANGE( Equal, i-1 ) - TA_CANDLERANGE( Equal, EqualTrailingIdx-1 ); - BodyLongPeriodTotal += TA_CANDLERANGE( BodyLong, i-1 ) + BodyLongPeriodTotal += TA_CANDLERANGE( BodyLong, i-1 ) - TA_CANDLERANGE( BodyLong, BodyLongTrailingIdx-1 ); i++; EqualTrailingIdx++; @@ -365,7 +365,7 @@ /* Generated */ else /* Generated */ outInteger[outIdx++] = 0; /* Generated */ EqualPeriodTotal += TA_CANDLERANGE( Equal, i-1 ) - TA_CANDLERANGE( Equal, EqualTrailingIdx-1 ); -/* Generated */ BodyLongPeriodTotal += TA_CANDLERANGE( BodyLong, i-1 ) +/* Generated */ BodyLongPeriodTotal += TA_CANDLERANGE( BodyLong, i-1 ) /* Generated */ - TA_CANDLERANGE( BodyLong, BodyLongTrailingIdx-1 ); /* Generated */ i++; /* Generated */ EqualTrailingIdx++; diff --git a/src/ta_func/ta_CDLPIERCING.c b/src/ta_func/ta_CDLPIERCING.c index 75394f7e6..fa817af79 100644 --- a/src/ta_func/ta_CDLPIERCING.c +++ b/src/ta_func/ta_CDLPIERCING.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLRICKSHAWMAN.c b/src/ta_func/ta_CDLRICKSHAWMAN.c index 7366c489d..ba59da09a 100644 --- a/src/ta_func/ta_CDLRICKSHAWMAN.c +++ b/src/ta_func/ta_CDLRICKSHAWMAN.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLRISEFALL3METHODS.c b/src/ta_func/ta_CDLRISEFALL3METHODS.c index 419badeb8..536dcae19 100644 --- a/src/ta_func/ta_CDLRISEFALL3METHODS.c +++ b/src/ta_func/ta_CDLRISEFALL3METHODS.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLSEPARATINGLINES.c b/src/ta_func/ta_CDLSEPARATINGLINES.c index 298629b1b..d30f6f879 100644 --- a/src/ta_func/ta_CDLSEPARATINGLINES.c +++ b/src/ta_func/ta_CDLSEPARATINGLINES.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -42,7 +42,7 @@ * * MMDDYY BY Description * ------------------------------------------------------------------- - * 011505 AC Creation + * 011505 AC Creation * */ @@ -96,7 +96,7 @@ /**** END GENCODE SECTION 2 - DO NOT DELETE THIS LINE ****/ /* insert lookback code here. */ - return max( max( TA_CANDLEAVGPERIOD(ShadowVeryShort), TA_CANDLEAVGPERIOD(BodyLong) ), + return max( max( TA_CANDLEAVGPERIOD(ShadowVeryShort), TA_CANDLEAVGPERIOD(BodyLong) ), TA_CANDLEAVGPERIOD(Equal) ) + 1; } @@ -234,7 +234,7 @@ * - second candle: bullish (bearish) belt hold with the same open as the prior candle * The meaning of "long body" and "very short shadow" of the belt hold is specified with TA_SetCandleSettings * outInteger is positive (1 to 100) when bullish or negative (-1 to -100) when bearish; - * the user should consider that separating lines is significant when coming in a trend and the belt hold has + * the user should consider that separating lines is significant when coming in a trend and the belt hold has * the same direction of the trend, while this function does not consider it */ outIdx = 0; @@ -244,7 +244,7 @@ inOpen[i] <= inOpen[i-1] + TA_CANDLEAVERAGE( Equal, EqualPeriodTotal, i-1 ) && // same open inOpen[i] >= inOpen[i-1] - TA_CANDLEAVERAGE( Equal, EqualPeriodTotal, i-1 ) && TA_REALBODY(i) > TA_CANDLEAVERAGE( BodyLong, BodyLongPeriodTotal, i ) && // belt hold: long body - ( + ( ( TA_CANDLECOLOR(i) == 1 && // with no lower shadow if bullish TA_LOWERSHADOW(i) < TA_CANDLEAVERAGE( ShadowVeryShort, ShadowVeryShortPeriodTotal, i ) ) @@ -257,10 +257,10 @@ outInteger[outIdx++] = TA_CANDLECOLOR(i) * 100; else outInteger[outIdx++] = 0; - /* add the current range and subtract the first range: this is done after the pattern recognition + /* add the current range and subtract the first range: this is done after the pattern recognition * when avgPeriod is not 0, that means "compare with the previous candles" (it excludes the current candle) */ - ShadowVeryShortPeriodTotal += TA_CANDLERANGE( ShadowVeryShort, i ) + ShadowVeryShortPeriodTotal += TA_CANDLERANGE( ShadowVeryShort, i ) - TA_CANDLERANGE( ShadowVeryShort, ShadowVeryShortTrailingIdx ); BodyLongPeriodTotal += TA_CANDLERANGE( BodyLong, i ) - TA_CANDLERANGE( BodyLong, BodyLongTrailingIdx ); EqualPeriodTotal += TA_CANDLERANGE( Equal, i-1 ) - TA_CANDLERANGE( Equal, EqualTrailingIdx-1 ); @@ -382,7 +382,7 @@ /* Generated */ inOpen[i] <= inOpen[i-1] + TA_CANDLEAVERAGE( Equal, EqualPeriodTotal, i-1 ) && // same open /* Generated */ inOpen[i] >= inOpen[i-1] - TA_CANDLEAVERAGE( Equal, EqualPeriodTotal, i-1 ) && /* Generated */ TA_REALBODY(i) > TA_CANDLEAVERAGE( BodyLong, BodyLongPeriodTotal, i ) && // belt hold: long body -/* Generated */ ( +/* Generated */ ( /* Generated */ ( TA_CANDLECOLOR(i) == 1 && // with no lower shadow if bullish /* Generated */ TA_LOWERSHADOW(i) < TA_CANDLEAVERAGE( ShadowVeryShort, ShadowVeryShortPeriodTotal, i ) /* Generated */ ) @@ -395,7 +395,7 @@ /* Generated */ outInteger[outIdx++] = TA_CANDLECOLOR(i) * 100; /* Generated */ else /* Generated */ outInteger[outIdx++] = 0; -/* Generated */ ShadowVeryShortPeriodTotal += TA_CANDLERANGE( ShadowVeryShort, i ) +/* Generated */ ShadowVeryShortPeriodTotal += TA_CANDLERANGE( ShadowVeryShort, i ) /* Generated */ - TA_CANDLERANGE( ShadowVeryShort, ShadowVeryShortTrailingIdx ); /* Generated */ BodyLongPeriodTotal += TA_CANDLERANGE( BodyLong, i ) - TA_CANDLERANGE( BodyLong, BodyLongTrailingIdx ); /* Generated */ EqualPeriodTotal += TA_CANDLERANGE( Equal, i-1 ) - TA_CANDLERANGE( Equal, EqualTrailingIdx-1 ); diff --git a/src/ta_func/ta_CDLSHOOTINGSTAR.c b/src/ta_func/ta_CDLSHOOTINGSTAR.c index 5d844281e..d3c2e629d 100644 --- a/src/ta_func/ta_CDLSHOOTINGSTAR.c +++ b/src/ta_func/ta_CDLSHOOTINGSTAR.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLSHORTLINE.c b/src/ta_func/ta_CDLSHORTLINE.c index af9786d28..f8065ad29 100644 --- a/src/ta_func/ta_CDLSHORTLINE.c +++ b/src/ta_func/ta_CDLSHORTLINE.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -42,7 +42,7 @@ * * MMDDYY BY Description * ------------------------------------------------------------------- - * 072404 AC Creation + * 072404 AC Creation * */ @@ -206,7 +206,7 @@ BodyTrailingIdx = startIdx - TA_CANDLEAVGPERIOD(BodyShort); ShadowPeriodTotal = 0; ShadowTrailingIdx = startIdx - TA_CANDLEAVGPERIOD(ShadowShort); - + i = BodyTrailingIdx; while( i < startIdx ) { BodyPeriodTotal += TA_CANDLERANGE( BodyShort, i ); @@ -235,7 +235,7 @@ outInteger[outIdx++] = TA_CANDLECOLOR(i) * 100; else outInteger[outIdx++] = 0; - /* add the current range and subtract the first range: this is done after the pattern recognition + /* add the current range and subtract the first range: this is done after the pattern recognition * when avgPeriod is not 0, that means "compare with the previous candles" (it excludes the current candle) */ BodyPeriodTotal += TA_CANDLERANGE( BodyShort, i ) - TA_CANDLERANGE( BodyShort, BodyTrailingIdx ); diff --git a/src/ta_func/ta_CDLSPINNINGTOP.c b/src/ta_func/ta_CDLSPINNINGTOP.c index ebb4012d6..d32acd777 100644 --- a/src/ta_func/ta_CDLSPINNINGTOP.c +++ b/src/ta_func/ta_CDLSPINNINGTOP.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -42,7 +42,7 @@ * * MMDDYY BY Description * ------------------------------------------------------------------- - * 071804 AC Creation + * 071804 AC Creation * */ @@ -204,7 +204,7 @@ /* Add-up the initial period, except for the last value. */ BodyPeriodTotal = 0; BodyTrailingIdx = startIdx - TA_CANDLEAVGPERIOD(BodyShort); - + i = BodyTrailingIdx; while( i < startIdx ) { BodyPeriodTotal += TA_CANDLERANGE( BodyShort, i ); @@ -222,18 +222,18 @@ outIdx = 0; do { - if( TA_REALBODY(i) < TA_CANDLEAVERAGE( BodyShort, BodyPeriodTotal, i ) && + if( TA_REALBODY(i) < TA_CANDLEAVERAGE( BodyShort, BodyPeriodTotal, i ) && TA_UPPERSHADOW(i) > TA_REALBODY(i) && TA_LOWERSHADOW(i) > TA_REALBODY(i) ) outInteger[outIdx++] = TA_CANDLECOLOR(i) * 100; else outInteger[outIdx++] = 0; - /* add the current range and subtract the first range: this is done after the pattern recognition + /* add the current range and subtract the first range: this is done after the pattern recognition * when avgPeriod is not 0, that means "compare with the previous candles" (it excludes the current candle) */ BodyPeriodTotal += TA_CANDLERANGE( BodyShort, i ) - TA_CANDLERANGE( BodyShort, BodyTrailingIdx ); - i++; + i++; BodyTrailingIdx++; } while( i <= endIdx ); @@ -330,7 +330,7 @@ /* Generated */ outIdx = 0; /* Generated */ do /* Generated */ { -/* Generated */ if( TA_REALBODY(i) < TA_CANDLEAVERAGE( BodyShort, BodyPeriodTotal, i ) && +/* Generated */ if( TA_REALBODY(i) < TA_CANDLEAVERAGE( BodyShort, BodyPeriodTotal, i ) && /* Generated */ TA_UPPERSHADOW(i) > TA_REALBODY(i) && /* Generated */ TA_LOWERSHADOW(i) > TA_REALBODY(i) /* Generated */ ) @@ -338,7 +338,7 @@ /* Generated */ else /* Generated */ outInteger[outIdx++] = 0; /* Generated */ BodyPeriodTotal += TA_CANDLERANGE( BodyShort, i ) - TA_CANDLERANGE( BodyShort, BodyTrailingIdx ); -/* Generated */ i++; +/* Generated */ i++; /* Generated */ BodyTrailingIdx++; /* Generated */ } while( i <= endIdx ); /* Generated */ VALUE_HANDLE_DEREF(outNBElement) = outIdx; diff --git a/src/ta_func/ta_CDLSTALLEDPATTERN.c b/src/ta_func/ta_CDLSTALLEDPATTERN.c index 0a111077f..ee39b06f3 100644 --- a/src/ta_func/ta_CDLSTALLEDPATTERN.c +++ b/src/ta_func/ta_CDLSTALLEDPATTERN.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLSTICKSANDWICH.c b/src/ta_func/ta_CDLSTICKSANDWICH.c index 5e8cbc5f9..d285b8518 100644 --- a/src/ta_func/ta_CDLSTICKSANDWICH.c +++ b/src/ta_func/ta_CDLSTICKSANDWICH.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -42,7 +42,7 @@ * * MMDDYY BY Description * ------------------------------------------------------------------- - * 032005 AC Creation + * 032005 AC Creation * */ @@ -219,7 +219,7 @@ * - third candle: black candle with the close equal to the first candle's close * The meaning of "equal" is specified with TA_SetCandleSettings * outInteger is always positive (1 to 100): stick sandwich is always bullish; - * the user should consider that stick sandwich is significant when coming in a downtrend, + * the user should consider that stick sandwich is significant when coming in a downtrend, * while this function does not consider it */ outIdx = 0; @@ -235,7 +235,7 @@ outInteger[outIdx++] = 100; else outInteger[outIdx++] = 0; - /* add the current range and subtract the first range: this is done after the pattern recognition + /* add the current range and subtract the first range: this is done after the pattern recognition * when avgPeriod is not 0, that means "compare with the previous candles" (it excludes the current candle) */ EqualPeriodTotal += TA_CANDLERANGE( Equal, i-2 ) - TA_CANDLERANGE( Equal, EqualTrailingIdx-2 ); diff --git a/src/ta_func/ta_CDLTAKURI.c b/src/ta_func/ta_CDLTAKURI.c index 2622e59e6..8cbee0c2a 100644 --- a/src/ta_func/ta_CDLTAKURI.c +++ b/src/ta_func/ta_CDLTAKURI.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLTASUKIGAP.c b/src/ta_func/ta_CDLTASUKIGAP.c index 12af9491b..5355d65d1 100644 --- a/src/ta_func/ta_CDLTASUKIGAP.c +++ b/src/ta_func/ta_CDLTASUKIGAP.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -42,7 +42,7 @@ * * MMDDYY BY Description * ------------------------------------------------------------------- - * 011605 AC Creation + * 011605 AC Creation * */ @@ -221,14 +221,14 @@ * - the size of two real bodies should be near the same * The meaning of "near" is specified with TA_SetCandleSettings * outInteger is positive (1 to 100) when bullish or negative (-1 to -100) when bearish; - * the user should consider that tasuki gap is significant when it appears in a trend, while this function does + * the user should consider that tasuki gap is significant when it appears in a trend, while this function does * not consider it */ outIdx = 0; do { - if( - ( + if( + ( TA_REALBODYGAPUP(i-1,i-2) && // upside gap TA_CANDLECOLOR(i-1) == 1 && // 1st: white TA_CANDLECOLOR(i) == -1 && // 2nd: black @@ -252,11 +252,11 @@ outInteger[outIdx++] = TA_CANDLECOLOR(i-1) * 100; else outInteger[outIdx++] = 0; - /* add the current range and subtract the first range: this is done after the pattern recognition + /* add the current range and subtract the first range: this is done after the pattern recognition * when avgPeriod is not 0, that means "compare with the previous candles" (it excludes the current candle) */ NearPeriodTotal += TA_CANDLERANGE( Near, i-1 ) - TA_CANDLERANGE( Near, NearTrailingIdx-1 ); - i++; + i++; NearTrailingIdx++; } while( i <= endIdx ); @@ -354,8 +354,8 @@ /* Generated */ outIdx = 0; /* Generated */ do /* Generated */ { -/* Generated */ if( -/* Generated */ ( +/* Generated */ if( +/* Generated */ ( /* Generated */ TA_REALBODYGAPUP(i-1,i-2) && // upside gap /* Generated */ TA_CANDLECOLOR(i-1) == 1 && // 1st: white /* Generated */ TA_CANDLECOLOR(i) == -1 && // 2nd: black @@ -380,7 +380,7 @@ /* Generated */ else /* Generated */ outInteger[outIdx++] = 0; /* Generated */ NearPeriodTotal += TA_CANDLERANGE( Near, i-1 ) - TA_CANDLERANGE( Near, NearTrailingIdx-1 ); -/* Generated */ i++; +/* Generated */ i++; /* Generated */ NearTrailingIdx++; /* Generated */ } while( i <= endIdx ); /* Generated */ VALUE_HANDLE_DEREF(outNBElement) = outIdx; diff --git a/src/ta_func/ta_CDLTHRUSTING.c b/src/ta_func/ta_CDLTHRUSTING.c index db3a0e418..e24eb7cc9 100644 --- a/src/ta_func/ta_CDLTHRUSTING.c +++ b/src/ta_func/ta_CDLTHRUSTING.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLTRISTAR.c b/src/ta_func/ta_CDLTRISTAR.c index 9611b379c..57bbbf884 100644 --- a/src/ta_func/ta_CDLTRISTAR.c +++ b/src/ta_func/ta_CDLTRISTAR.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLUNIQUE3RIVER.c b/src/ta_func/ta_CDLUNIQUE3RIVER.c index d9a01203b..56fbcfdf8 100644 --- a/src/ta_func/ta_CDLUNIQUE3RIVER.c +++ b/src/ta_func/ta_CDLUNIQUE3RIVER.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLUPSIDEGAP2CROWS.c b/src/ta_func/ta_CDLUPSIDEGAP2CROWS.c index acab8f253..e0a1e0cef 100644 --- a/src/ta_func/ta_CDLUPSIDEGAP2CROWS.c +++ b/src/ta_func/ta_CDLUPSIDEGAP2CROWS.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CDLXSIDEGAP3METHODS.c b/src/ta_func/ta_CDLXSIDEGAP3METHODS.c index d4f18c31d..66711cf77 100644 --- a/src/ta_func/ta_CDLXSIDEGAP3METHODS.c +++ b/src/ta_func/ta_CDLXSIDEGAP3METHODS.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -42,7 +42,7 @@ * * MMDDYY BY Description * ------------------------------------------------------------------- - * 011605 AC Creation + * 011605 AC Creation * */ @@ -210,7 +210,7 @@ * - upside (downside) gap between the first and the second real bodies * - third candle: black (white) candle that opens within the second real body and closes within the first real body * outInteger is positive (1 to 100) when bullish or negative (-1 to -100) when bearish; - * the user should consider that up/downside gap 3 methods is significant when it appears in a trend, while this + * the user should consider that up/downside gap 3 methods is significant when it appears in a trend, while this * function does not consider it */ outIdx = 0; @@ -222,7 +222,7 @@ inOpen[i] > min(inClose[i-1], inOpen[i-1]) && inClose[i] < max(inClose[i-2], inOpen[i-2]) && // 3rd closes within 1st rb inClose[i] > min(inClose[i-2], inOpen[i-2]) && - ( ( + ( ( TA_CANDLECOLOR(i-2) == 1 && // when 1st is white TA_REALBODYGAPUP(i-1,i-2) // upside gap ) || @@ -235,10 +235,10 @@ outInteger[outIdx++] = TA_CANDLECOLOR(i-2) * 100; else outInteger[outIdx++] = 0; - /* add the current range and subtract the first range: this is done after the pattern recognition + /* add the current range and subtract the first range: this is done after the pattern recognition * when avgPeriod is not 0, that means "compare with the previous candles" (it excludes the current candle) */ - i++; + i++; } while( i <= endIdx ); /* All done. Indicate the output limits and return. */ @@ -333,7 +333,7 @@ /* Generated */ inOpen[i] > min(inClose[i-1], inOpen[i-1]) && /* Generated */ inClose[i] < max(inClose[i-2], inOpen[i-2]) && // 3rd closes within 1st rb /* Generated */ inClose[i] > min(inClose[i-2], inOpen[i-2]) && -/* Generated */ ( ( +/* Generated */ ( ( /* Generated */ TA_CANDLECOLOR(i-2) == 1 && // when 1st is white /* Generated */ TA_REALBODYGAPUP(i-1,i-2) // upside gap /* Generated */ ) || @@ -346,7 +346,7 @@ /* Generated */ outInteger[outIdx++] = TA_CANDLECOLOR(i-2) * 100; /* Generated */ else /* Generated */ outInteger[outIdx++] = 0; -/* Generated */ i++; +/* Generated */ i++; /* Generated */ } while( i <= endIdx ); /* Generated */ VALUE_HANDLE_DEREF(outNBElement) = outIdx; /* Generated */ VALUE_HANDLE_DEREF(outBegIdx) = startIdx; diff --git a/src/ta_func/ta_CEIL.c b/src/ta_func/ta_CEIL.c index af5fd367f..466e7953f 100644 --- a/src/ta_func/ta_CEIL.c +++ b/src/ta_func/ta_CEIL.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_CMO.c b/src/ta_func/ta_CMO.c index df8a6a4d3..2a7afd9ed 100644 --- a/src/ta_func/ta_CMO.c +++ b/src/ta_func/ta_CMO.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -171,7 +171,7 @@ #if defined( USE_SINGLE_PRECISION_INPUT ) ARRAY_MEMMOVEMIX_VAR; - #endif + #endif /**** START GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/ /* Generated */ @@ -204,19 +204,19 @@ /* Insert TA function code here. */ /* CMO calculation is mostly identical to RSI. - * + * * The only difference is in the last step of calculation: * * RSI = gain / (gain+loss) * CMO = (gain-loss) / (gain+loss) - * - * See the RSI function for potentially some more info + * + * See the RSI function for potentially some more info * on this algo. */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); - + /* Adjust startIdx to account for the lookback period. */ lookbackTotal = LOOKBACK_CALL(CMO)( optInTimePeriod ); @@ -246,7 +246,7 @@ return ENUM_VALUE(RetCode,TA_SUCCESS,Success); } - /* Accumulate Wilder's "Average Gain" and "Average Loss" + /* Accumulate Wilder's "Average Gain" and "Average Loss" * among the initial period. */ today = startIdx-lookbackTotal; @@ -262,10 +262,10 @@ * no need to calculate since this * first value will be surely skip. */ - if( (unstablePeriod == 0) && + if( (unstablePeriod == 0) && (TA_GLOBALS_COMPATIBILITY == ENUM_VALUE(Compatibility,TA_COMPATIBILITY_METASTOCK,Metastock))) { - /* Preserve prevValue because it may get + /* Preserve prevValue because it may get * overwritten by the output. *(because output ptr could be the same as input ptr). */ @@ -294,7 +294,7 @@ tempValue1 = prevLoss/optInTimePeriod; tempValue2 = prevGain/optInTimePeriod; tempValue3 = tempValue2-tempValue1; - tempValue4 = tempValue1+tempValue2; + tempValue4 = tempValue1+tempValue2; /* Write the output. */ if( !TA_IS_ZERO(tempValue4) ) @@ -333,10 +333,10 @@ prevGain += tempValue2; } - + /* Subsequent prevLoss and prevGain are smoothed * using the previous values (Wilder's approach). - * 1) Multiply the previous by 'period-1'. + * 1) Multiply the previous by 'period-1'. * 2) Add today value. * 3) Divide by 'period'. */ @@ -361,9 +361,9 @@ } else { - /* Skip the unstable period. Do the processing + /* Skip the unstable period. Do the processing * but do not write it in the output. - */ + */ while( today < startIdx ) { tempValue1 = inReal[today]; @@ -464,7 +464,7 @@ /* Generated */ double tempValue1, tempValue2, tempValue3, tempValue4; /* Generated */ #if defined( USE_SINGLE_PRECISION_INPUT ) /* Generated */ ARRAY_MEMMOVEMIX_VAR; -/* Generated */ #endif +/* Generated */ #endif /* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK /* Generated */ if( startIdx < 0 ) /* Generated */ return ENUM_VALUE(RetCode,TA_OUT_OF_RANGE_START_INDEX,OutOfRangeStartIndex); @@ -505,7 +505,7 @@ /* Generated */ today = startIdx-lookbackTotal; /* Generated */ prevValue = inReal[today]; /* Generated */ unstablePeriod = TA_GLOBALS_UNSTABLE_PERIOD(TA_FUNC_UNST_CMO,Cmo); -/* Generated */ if( (unstablePeriod == 0) && +/* Generated */ if( (unstablePeriod == 0) && /* Generated */ (TA_GLOBALS_COMPATIBILITY == ENUM_VALUE(Compatibility,TA_COMPATIBILITY_METASTOCK,Metastock))) /* Generated */ { /* Generated */ savePrevValue = prevValue; @@ -524,7 +524,7 @@ /* Generated */ tempValue1 = prevLoss/optInTimePeriod; /* Generated */ tempValue2 = prevGain/optInTimePeriod; /* Generated */ tempValue3 = tempValue2-tempValue1; -/* Generated */ tempValue4 = tempValue1+tempValue2; +/* Generated */ tempValue4 = tempValue1+tempValue2; /* Generated */ if( !TA_IS_ZERO(tempValue4) ) /* Generated */ outReal[outIdx++] = 100*(tempValue3/tempValue4); /* Generated */ else diff --git a/src/ta_func/ta_CORREL.c b/src/ta_func/ta_CORREL.c index 39abe4ef7..1603f5b4d 100644 --- a/src/ta_func/ta_CORREL.c +++ b/src/ta_func/ta_CORREL.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -230,7 +230,7 @@ sumY2 += y*y; } - /* Write the first output. + /* Write the first output. * Save first the trailing values since the input * and output might be the same array, */ @@ -239,7 +239,7 @@ tempReal = (sumX2-((sumX*sumX)/optInTimePeriod)) * (sumY2-((sumY*sumY)/optInTimePeriod)); if( !TA_IS_ZERO_OR_NEG(tempReal) ) outReal[0] = (sumXY-((sumX*sumY)/optInTimePeriod)) / std_sqrt(tempReal); - else + else outReal[0] = 0.0; /* Tight loop to do subsequent values. */ @@ -275,7 +275,7 @@ outReal[outIdx++] = (sumXY-((sumX*sumY)/optInTimePeriod)) / std_sqrt(tempReal); else outReal[outIdx++] = 0.0; - } + } VALUE_HANDLE_DEREF(outNBElement) = outIdx; @@ -377,7 +377,7 @@ /* Generated */ tempReal = (sumX2-((sumX*sumX)/optInTimePeriod)) * (sumY2-((sumY*sumY)/optInTimePeriod)); /* Generated */ if( !TA_IS_ZERO_OR_NEG(tempReal) ) /* Generated */ outReal[0] = (sumXY-((sumX*sumY)/optInTimePeriod)) / std_sqrt(tempReal); -/* Generated */ else +/* Generated */ else /* Generated */ outReal[0] = 0.0; /* Generated */ outIdx = 1; /* Generated */ while( today <= endIdx ) @@ -401,7 +401,7 @@ /* Generated */ outReal[outIdx++] = (sumXY-((sumX*sumY)/optInTimePeriod)) / std_sqrt(tempReal); /* Generated */ else /* Generated */ outReal[outIdx++] = 0.0; -/* Generated */ } +/* Generated */ } /* Generated */ VALUE_HANDLE_DEREF(outNBElement) = outIdx; /* Generated */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success); /* Generated */ } diff --git a/src/ta_func/ta_COS.c b/src/ta_func/ta_COS.c index 82124295d..289b7e26c 100644 --- a/src/ta_func/ta_COS.c +++ b/src/ta_func/ta_COS.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_COSH.c b/src/ta_func/ta_COSH.c index bc4d5b51a..12936f559 100644 --- a/src/ta_func/ta_COSH.c +++ b/src/ta_func/ta_COSH.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_DEMA.c b/src/ta_func/ta_DEMA.c index fc692e0e5..5f4d0791e 100644 --- a/src/ta_func/ta_DEMA.c +++ b/src/ta_func/ta_DEMA.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -203,10 +203,10 @@ /* Insert TA function code here. */ /* For an explanation of this function, please read - * - * Stocks & Commodities V. 12:1 (11-19): + * + * Stocks & Commodities V. 12:1 (11-19): * Smoothing Data With Faster Moving Averages - * Stocks & Commodities V. 12:2 (72-80): + * Stocks & Commodities V. 12:2 (72-80): * Smoothing Data With Less Lag * * Both magazine articles written by Patrick G. Mulloy @@ -218,7 +218,7 @@ * DEMA offers a moving average with less lags then the * traditional EMA. * - * Do not confuse a DEMA with the EMA2. Both are called + * Do not confuse a DEMA with the EMA2. Both are called * "Double EMA" in the litterature, but EMA2 is a simple * EMA of an EMA, while DEMA is a compostie of a single * EMA with EMA2. @@ -239,7 +239,7 @@ /* Make sure there is still something to evaluate. */ if( startIdx > endIdx ) - return ENUM_VALUE(RetCode,TA_SUCCESS,Success); + return ENUM_VALUE(RetCode,TA_SUCCESS,Success); /* Allocate a temporary buffer for the firstEMA. * @@ -267,13 +267,13 @@ } #endif - /* Calculate the first EMA */ + /* Calculate the first EMA */ k = PER_TO_K(optInTimePeriod); retCode = FUNCTION_CALL(INT_EMA)( startIdx-lookbackEMA, endIdx, inReal, optInTimePeriod, k, VALUE_HANDLE_OUT(firstEMABegIdx), VALUE_HANDLE_OUT(firstEMANbElement), firstEMA ); - + /* Verify for failure or if not enough data after * calculating the first EMA. */ @@ -302,7 +302,7 @@ /* Return empty output on failure or if not enough data after * calculating the second EMA. */ - if( (retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success)) || (VALUE_HANDLE_GET(secondEMANbElement) == 0) ) + if( (retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success)) || (VALUE_HANDLE_GET(secondEMANbElement) == 0) ) { #if defined(USE_SINGLE_PRECISION_INPUT) ARRAY_FREE( firstEMA ); @@ -318,7 +318,7 @@ */ firstEMAIdx = VALUE_HANDLE_GET(secondEMABegIdx); outIdx = 0; - while( outIdx < VALUE_HANDLE_GET(secondEMANbElement) ) + while( outIdx < VALUE_HANDLE_GET(secondEMANbElement) ) { outReal[outIdx] = (2.0*firstEMA[firstEMAIdx++]) - secondEMA[outIdx]; outIdx++; @@ -417,7 +417,7 @@ /* Generated */ if( startIdx < lookbackTotal ) /* Generated */ startIdx = lookbackTotal; /* Generated */ if( startIdx > endIdx ) -/* Generated */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success); +/* Generated */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success); /* Generated */ #if defined(USE_SINGLE_PRECISION_INPUT) || defined( USE_SUBARRAY ) /* Generated */ tempInt = lookbackTotal+(endIdx-startIdx)+1; /* Generated */ ARRAY_ALLOC(firstEMA, tempInt ); @@ -460,7 +460,7 @@ /* Generated */ optInTimePeriod, k, /* Generated */ VALUE_HANDLE_OUT(secondEMABegIdx), VALUE_HANDLE_OUT(secondEMANbElement), /* Generated */ secondEMA ); -/* Generated */ if( (retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success)) || (VALUE_HANDLE_GET(secondEMANbElement) == 0) ) +/* Generated */ if( (retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success)) || (VALUE_HANDLE_GET(secondEMANbElement) == 0) ) /* Generated */ { /* Generated */ #if defined(USE_SINGLE_PRECISION_INPUT) /* Generated */ ARRAY_FREE( firstEMA ); @@ -472,7 +472,7 @@ /* Generated */ } /* Generated */ firstEMAIdx = VALUE_HANDLE_GET(secondEMABegIdx); /* Generated */ outIdx = 0; -/* Generated */ while( outIdx < VALUE_HANDLE_GET(secondEMANbElement) ) +/* Generated */ while( outIdx < VALUE_HANDLE_GET(secondEMANbElement) ) /* Generated */ { /* Generated */ outReal[outIdx] = (2.0*firstEMA[firstEMAIdx++]) - secondEMA[outIdx]; /* Generated */ outIdx++; diff --git a/src/ta_func/ta_DIV.c b/src/ta_func/ta_DIV.c index 085f56cc4..8ae23e29a 100644 --- a/src/ta_func/ta_DIV.c +++ b/src/ta_func/ta_DIV.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_DX.c b/src/ta_func/ta_DX.c index 3bafb130f..d767079b9 100644 --- a/src/ta_func/ta_DX.c +++ b/src/ta_func/ta_DX.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -222,10 +222,10 @@ /* Insert TA function code here. */ - /* + /* * The DM1 (one period) is base on the largest part of * today's range that is outside of yesterdays range. - * + * * The following 7 cases explain how the +DM and -DM are * calculated on one period: * @@ -234,8 +234,8 @@ * | | C| * | +DM1 = (C-A) B| | +DM1 = 0 * | -DM1 = 0 | -DM1 = (B-D) - * A| | D| - * | D| + * A| | D| + * | D| * B| * * Case 3: Case 4: @@ -243,11 +243,11 @@ * | A| | * | +DM1 = (C-A) | | +DM1 = 0 * | -DM1 = 0 B| | -DM1 = (B-D) - * A| | | + * A| | | * | | D| * B| | * D| - * + * * Case 5: Case 6: * A| A| C| * | C| +DM1 = 0 | | +DM1 = 0 @@ -257,7 +257,7 @@ * * * Case 7: - * + * * C| * A| | * | | +DM=0 @@ -274,18 +274,18 @@ * equal the lows). * * When calculating the DM over a period > 1, the one-period DM - * for the desired period are initialy sum. In other word, - * for a -DM14, sum the -DM1 for the first 14 days (that's + * for the desired period are initialy sum. In other word, + * for a -DM14, sum the -DM1 for the first 14 days (that's * 13 values because there is no DM for the first day!) * Subsequent DM are calculated using the Wilder's * smoothing approach: - * + * * Previous -DM14 * Today's -DM14 = Previous -DM14 - -------------- + Today's -DM1 * 14 * * Calculation of a -DI14 is as follow: - * + * * -DM14 * -DI14 = -------- * TR14 @@ -300,7 +300,7 @@ * TA_TRANGE function on how to calculate the true range. * * Calculation of the DX14 is: - * + * * diffDI = ABS( (-DI14) - (+DI14) ) * sumDI = (-DI14) + (+DI14) * @@ -315,7 +315,7 @@ * * This was understandable in the context that at the time the book * was written, most user were doing the calculation by hand. - * + * * For a computer, rounding is unnecessary (and even problematic when inputs * are close to 1). * @@ -474,7 +474,7 @@ plusDI = round_pos(100.0*(prevPlusDM/prevTR)); /* This loop is just to accumulate the initial DX */ tempReal = minusDI+plusDI; - if( !TA_IS_ZERO(tempReal)) + if( !TA_IS_ZERO(tempReal)) outReal[outIdx] = round_pos( 100.0 * (std_fabs(minusDI-plusDI)/tempReal) ); else outReal[outIdx] = outReal[outIdx-1]; @@ -682,7 +682,7 @@ /* Generated */ minusDI = round_pos(100.0*(prevMinusDM/prevTR)); /* Generated */ plusDI = round_pos(100.0*(prevPlusDM/prevTR)); /* Generated */ tempReal = minusDI+plusDI; -/* Generated */ if( !TA_IS_ZERO(tempReal)) +/* Generated */ if( !TA_IS_ZERO(tempReal)) /* Generated */ outReal[outIdx] = round_pos( 100.0 * (std_fabs(minusDI-plusDI)/tempReal) ); /* Generated */ else /* Generated */ outReal[outIdx] = outReal[outIdx-1]; diff --git a/src/ta_func/ta_EMA.c b/src/ta_func/ta_EMA.c index 8b1d82887..d60c8a302 100644 --- a/src/ta_func/ta_EMA.c +++ b/src/ta_func/ta_EMA.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -190,7 +190,7 @@ /* Insert TA function code here. */ /* Simply call the internal implementation of the EMA. */ - return FUNCTION_CALL(INT_EMA)( startIdx, endIdx, inReal, + return FUNCTION_CALL(INT_EMA)( startIdx, endIdx, inReal, optInTimePeriod, PER_TO_K( optInTimePeriod ), outBegIdx, outNBElement, outReal ); @@ -215,7 +215,7 @@ */ #if defined( _MANAGED ) && defined( USE_SUBARRAY ) enum class Core::RetCode Core::TA_INT_EMA( int startIdx, - int endIdx, + int endIdx, SubArray^ inReal, int optInTimePeriod, double optInK_1, @@ -281,7 +281,7 @@ TA_RetCode TA_PREFIX(INT_EMA)( int startIdx, VALUE_HANDLE_DEREF(outBegIdx) = startIdx; /* Do the EMA calculation using tight loops. */ - + /* The first EMA is calculated differently. It * then become the seed for subsequent EMA. * @@ -333,9 +333,9 @@ TA_RetCode TA_PREFIX(INT_EMA)( int startIdx, * input. */ - /* Skip the unstable period. Do the processing + /* Skip the unstable period. Do the processing * but do not write it in the output. - */ + */ while( today <= startIdx ) prevMA = ((inReal[today++]-prevMA)*optInK_1) + prevMA; @@ -416,7 +416,7 @@ TA_RetCode TA_PREFIX(INT_EMA)( int startIdx, /* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam); /* Generated */ #endif /* Generated */ #endif -/* Generated */ return FUNCTION_CALL(INT_EMA)( startIdx, endIdx, inReal, +/* Generated */ return FUNCTION_CALL(INT_EMA)( startIdx, endIdx, inReal, /* Generated */ optInTimePeriod, /* Generated */ PER_TO_K( optInTimePeriod ), /* Generated */ outBegIdx, outNBElement, outReal ); @@ -426,7 +426,7 @@ TA_RetCode TA_PREFIX(INT_EMA)( int startIdx, /* Generated */ #else /* Generated */ #if defined( _MANAGED ) && defined( USE_SUBARRAY ) /* Generated */ enum class Core::RetCode Core::TA_INT_EMA( int startIdx, -/* Generated */ int endIdx, +/* Generated */ int endIdx, /* Generated */ SubArray^ inReal, /* Generated */ int optInTimePeriod, /* Generated */ double optInK_1, diff --git a/src/ta_func/ta_EXP.c b/src/ta_func/ta_EXP.c index ce093fc90..eaa98d5db 100644 --- a/src/ta_func/ta_EXP.c +++ b/src/ta_func/ta_EXP.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_FLOOR.c b/src/ta_func/ta_FLOOR.c index 864868a54..34719bfa1 100644 --- a/src/ta_func/ta_FLOOR.c +++ b/src/ta_func/ta_FLOOR.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_HT_DCPERIOD.c b/src/ta_func/ta_HT_DCPERIOD.c index 1236044a8..4e52e9335 100644 --- a/src/ta_func/ta_HT_DCPERIOD.c +++ b/src/ta_func/ta_HT_DCPERIOD.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -266,10 +266,10 @@ } while( --i != 0); /* Initialize the circular buffers used by the hilbert - * transform logic. + * transform logic. * A buffer is used for odd day and another for even days. * This minimize the number of memory access and floating point - * operations needed (note also that by using static circular buffer, + * operations needed (note also that by using static circular buffer, * no large dynamic memory allocation is needed for storing * intermediate calculation!). */ @@ -292,7 +292,7 @@ /* The code is speed optimized and is most likely very * hard to follow if you do not already know well the * original algorithm. - * To understadn better, it is strongly suggested to look + * To understadn better, it is strongly suggested to look * first at the Excel implementation in "test_MAMA.xls" included * in this package. */ @@ -317,13 +317,13 @@ I2 = (0.2*(I1ForEvenPrev3 - jQ)) + (0.8*prevI2); /* The variable I1 is the detrender delayed for - * 3 price bars. + * 3 price bars. * * Save the current detrender value for being * used by the "odd" logic later. */ I1ForOddPrev3 = I1ForOddPrev2; - I1ForOddPrev2 = detrender; + I1ForOddPrev2 = detrender; } else { @@ -337,7 +337,7 @@ I2 = (0.2*(I1ForOddPrev3 - jQ)) + (0.8*prevI2); /* The varaiable I1 is the detrender delayed for - * 3 price bars. + * 3 price bars. * * Save the current detrender value for being * used by the "even" logic later. @@ -378,7 +378,7 @@ } VALUE_HANDLE_DEREF(outNBElement) = outIdx; - + return ENUM_VALUE(RetCode,TA_SUCCESS,Success); } @@ -519,7 +519,7 @@ /* Generated */ Q2 = (0.2*(Q1 + jI)) + (0.8*prevQ2); /* Generated */ I2 = (0.2*(I1ForEvenPrev3 - jQ)) + (0.8*prevI2); /* Generated */ I1ForOddPrev3 = I1ForOddPrev2; -/* Generated */ I1ForOddPrev2 = detrender; +/* Generated */ I1ForOddPrev2 = detrender; /* Generated */ } /* Generated */ else /* Generated */ { diff --git a/src/ta_func/ta_HT_DCPHASE.c b/src/ta_func/ta_HT_DCPHASE.c index af95d70e0..dc6cc1174 100644 --- a/src/ta_func/ta_HT_DCPHASE.c +++ b/src/ta_func/ta_HT_DCPHASE.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -98,7 +98,7 @@ /* insert lookback code here. */ - /* 31 input are skip + /* 31 input are skip * +32 output are skip to account for misc lookback * --- * 63 Total Lookback @@ -288,10 +288,10 @@ } while( --i != 0); /* Initialize the circular buffers used by the hilbert - * transform logic. + * transform logic. * A buffer is used for odd day and another for even days. * This minimize the number of memory access and floating point - * operations needed (note also that by using static circular buffer, + * operations needed (note also that by using static circular buffer, * no large dynamic memory allocation is needed for storing * intermediate calculation!). */ @@ -317,7 +317,7 @@ /* The code is speed optimized and is most likely very * hard to follow if you do not already know well the * original algorithm. - * To understadn better, it is strongly suggested to look + * To understadn better, it is strongly suggested to look * first at the Excel implementation in "test_MAMA.xls" included * in this package. */ @@ -348,13 +348,13 @@ I2 = (0.2*(I1ForEvenPrev3 - jQ)) + (0.8*prevI2); /* The variable I1 is the detrender delayed for - * 3 price bars. + * 3 price bars. * * Save the current detrender value for being * used by the "odd" logic later. */ I1ForOddPrev3 = I1ForOddPrev2; - I1ForOddPrev2 = detrender; + I1ForOddPrev2 = detrender; } else { @@ -368,7 +368,7 @@ I2 = (0.2*(I1ForOddPrev3 - jQ)) + (0.8*prevI2); /* The varaiable I1 is the detrender delayed for - * 3 price bars. + * 3 price bars. * * Save the current detrender value for being * used by the "even" logic later. @@ -451,7 +451,7 @@ } VALUE_HANDLE_DEREF(outNBElement) = outIdx; - + return ENUM_VALUE(RetCode,TA_SUCCESS,Success); } @@ -604,7 +604,7 @@ /* Generated */ Q2 = (0.2*(Q1 + jI)) + (0.8*prevQ2); /* Generated */ I2 = (0.2*(I1ForEvenPrev3 - jQ)) + (0.8*prevI2); /* Generated */ I1ForOddPrev3 = I1ForOddPrev2; -/* Generated */ I1ForOddPrev2 = detrender; +/* Generated */ I1ForOddPrev2 = detrender; /* Generated */ } /* Generated */ else /* Generated */ { diff --git a/src/ta_func/ta_HT_PHASOR.c b/src/ta_func/ta_HT_PHASOR.c index 43ef85131..482b75eb5 100644 --- a/src/ta_func/ta_HT_PHASOR.c +++ b/src/ta_func/ta_HT_PHASOR.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -273,10 +273,10 @@ } while( --i != 0); /* Initialize the circular buffers used by the hilbert - * transform logic. + * transform logic. * A buffer is used for odd day and another for even days. * This minimize the number of memory access and floating point - * operations needed (note also that by using static circular buffer, + * operations needed (note also that by using static circular buffer, * no large dynamic memory allocation is needed for storing * intermediate calculation!). */ @@ -298,7 +298,7 @@ /* The code is speed optimized and is most likely very * hard to follow if you do not already know well the * original algorithm. - * To understadn better, it is strongly suggested to look + * To understadn better, it is strongly suggested to look * first at the Excel implementation in "test_MAMA.xls" included * in this package. */ @@ -328,14 +328,14 @@ I2 = (0.2*(I1ForEvenPrev3 - jQ)) + (0.8*prevI2); /* The variable I1 is the detrender delayed for - * 3 price bars. + * 3 price bars. * * Save the current detrender value for being * used by the "odd" logic later. */ I1ForOddPrev3 = I1ForOddPrev2; I1ForOddPrev2 = detrender; - + } else { @@ -354,7 +354,7 @@ I2 = (0.2*(I1ForOddPrev3 - jQ)) + (0.8*prevI2); /* The varaiable I1 is the detrender delayed for - * 3 price bars. + * 3 price bars. * * Save the current detrender value for being * used by the "even" logic later. diff --git a/src/ta_func/ta_HT_SINE.c b/src/ta_func/ta_HT_SINE.c index 420c75a62..690f291cd 100644 --- a/src/ta_func/ta_HT_SINE.c +++ b/src/ta_func/ta_HT_SINE.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -98,7 +98,7 @@ /* insert lookback code here. */ - /* 31 input are skip + /* 31 input are skip * +32 output are skip to account for misc lookback * --- * 63 Total Lookback @@ -296,10 +296,10 @@ } while( --i != 0); /* Initialize the circular buffers used by the hilbert - * transform logic. + * transform logic. * A buffer is used for odd day and another for even days. * This minimize the number of memory access and floating point - * operations needed (note also that by using static circular buffer, + * operations needed (note also that by using static circular buffer, * no large dynamic memory allocation is needed for storing * intermediate calculation!). */ @@ -325,7 +325,7 @@ /* The code is speed optimized and is most likely very * hard to follow if you do not already know well the * original algorithm. - * To understadn better, it is strongly suggested to look + * To understadn better, it is strongly suggested to look * first at the Excel implementation in "test_MAMA.xls" included * in this package. */ @@ -356,13 +356,13 @@ I2 = (0.2*(I1ForEvenPrev3 - jQ)) + (0.8*prevI2); /* The variable I1 is the detrender delayed for - * 3 price bars. + * 3 price bars. * * Save the current detrender value for being * used by the "odd" logic later. */ I1ForOddPrev3 = I1ForOddPrev2; - I1ForOddPrev2 = detrender; + I1ForOddPrev2 = detrender; } else { @@ -376,7 +376,7 @@ I2 = (0.2*(I1ForOddPrev3 - jQ)) + (0.8*prevI2); /* The varaiable I1 is the detrender delayed for - * 3 price bars. + * 3 price bars. * * Save the current detrender value for being * used by the "even" logic later. @@ -460,7 +460,7 @@ } VALUE_HANDLE_DEREF(outNBElement) = outIdx; - + return ENUM_VALUE(RetCode,TA_SUCCESS,Success); } @@ -620,7 +620,7 @@ /* Generated */ Q2 = (0.2*(Q1 + jI)) + (0.8*prevQ2); /* Generated */ I2 = (0.2*(I1ForEvenPrev3 - jQ)) + (0.8*prevI2); /* Generated */ I1ForOddPrev3 = I1ForOddPrev2; -/* Generated */ I1ForOddPrev2 = detrender; +/* Generated */ I1ForOddPrev2 = detrender; /* Generated */ } /* Generated */ else /* Generated */ { diff --git a/src/ta_func/ta_HT_TRENDLINE.c b/src/ta_func/ta_HT_TRENDLINE.c index d9e000854..2a7cff6b6 100644 --- a/src/ta_func/ta_HT_TRENDLINE.c +++ b/src/ta_func/ta_HT_TRENDLINE.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -98,7 +98,7 @@ /* insert lookback code here. */ - /* 31 input are skip + /* 31 input are skip * +32 output are skip to account for misc lookback * --- * 63 Total Lookback @@ -292,10 +292,10 @@ } while( --i != 0); /* Initialize the circular buffers used by the hilbert - * transform logic. + * transform logic. * A buffer is used for odd day and another for even days. * This minimize the number of memory access and floating point - * operations needed (note also that by using static circular buffer, + * operations needed (note also that by using static circular buffer, * no large dynamic memory allocation is needed for storing * intermediate calculation!). */ @@ -321,7 +321,7 @@ /* The code is speed optimized and is most likely very * hard to follow if you do not already know well the * original algorithm. - * To understadn better, it is strongly suggested to look + * To understadn better, it is strongly suggested to look * first at the Excel implementation in "test_MAMA.xls" included * in this package. */ @@ -351,13 +351,13 @@ I2 = (0.2*(I1ForEvenPrev3 - jQ)) + (0.8*prevI2); /* The variable I1 is the detrender delayed for - * 3 price bars. + * 3 price bars. * * Save the current detrender value for being * used by the "odd" logic later. */ I1ForOddPrev3 = I1ForOddPrev2; - I1ForOddPrev2 = detrender; + I1ForOddPrev2 = detrender; } else { @@ -371,7 +371,7 @@ I2 = (0.2*(I1ForOddPrev3 - jQ)) + (0.8*prevI2); /* The varaiable I1 is the detrender delayed for - * 3 price bars. + * 3 price bars. * * Save the current detrender value for being * used by the "even" logic later. @@ -416,7 +416,7 @@ if( DCPeriodInt > 0 ) tempReal = tempReal/(double)DCPeriodInt; - + tempReal2 = (4.0*tempReal + 3.0*iTrend1 + 2.0*iTrend2 + iTrend3) / 10.0; iTrend3 = iTrend2; iTrend2 = iTrend1; @@ -433,7 +433,7 @@ } VALUE_HANDLE_DEREF(outNBElement) = outIdx; - + return ENUM_VALUE(RetCode,TA_SUCCESS,Success); } @@ -586,7 +586,7 @@ /* Generated */ Q2 = (0.2*(Q1 + jI)) + (0.8*prevQ2); /* Generated */ I2 = (0.2*(I1ForEvenPrev3 - jQ)) + (0.8*prevI2); /* Generated */ I1ForOddPrev3 = I1ForOddPrev2; -/* Generated */ I1ForOddPrev2 = detrender; +/* Generated */ I1ForOddPrev2 = detrender; /* Generated */ } /* Generated */ else /* Generated */ { diff --git a/src/ta_func/ta_HT_TRENDMODE.c b/src/ta_func/ta_HT_TRENDMODE.c index 63fe5b35a..32b7c1959 100644 --- a/src/ta_func/ta_HT_TRENDMODE.c +++ b/src/ta_func/ta_HT_TRENDMODE.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -98,7 +98,7 @@ /* insert lookback code here. */ - /* 31 input are skip + /* 31 input are skip * +32 output are skip to account for misc lookback * --- * 63 Total Lookback @@ -200,7 +200,7 @@ int daysInTrend, trend; double prevDCPhase, trendline; double prevSine, prevLeadSine, sine, leadSine; - + /**** START GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/ /* Generated */ @@ -304,10 +304,10 @@ } while( --i != 0); /* Initialize the circular buffers used by the hilbert - * transform logic. + * transform logic. * A buffer is used for odd day and another for even days. * This minimize the number of memory access and floating point - * operations needed (note also that by using static circular buffer, + * operations needed (note also that by using static circular buffer, * no large dynamic memory allocation is needed for storing * intermediate calculation!). */ @@ -333,7 +333,7 @@ /* The code is speed optimized and is most likely very * hard to follow if you do not already know well the * original algorithm. - * To understadn better, it is strongly suggested to look + * To understadn better, it is strongly suggested to look * first at the Excel implementation in "test_MAMA.xls" included * in this package. */ @@ -364,13 +364,13 @@ I2 = (0.2*(I1ForEvenPrev3 - jQ)) + (0.8*prevI2); /* The variable I1 is the detrender delayed for - * 3 price bars. + * 3 price bars. * * Save the current detrender value for being * used by the "odd" logic later. */ I1ForOddPrev3 = I1ForOddPrev2; - I1ForOddPrev2 = detrender; + I1ForOddPrev2 = detrender; } else { @@ -384,7 +384,7 @@ I2 = (0.2*(I1ForOddPrev3 - jQ)) + (0.8*prevI2); /* The varaiable I1 is the detrender delayed for - * 3 price bars. + * 3 price bars. * * Save the current detrender value for being * used by the "even" logic later. @@ -456,7 +456,7 @@ DCPhase += 180.0; if( DCPhase > 315.0 ) DCPhase -= 360.0; - + prevSine = sine; prevLeadSine = leadSine; sine = std_sin(DCPhase*deg2Rad); @@ -476,12 +476,12 @@ if( DCPeriodInt > 0 ) tempReal = tempReal/(double)DCPeriodInt; - + trendline = (4.0*tempReal + 3.0*iTrend1 + 2.0*iTrend2 + iTrend3) / 10.0; iTrend3 = iTrend2; iTrend2 = iTrend1; iTrend1 = tempReal; - + /* Compute the trend Mode , and assume trend by default */ trend = 1; @@ -520,7 +520,7 @@ } VALUE_HANDLE_DEREF(outNBElement) = outIdx; - + return ENUM_VALUE(RetCode,TA_SUCCESS,Success); } @@ -683,7 +683,7 @@ /* Generated */ Q2 = (0.2*(Q1 + jI)) + (0.8*prevQ2); /* Generated */ I2 = (0.2*(I1ForEvenPrev3 - jQ)) + (0.8*prevI2); /* Generated */ I1ForOddPrev3 = I1ForOddPrev2; -/* Generated */ I1ForOddPrev2 = detrender; +/* Generated */ I1ForOddPrev2 = detrender; /* Generated */ } /* Generated */ else /* Generated */ { diff --git a/src/ta_func/ta_IMI.c b/src/ta_func/ta_IMI.c index 50bdfdc9e..10ec14e4c 100644 --- a/src/ta_func/ta_IMI.c +++ b/src/ta_func/ta_IMI.c @@ -1,50 +1,50 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * - Neither name of author nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* List of contributors: - * - * Initial Name/description - * ------------------------------------------------------------------- - * AB Anatoliy Belsky - * - * Change history: - * - * MMDDYY BY Description - * ------------------------------------------------------------------- - * 181012 AB Initial Version - */ - -/**** START GENCODE SECTION 1 - DO NOT DELETE THIS LINE ****/ +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * - Neither name of author nor the names of its contributors + * may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* List of contributors: + * + * Initial Name/description + * ------------------------------------------------------------------- + * AB Anatoliy Belsky + * + * Change history: + * + * MMDDYY BY Description + * ------------------------------------------------------------------- + * 181012 AB Initial Version + */ + +/**** START GENCODE SECTION 1 - DO NOT DELETE THIS LINE ****/ /* All code within this section is automatically * generated by gen_code. Any modification will be lost * next time gen_code is run. @@ -85,11 +85,11 @@ /* Generated */ TA_LIB_API int TA_IMI_Lookback( int optInTimePeriod ) /* From 2 to 100000 */ /* Generated */ /* Generated */ #endif -/**** END GENCODE SECTION 1 - DO NOT DELETE THIS LINE ****/ -{ - /* insert local variable here */ - -/**** START GENCODE SECTION 2 - DO NOT DELETE THIS LINE ****/ +/**** END GENCODE SECTION 1 - DO NOT DELETE THIS LINE ****/ +{ + /* insert local variable here */ + +/**** START GENCODE SECTION 2 - DO NOT DELETE THIS LINE ****/ /* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK /* Generated */ /* min/max are checked for optInTimePeriod. */ /* Generated */ if( (int)optInTimePeriod == TA_INTEGER_DEFAULT ) @@ -98,14 +98,14 @@ /* Generated */ return -1; /* Generated */ /* Generated */ #endif /* TA_FUNC_NO_RANGE_CHECK */ -/**** END GENCODE SECTION 2 - DO NOT DELETE THIS LINE ****/ - - /* insert lookback code here. */ - - return optInTimePeriod + TA_GLOBALS_UNSTABLE_PERIOD(TA_FUNC_UNST_IMI, Imi) - 1; -} - -/**** START GENCODE SECTION 3 - DO NOT DELETE THIS LINE ****/ +/**** END GENCODE SECTION 2 - DO NOT DELETE THIS LINE ****/ + + /* insert lookback code here. */ + + return optInTimePeriod + TA_GLOBALS_UNSTABLE_PERIOD(TA_FUNC_UNST_IMI, Imi) - 1; +} + +/**** START GENCODE SECTION 3 - DO NOT DELETE THIS LINE ****/ /* * TA_IMI - Intraday Momentum Index * @@ -157,12 +157,12 @@ /* Generated */ int *outNBElement, /* Generated */ double outReal[] ) /* Generated */ #endif -/**** END GENCODE SECTION 3 - DO NOT DELETE THIS LINE ****/ -{ - /* insert local variable here */ - int lookback, outIdx = 0; - -/**** START GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/ +/**** END GENCODE SECTION 3 - DO NOT DELETE THIS LINE ****/ +{ + /* insert local variable here */ + int lookback, outIdx = 0; + +/**** START GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/ /* Generated */ /* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK /* Generated */ @@ -191,51 +191,51 @@ /* Generated */ #endif /* !defined(_JAVA) */ /* Generated */ #endif /* TA_FUNC_NO_RANGE_CHECK */ /* Generated */ -/**** END GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/ - - /* Insert TA function code here. */ - - lookback = LOOKBACK_CALL(IMI)( optInTimePeriod ); - - if(startIdx < lookback) - startIdx = lookback; - - /* Make sure there is still something to evaluate. */ - if( startIdx > endIdx ) { - VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); - VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); - return ENUM_VALUE(RetCode,TA_SUCCESS,Success); - } - - VALUE_HANDLE_DEREF(outBegIdx) = startIdx; - - while (startIdx <= endIdx) { - double upsum = .0, downsum = .0; - int i; - - for (i = startIdx - lookback; i <= startIdx; i++) { - double close = inClose[i]; - double open = inOpen[i]; - - if (close > open) { - upsum += (close - open); - } else { - downsum += (open - close); - } - - outReal[outIdx] = 100.0*(upsum/(upsum + downsum)); - } - - startIdx++; - outIdx++; - } - - VALUE_HANDLE_DEREF(outNBElement) = outIdx; - - return ENUM_VALUE(RetCode,TA_SUCCESS,Success); -} - -/**** START GENCODE SECTION 5 - DO NOT DELETE THIS LINE ****/ +/**** END GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/ + + /* Insert TA function code here. */ + + lookback = LOOKBACK_CALL(IMI)( optInTimePeriod ); + + if(startIdx < lookback) + startIdx = lookback; + + /* Make sure there is still something to evaluate. */ + if( startIdx > endIdx ) { + VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); + VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); + return ENUM_VALUE(RetCode,TA_SUCCESS,Success); + } + + VALUE_HANDLE_DEREF(outBegIdx) = startIdx; + + while (startIdx <= endIdx) { + double upsum = .0, downsum = .0; + int i; + + for (i = startIdx - lookback; i <= startIdx; i++) { + double close = inClose[i]; + double open = inOpen[i]; + + if (close > open) { + upsum += (close - open); + } else { + downsum += (open - close); + } + + outReal[outIdx] = 100.0*(upsum/(upsum + downsum)); + } + + startIdx++; + outIdx++; + } + + VALUE_HANDLE_DEREF(outNBElement) = outIdx; + + return ENUM_VALUE(RetCode,TA_SUCCESS,Success); +} + +/**** START GENCODE SECTION 5 - DO NOT DELETE THIS LINE ****/ /* Generated */ /* Generated */ #define USE_SINGLE_PRECISION_INPUT /* Generated */ #if !defined( _MANAGED ) && !defined( _JAVA ) @@ -281,8 +281,8 @@ /* Generated */ int *outNBElement, /* Generated */ double outReal[] ) /* Generated */ #endif -/* Generated */ { -/* Generated */ int lookback, outIdx = 0; +/* Generated */ { +/* Generated */ int lookback, outIdx = 0; /* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK /* Generated */ if( startIdx < 0 ) /* Generated */ return ENUM_VALUE(RetCode,TA_OUT_OF_RANGE_START_INDEX,OutOfRangeStartIndex); @@ -301,37 +301,37 @@ /* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam); /* Generated */ #endif /* Generated */ #endif -/* Generated */ lookback = LOOKBACK_CALL(IMI)( optInTimePeriod ); -/* Generated */ if(startIdx < lookback) -/* Generated */ startIdx = lookback; -/* Generated */ if( startIdx > endIdx ) { -/* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); -/* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); -/* Generated */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success); -/* Generated */ } -/* Generated */ VALUE_HANDLE_DEREF(outBegIdx) = startIdx; -/* Generated */ while (startIdx <= endIdx) { -/* Generated */ double upsum = .0, downsum = .0; -/* Generated */ int i; -/* Generated */ for (i = startIdx - lookback; i <= startIdx; i++) { -/* Generated */ double close = inClose[i]; -/* Generated */ double open = inOpen[i]; -/* Generated */ if (close > open) { -/* Generated */ upsum += (close - open); -/* Generated */ } else { -/* Generated */ downsum += (open - close); -/* Generated */ } -/* Generated */ outReal[outIdx] = 100.0*(upsum/(upsum + downsum)); -/* Generated */ } -/* Generated */ startIdx++; -/* Generated */ outIdx++; -/* Generated */ } -/* Generated */ VALUE_HANDLE_DEREF(outNBElement) = outIdx; -/* Generated */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success); -/* Generated */ } +/* Generated */ lookback = LOOKBACK_CALL(IMI)( optInTimePeriod ); +/* Generated */ if(startIdx < lookback) +/* Generated */ startIdx = lookback; +/* Generated */ if( startIdx > endIdx ) { +/* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); +/* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); +/* Generated */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success); +/* Generated */ } +/* Generated */ VALUE_HANDLE_DEREF(outBegIdx) = startIdx; +/* Generated */ while (startIdx <= endIdx) { +/* Generated */ double upsum = .0, downsum = .0; +/* Generated */ int i; +/* Generated */ for (i = startIdx - lookback; i <= startIdx; i++) { +/* Generated */ double close = inClose[i]; +/* Generated */ double open = inOpen[i]; +/* Generated */ if (close > open) { +/* Generated */ upsum += (close - open); +/* Generated */ } else { +/* Generated */ downsum += (open - close); +/* Generated */ } +/* Generated */ outReal[outIdx] = 100.0*(upsum/(upsum + downsum)); +/* Generated */ } +/* Generated */ startIdx++; +/* Generated */ outIdx++; +/* Generated */ } +/* Generated */ VALUE_HANDLE_DEREF(outNBElement) = outIdx; +/* Generated */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success); +/* Generated */ } /* Generated */ /* Generated */ #if defined( _MANAGED ) /* Generated */ }}} // Close namespace TicTacTec.TA.Lib /* Generated */ #endif -/**** END GENCODE SECTION 5 - DO NOT DELETE THIS LINE ****/ - +/**** END GENCODE SECTION 5 - DO NOT DELETE THIS LINE ****/ + diff --git a/src/ta_func/ta_KAMA.c b/src/ta_func/ta_KAMA.c index 6fb3d6a7b..697fd4035 100644 --- a/src/ta_func/ta_KAMA.c +++ b/src/ta_func/ta_KAMA.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -222,22 +222,22 @@ VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); return ENUM_VALUE(RetCode,TA_SUCCESS,Success); } - + /* Initialize the variables by going through * the lookback period. */ sumROC1 = 0.0; - today = startIdx-lookbackTotal; + today = startIdx-lookbackTotal; trailingIdx = today; i = optInTimePeriod; while( i-- > 0 ) - { + { tempReal = inReal[today++]; tempReal -= inReal[today]; sumROC1 += std_fabs(tempReal); } - /* At this point sumROC1 represent the + /* At this point sumROC1 represent the * summation of the 1-day price difference * over the (optInTimePeriod-1) */ @@ -252,7 +252,7 @@ periodROC = tempReal-tempReal2; /* Save the trailing value. Do this because inReal - * and outReal can be pointers to the same buffer. + * and outReal can be pointers to the same buffer. */ trailingValue = tempReal2; @@ -275,9 +275,9 @@ * input. */ - /* Skip the unstable period. Do the whole processing + /* Skip the unstable period. Do the whole processing * needed for KAMA, but do not write it in the output. - */ + */ while( today <= startIdx ) { tempReal = inReal[today]; @@ -285,14 +285,14 @@ periodROC = tempReal-tempReal2; /* Adjust sumROC1: - * - Remove trailing ROC1 + * - Remove trailing ROC1 * - Add new ROC1 */ sumROC1 -= std_fabs(trailingValue-tempReal2); sumROC1 += std_fabs(tempReal-inReal[today-1]); /* Save the trailing value. Do this because inReal - * and outReal can be pointers to the same buffer. + * and outReal can be pointers to the same buffer. */ trailingValue = tempReal2; @@ -325,14 +325,14 @@ periodROC = tempReal-tempReal2; /* Adjust sumROC1: - * - Remove trailing ROC1 + * - Remove trailing ROC1 * - Add new ROC1 */ sumROC1 -= std_fabs(trailingValue-tempReal2); sumROC1 += std_fabs(tempReal-inReal[today-1]); /* Save the trailing value. Do this because inReal - * and outReal can be pointers to the same buffer. + * and outReal can be pointers to the same buffer. */ trailingValue = tempReal2; @@ -437,11 +437,11 @@ /* Generated */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success); /* Generated */ } /* Generated */ sumROC1 = 0.0; -/* Generated */ today = startIdx-lookbackTotal; +/* Generated */ today = startIdx-lookbackTotal; /* Generated */ trailingIdx = today; /* Generated */ i = optInTimePeriod; /* Generated */ while( i-- > 0 ) -/* Generated */ { +/* Generated */ { /* Generated */ tempReal = inReal[today++]; /* Generated */ tempReal -= inReal[today]; /* Generated */ sumROC1 += std_fabs(tempReal); diff --git a/src/ta_func/ta_LINEARREG.c b/src/ta_func/ta_LINEARREG.c index d02984cd9..229135f98 100644 --- a/src/ta_func/ta_LINEARREG.c +++ b/src/ta_func/ta_LINEARREG.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_LINEARREG_ANGLE.c b/src/ta_func/ta_LINEARREG_ANGLE.c index d6de2f47e..b68c81721 100644 --- a/src/ta_func/ta_LINEARREG_ANGLE.c +++ b/src/ta_func/ta_LINEARREG_ANGLE.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_LINEARREG_INTERCEPT.c b/src/ta_func/ta_LINEARREG_INTERCEPT.c index 7108447ec..191479df4 100644 --- a/src/ta_func/ta_LINEARREG_INTERCEPT.c +++ b/src/ta_func/ta_LINEARREG_INTERCEPT.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -244,7 +244,7 @@ SumY += tempValue1 = inReal[today - i]; SumXY += (double)i * tempValue1; } - m = ( optInTimePeriod * SumXY - SumX * SumY) / Divisor; + m = ( optInTimePeriod * SumXY - SumX * SumY) / Divisor; outReal[outIdx++] = ( SumY - m * SumX ) / (double)optInTimePeriod; today++; } @@ -344,7 +344,7 @@ /* Generated */ SumY += tempValue1 = inReal[today - i]; /* Generated */ SumXY += (double)i * tempValue1; /* Generated */ } -/* Generated */ m = ( optInTimePeriod * SumXY - SumX * SumY) / Divisor; +/* Generated */ m = ( optInTimePeriod * SumXY - SumX * SumY) / Divisor; /* Generated */ outReal[outIdx++] = ( SumY - m * SumX ) / (double)optInTimePeriod; /* Generated */ today++; /* Generated */ } diff --git a/src/ta_func/ta_LINEARREG_SLOPE.c b/src/ta_func/ta_LINEARREG_SLOPE.c index fe169c9e1..78c5cc864 100644 --- a/src/ta_func/ta_LINEARREG_SLOPE.c +++ b/src/ta_func/ta_LINEARREG_SLOPE.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_LN.c b/src/ta_func/ta_LN.c index c6f33da08..be1a1113f 100644 --- a/src/ta_func/ta_LN.c +++ b/src/ta_func/ta_LN.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_LOG10.c b/src/ta_func/ta_LOG10.c index dbf2a4c40..51f6686b9 100644 --- a/src/ta_func/ta_LOG10.c +++ b/src/ta_func/ta_LOG10.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_MA.c b/src/ta_func/ta_MA.c index b4f86d709..d6c552e70 100644 --- a/src/ta_func/ta_MA.c +++ b/src/ta_func/ta_MA.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -118,7 +118,7 @@ if( optInTimePeriod <= 1 ) return 0; - + switch( optInMAType ) { case ENUM_CASE(MAType, TA_MAType_SMA, Sma ): @@ -266,7 +266,7 @@ if( optInTimePeriod == 1 ) { nbElement = endIdx-startIdx+1; - VALUE_HANDLE_DEREF(outNBElement) = nbElement; + VALUE_HANDLE_DEREF(outNBElement) = nbElement; for( todayIdx=startIdx, outIdx=0; outIdx < nbElement; outIdx++, todayIdx++ ) outReal[outIdx] = inReal[todayIdx]; VALUE_HANDLE_DEREF(outBegIdx) = startIdx; @@ -281,7 +281,7 @@ break; case ENUM_CASE(MAType, TA_MAType_EMA, Ema): - retCode = FUNCTION_CALL(EMA)( startIdx, endIdx, inReal, optInTimePeriod, + retCode = FUNCTION_CALL(EMA)( startIdx, endIdx, inReal, optInTimePeriod, outBegIdx, outNBElement, outReal ); break; @@ -321,10 +321,10 @@ return ENUM_VALUE(RetCode,TA_ALLOC_ERR,AllocErr); #endif - retCode = FUNCTION_CALL(MAMA)( startIdx, endIdx, inReal, 0.5, 0.05, + retCode = FUNCTION_CALL(MAMA)( startIdx, endIdx, inReal, 0.5, 0.05, outBegIdx, outNBElement, outReal, dummyBuffer ); - + ARRAY_FREE( dummyBuffer ); break; @@ -334,7 +334,7 @@ outBegIdx, outNBElement, outReal ); break; - default: + default: retCode = ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam); break; } @@ -419,7 +419,7 @@ /* Generated */ if( optInTimePeriod == 1 ) /* Generated */ { /* Generated */ nbElement = endIdx-startIdx+1; -/* Generated */ VALUE_HANDLE_DEREF(outNBElement) = nbElement; +/* Generated */ VALUE_HANDLE_DEREF(outNBElement) = nbElement; /* Generated */ for( todayIdx=startIdx, outIdx=0; outIdx < nbElement; outIdx++, todayIdx++ ) /* Generated */ outReal[outIdx] = inReal[todayIdx]; /* Generated */ VALUE_HANDLE_DEREF(outBegIdx) = startIdx; @@ -432,7 +432,7 @@ /* Generated */ outBegIdx, outNBElement, outReal ); /* Generated */ break; /* Generated */ case ENUM_CASE(MAType, TA_MAType_EMA, Ema): -/* Generated */ retCode = FUNCTION_CALL(EMA)( startIdx, endIdx, inReal, optInTimePeriod, +/* Generated */ retCode = FUNCTION_CALL(EMA)( startIdx, endIdx, inReal, optInTimePeriod, /* Generated */ outBegIdx, outNBElement, outReal ); /* Generated */ break; /* Generated */ case ENUM_CASE(MAType, TA_MAType_WMA, Wma): @@ -461,7 +461,7 @@ /* Generated */ if( !dummyBuffer ) /* Generated */ return ENUM_VALUE(RetCode,TA_ALLOC_ERR,AllocErr); /* Generated */ #endif -/* Generated */ retCode = FUNCTION_CALL(MAMA)( startIdx, endIdx, inReal, 0.5, 0.05, +/* Generated */ retCode = FUNCTION_CALL(MAMA)( startIdx, endIdx, inReal, 0.5, 0.05, /* Generated */ outBegIdx, outNBElement, /* Generated */ outReal, dummyBuffer ); /* Generated */ ARRAY_FREE( dummyBuffer ); @@ -471,7 +471,7 @@ /* Generated */ optInTimePeriod, 0.7, /* Generated */ outBegIdx, outNBElement, outReal ); /* Generated */ break; -/* Generated */ default: +/* Generated */ default: /* Generated */ retCode = ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam); /* Generated */ break; /* Generated */ } diff --git a/src/ta_func/ta_MACD.c b/src/ta_func/ta_MACD.c index 511efd825..9cc903a1b 100644 --- a/src/ta_func/ta_MACD.c +++ b/src/ta_func/ta_MACD.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -127,7 +127,7 @@ /* The lookback is driven by the signal line output. * - * (must also account for the initial data consume + * (must also account for the initial data consume * by the slow period). */ @@ -267,7 +267,7 @@ /* Generated */ /**** END GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/ - /* Insert TA function code here. */ + /* Insert TA function code here. */ return FUNCTION_CALL(INT_MACD)( startIdx, endIdx, inReal, optInFastPeriod, @@ -348,7 +348,7 @@ TA_RetCode TA_PREFIX(INT_MACD)( int startIdx, int i; /* !!! A lot of speed optimization could be done - * !!! with this function. + * !!! with this function. * !!! * !!! A better approach would be to use TA_INT_EMA * !!! just to get the seeding values for the @@ -362,7 +362,7 @@ TA_RetCode TA_PREFIX(INT_MACD)( int startIdx, * !!! advantage: * !!! 1) One mem allocation needed instead of two. * !!! 2) The mem allocation size will be only the - * !!! signal lookback period instead of the + * !!! signal lookback period instead of the * !!! whole range of data. * !!! 3) Processing will be done in a tight loop. * !!! allowing to avoid a lot of memory store-load @@ -400,7 +400,7 @@ TA_RetCode TA_PREFIX(INT_MACD)( int startIdx, k2 = (double)0.15; /* Fix 12 */ } - lookbackSignal = LOOKBACK_CALL(EMA)( optInSignalPeriod_2 ); + lookbackSignal = LOOKBACK_CALL(EMA)( optInSignalPeriod_2 ); /* Move up the start index if there is not * enough initial data. @@ -442,7 +442,7 @@ TA_RetCode TA_PREFIX(INT_MACD)( int startIdx, } #endif - /* Calculate the slow EMA. + /* Calculate the slow EMA. * * Move back the startIdx to get enough data * for the signal period. That way, once the @@ -478,8 +478,8 @@ TA_RetCode TA_PREFIX(INT_MACD)( int startIdx, } /* Parano tests. Will be removed eventually. */ - if( (VALUE_HANDLE_GET(outBegIdx1) != tempInteger) || - (VALUE_HANDLE_GET(outBegIdx2) != tempInteger) || + if( (VALUE_HANDLE_GET(outBegIdx1) != tempInteger) || + (VALUE_HANDLE_GET(outBegIdx2) != tempInteger) || (VALUE_HANDLE_GET(outNbElement1) != VALUE_HANDLE_GET(outNbElement2)) || (VALUE_HANDLE_GET(outNbElement1) != (endIdx-startIdx)+1+lookbackSignal) ) { @@ -500,7 +500,7 @@ TA_RetCode TA_PREFIX(INT_MACD)( int startIdx, /* Calculate the signal/trigger line. */ retCode = FUNCTION_CALL_DOUBLE(INT_EMA)( 0, VALUE_HANDLE_GET(outNbElement1)-1, - fastEMABuffer, optInSignalPeriod_2, PER_TO_K(optInSignalPeriod_2), + fastEMABuffer, optInSignalPeriod_2, PER_TO_K(optInSignalPeriod_2), VALUE_HANDLE_OUT(outBegIdx2), VALUE_HANDLE_OUT(outNbElement2), outMACDSignal ); @@ -709,7 +709,7 @@ TA_RetCode TA_PREFIX(INT_MACD)( int startIdx, /* Generated */ optInFastPeriod = 12; /* Generated */ k2 = (double)0.15; /* Generated */ } -/* Generated */ lookbackSignal = LOOKBACK_CALL(EMA)( optInSignalPeriod_2 ); +/* Generated */ lookbackSignal = LOOKBACK_CALL(EMA)( optInSignalPeriod_2 ); /* Generated */ lookbackTotal = lookbackSignal; /* Generated */ lookbackTotal += LOOKBACK_CALL(EMA)( optInSlowPeriod ); /* Generated */ if( startIdx < lookbackTotal ) @@ -763,8 +763,8 @@ TA_RetCode TA_PREFIX(INT_MACD)( int startIdx, /* Generated */ ARRAY_FREE( slowEMABuffer ); /* Generated */ return retCode; /* Generated */ } -/* Generated */ if( (VALUE_HANDLE_GET(outBegIdx1) != tempInteger) || -/* Generated */ (VALUE_HANDLE_GET(outBegIdx2) != tempInteger) || +/* Generated */ if( (VALUE_HANDLE_GET(outBegIdx1) != tempInteger) || +/* Generated */ (VALUE_HANDLE_GET(outBegIdx2) != tempInteger) || /* Generated */ (VALUE_HANDLE_GET(outNbElement1) != VALUE_HANDLE_GET(outNbElement2)) || /* Generated */ (VALUE_HANDLE_GET(outNbElement1) != (endIdx-startIdx)+1+lookbackSignal) ) /* Generated */ { @@ -778,7 +778,7 @@ TA_RetCode TA_PREFIX(INT_MACD)( int startIdx, /* Generated */ fastEMABuffer[i] = fastEMABuffer[i] - slowEMABuffer[i]; /* Generated */ ARRAY_MEMMOVE( outMACD, 0, fastEMABuffer, lookbackSignal, (endIdx-startIdx)+1 ); /* Generated */ retCode = FUNCTION_CALL_DOUBLE(INT_EMA)( 0, VALUE_HANDLE_GET(outNbElement1)-1, -/* Generated */ fastEMABuffer, optInSignalPeriod_2, PER_TO_K(optInSignalPeriod_2), +/* Generated */ fastEMABuffer, optInSignalPeriod_2, PER_TO_K(optInSignalPeriod_2), /* Generated */ VALUE_HANDLE_OUT(outBegIdx2), VALUE_HANDLE_OUT(outNbElement2), outMACDSignal ); /* Generated */ ARRAY_FREE( fastEMABuffer ); /* Generated */ ARRAY_FREE( slowEMABuffer ); diff --git a/src/ta_func/ta_MACDEXT.c b/src/ta_func/ta_MACDEXT.c index 321deb90e..c97c4c6d9 100644 --- a/src/ta_func/ta_MACDEXT.c +++ b/src/ta_func/ta_MACDEXT.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -358,7 +358,7 @@ lookbackLargest = tempInteger; /* Add the lookback needed for the signal line */ - lookbackSignal = LOOKBACK_CALL(MA)( optInSignalPeriod, optInSignalMAType ); + lookbackSignal = LOOKBACK_CALL(MA)( optInSignalPeriod, optInSignalMAType ); lookbackTotal = lookbackSignal+lookbackLargest; /* Move up the start index if there is not @@ -390,7 +390,7 @@ ARRAY_ALLOC( slowMABuffer, tempInteger ); #if !defined( _JAVA ) if( !slowMABuffer ) - { + { VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); ARRAY_FREE( fastMABuffer ); @@ -398,7 +398,7 @@ } #endif - /* Calculate the slow MA. + /* Calculate the slow MA. * * Move back the startIdx to get enough data * for the signal period. That way, once the @@ -408,7 +408,7 @@ tempInteger = startIdx-lookbackSignal; retCode = FUNCTION_CALL(MA)( tempInteger, endIdx, inReal, optInSlowPeriod, optInSlowMAType, - VALUE_HANDLE_OUT(outBegIdx1), VALUE_HANDLE_OUT(outNbElement1), + VALUE_HANDLE_OUT(outBegIdx1), VALUE_HANDLE_OUT(outNbElement1), slowMABuffer ); if( retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) @@ -436,8 +436,8 @@ } /* Parano tests. Will be removed eventually. */ - if( (VALUE_HANDLE_GET(outBegIdx1) != tempInteger) || - (VALUE_HANDLE_GET(outBegIdx2) != tempInteger) || + if( (VALUE_HANDLE_GET(outBegIdx1) != tempInteger) || + (VALUE_HANDLE_GET(outBegIdx2) != tempInteger) || (VALUE_HANDLE_GET(outNbElement1) != VALUE_HANDLE_GET(outNbElement2)) || (VALUE_HANDLE_GET(outNbElement1) != (endIdx-startIdx)+1+lookbackSignal) ) { @@ -624,7 +624,7 @@ /* Generated */ tempInteger = LOOKBACK_CALL(MA)( optInSlowPeriod, optInSlowMAType ); /* Generated */ if( tempInteger > lookbackLargest ) /* Generated */ lookbackLargest = tempInteger; -/* Generated */ lookbackSignal = LOOKBACK_CALL(MA)( optInSignalPeriod, optInSignalMAType ); +/* Generated */ lookbackSignal = LOOKBACK_CALL(MA)( optInSignalPeriod, optInSignalMAType ); /* Generated */ lookbackTotal = lookbackSignal+lookbackLargest; /* Generated */ if( startIdx < lookbackTotal ) /* Generated */ startIdx = lookbackTotal; @@ -647,7 +647,7 @@ /* Generated */ ARRAY_ALLOC( slowMABuffer, tempInteger ); /* Generated */ #if !defined( _JAVA ) /* Generated */ if( !slowMABuffer ) -/* Generated */ { +/* Generated */ { /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); /* Generated */ ARRAY_FREE( fastMABuffer ); @@ -657,7 +657,7 @@ /* Generated */ tempInteger = startIdx-lookbackSignal; /* Generated */ retCode = FUNCTION_CALL(MA)( tempInteger, endIdx, /* Generated */ inReal, optInSlowPeriod, optInSlowMAType, -/* Generated */ VALUE_HANDLE_OUT(outBegIdx1), VALUE_HANDLE_OUT(outNbElement1), +/* Generated */ VALUE_HANDLE_OUT(outBegIdx1), VALUE_HANDLE_OUT(outNbElement1), /* Generated */ slowMABuffer ); /* Generated */ if( retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) /* Generated */ { @@ -679,8 +679,8 @@ /* Generated */ ARRAY_FREE( slowMABuffer ); /* Generated */ return retCode; /* Generated */ } -/* Generated */ if( (VALUE_HANDLE_GET(outBegIdx1) != tempInteger) || -/* Generated */ (VALUE_HANDLE_GET(outBegIdx2) != tempInteger) || +/* Generated */ if( (VALUE_HANDLE_GET(outBegIdx1) != tempInteger) || +/* Generated */ (VALUE_HANDLE_GET(outBegIdx2) != tempInteger) || /* Generated */ (VALUE_HANDLE_GET(outNbElement1) != VALUE_HANDLE_GET(outNbElement2)) || /* Generated */ (VALUE_HANDLE_GET(outNbElement1) != (endIdx-startIdx)+1+lookbackSignal) ) /* Generated */ { diff --git a/src/ta_func/ta_MACDFIX.c b/src/ta_func/ta_MACDFIX.c index 3584e3a5e..d7337fa8c 100644 --- a/src/ta_func/ta_MACDFIX.c +++ b/src/ta_func/ta_MACDFIX.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -107,7 +107,7 @@ /* The lookback is driven by the signal line output. * - * (must also account for the initial data consume + * (must also account for the initial data consume * by the fix 26 period EMA). */ return LOOKBACK_CALL(EMA)( 26 ) diff --git a/src/ta_func/ta_MAMA.c b/src/ta_func/ta_MAMA.c index f229cbb03..d0f2138a5 100644 --- a/src/ta_func/ta_MAMA.c +++ b/src/ta_func/ta_MAMA.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -114,7 +114,7 @@ /* insert lookback code here. */ /* The two parameters are not a factor to determine - * the lookback, but are still requested for + * the lookback, but are still requested for * consistency with all other Lookback functions. */ UNUSED_VARIABLE(optInFastLimit); @@ -124,7 +124,7 @@ * * * The fix lookback is 32 and is establish as follow: - * + * * 12 price bar to be compatible with the implementation * of TradeStation found in John Ehlers book. * 6 price bars for the Detrender @@ -338,10 +338,10 @@ } while( --i != 0); /* Initialize the circular buffers used by the hilbert - * transform logic. + * transform logic. * A buffer is used for odd day and another for even days. * This minimize the number of memory access and floating point - * operations needed (note also that by using static circular buffer, + * operations needed (note also that by using static circular buffer, * no large dynamic memory allocation is needed for storing * intermediate calculation!). */ @@ -366,7 +366,7 @@ /* The code is speed optimized and is most likely very * hard to follow if you do not already know well the * original algorithm. - * To understadn better, it is strongly suggested to look + * To understadn better, it is strongly suggested to look * first at the Excel implementation in "test_MAMA.xls" included * in this package. */ @@ -391,7 +391,7 @@ I2 = (0.2*(I1ForEvenPrev3 - jQ)) + (0.8*prevI2); /* The variable I1 is the detrender delayed for - * 3 price bars. + * 3 price bars. * * Save the current detrender value for being * used by the "odd" logic later. @@ -417,7 +417,7 @@ I2 = (0.2*(I1ForOddPrev3 - jQ)) + (0.8*prevI2); /* The varaiable I1 is the detrender delayed for - * 3 price bars. + * 3 price bars. * * Save the current detrender value for being * used by the "odd" logic later. @@ -448,7 +448,7 @@ else { tempReal = optInFastLimit; - } + } /* Calculate MAMA, FAMA */ mama = (tempReal*todayValue)+((1-tempReal)*mama); @@ -684,7 +684,7 @@ /* Generated */ else /* Generated */ { /* Generated */ tempReal = optInFastLimit; -/* Generated */ } +/* Generated */ } /* Generated */ mama = (tempReal*todayValue)+((1-tempReal)*mama); /* Generated */ tempReal *= 0.5; /* Generated */ fama = (tempReal*mama)+((1-tempReal)*fama); diff --git a/src/ta_func/ta_MAVP.c b/src/ta_func/ta_MAVP.c index 349b5286d..c9e343c64 100644 --- a/src/ta_func/ta_MAVP.c +++ b/src/ta_func/ta_MAVP.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -115,7 +115,7 @@ /* Generated */ #endif /* !defined(_MANAGED) && !defined(_JAVA)*/ /* Generated */ #endif /* TA_FUNC_NO_RANGE_CHECK */ /**** END GENCODE SECTION 2 - DO NOT DELETE THIS LINE ****/ - + return LOOKBACK_CALL(MA)(optInMaxPeriod, optInMAType); } @@ -258,7 +258,7 @@ return ENUM_VALUE(RetCode,TA_SUCCESS,Success); } - /* Calculate exact output size */ + /* Calculate exact output size */ if( lookbackTotal > startIdx ) tempInt = lookbackTotal; else @@ -268,8 +268,8 @@ /* No output */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); - return ENUM_VALUE(RetCode,TA_SUCCESS,Success); - } + return ENUM_VALUE(RetCode,TA_SUCCESS,Success); + } outputSize = endIdx - tempInt + 1; /* Allocate intermediate local buffer. */ @@ -289,22 +289,22 @@ localPeriodArray[i] = tempInt; } - /* Process each element of the input. - * For each possible period value, the MA is calculated + /* Process each element of the input. + * For each possible period value, the MA is calculated * only once. * The outReal is then fill up for all element with * the same period. * A local flag (value 0) is set in localPeriodArray * to avoid doing a second time the same calculation. - */ + */ for( i=0; i < outputSize; i++ ) { curPeriod = localPeriodArray[i]; if( curPeriod != 0 ) { - /* TODO: This portion of the function can be slightly speed - * optimized by making the function without unstable period - * start their calculation at 'startIdx+i' instead of startIdx. + /* TODO: This portion of the function can be slightly speed + * optimized by making the function without unstable period + * start their calculation at 'startIdx+i' instead of startIdx. */ /* Calculation of the MA required. */ @@ -320,7 +320,7 @@ VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); return retCode; } - + outReal[i] = localOutputArray[i]; for( j=i+1; j < outputSize; j++ ) { @@ -329,7 +329,7 @@ localPeriodArray[j] = 0; /* Flag to avoid recalculation */ outReal[j] = localOutputArray[j]; } - } + } } } @@ -448,8 +448,8 @@ /* 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 */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success); +/* Generated */ } /* Generated */ outputSize = endIdx - tempInt + 1; /* Generated */ ARRAY_ALLOC(localOutputArray,outputSize); /* Generated */ ARRAY_INT_ALLOC(localPeriodArray,outputSize); @@ -486,7 +486,7 @@ /* Generated */ localPeriodArray[j] = 0; /* Generated */ outReal[j] = localOutputArray[j]; /* Generated */ } -/* Generated */ } +/* Generated */ } /* Generated */ } /* Generated */ } /* Generated */ ARRAY_FREE(localOutputArray); diff --git a/src/ta_func/ta_MAX.c b/src/ta_func/ta_MAX.c index 45761a0bb..f7116ebd8 100644 --- a/src/ta_func/ta_MAX.c +++ b/src/ta_func/ta_MAX.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -106,7 +106,7 @@ /**** END GENCODE SECTION 2 - DO NOT DELETE THIS LINE ****/ /* insert lookback code here. */ - + return (optInTimePeriod-1); } @@ -253,7 +253,7 @@ outReal[outIdx++] = highest; trailingIdx++; - today++; + today++; } /* Keep the outBegIdx relative to the @@ -367,7 +367,7 @@ /* Generated */ } /* Generated */ outReal[outIdx++] = highest; /* Generated */ trailingIdx++; -/* Generated */ today++; +/* Generated */ today++; /* Generated */ } /* Generated */ VALUE_HANDLE_DEREF(outBegIdx) = startIdx; /* Generated */ VALUE_HANDLE_DEREF(outNBElement) = outIdx; diff --git a/src/ta_func/ta_MAXINDEX.c b/src/ta_func/ta_MAXINDEX.c index 728bab4ce..ddd47ea7d 100644 --- a/src/ta_func/ta_MAXINDEX.c +++ b/src/ta_func/ta_MAXINDEX.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -102,7 +102,7 @@ /**** END GENCODE SECTION 2 - DO NOT DELETE THIS LINE ****/ /* insert lookback code here. */ - + return (optInTimePeriod-1); } @@ -248,7 +248,7 @@ outInteger[outIdx++] = highestIdx; trailingIdx++; - today++; + today++; } /* Keep the outBegIdx relative to the @@ -362,7 +362,7 @@ /* Generated */ } /* Generated */ outInteger[outIdx++] = highestIdx; /* Generated */ trailingIdx++; -/* Generated */ today++; +/* Generated */ today++; /* Generated */ } /* Generated */ VALUE_HANDLE_DEREF(outBegIdx) = startIdx; /* Generated */ VALUE_HANDLE_DEREF(outNBElement) = outIdx; diff --git a/src/ta_func/ta_MEDPRICE.c b/src/ta_func/ta_MEDPRICE.c index 0252219e1..7442e17cf 100644 --- a/src/ta_func/ta_MEDPRICE.c +++ b/src/ta_func/ta_MEDPRICE.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -177,7 +177,7 @@ /* Insert TA function code here. */ - /* MEDPRICE = (High + Low ) / 2 + /* MEDPRICE = (High + Low ) / 2 * This is the high and low of the same price bar. * * See MIDPRICE to use instead the highest high and lowest diff --git a/src/ta_func/ta_MFI.c b/src/ta_func/ta_MFI.c index 3572c59c1..0f995321a 100644 --- a/src/ta_func/ta_MFI.c +++ b/src/ta_func/ta_MFI.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -229,11 +229,11 @@ /* Insert TA function code here. */ - CIRCBUF_INIT_CLASS( mflow, MoneyFlow, optInTimePeriod ); + CIRCBUF_INIT_CLASS( mflow, MoneyFlow, optInTimePeriod ); VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); - + /* Adjust startIdx to account for the lookback period. */ lookbackTotal = optInTimePeriod + TA_GLOBALS_UNSTABLE_PERIOD(TA_FUNC_UNST_MFI,Mfi); @@ -284,7 +284,7 @@ CIRCBUF_NEXT(mflow); } - + /* The following two equations are equivalent: * MFI = 100 - (100 / 1 + (posSumMF/negSumMF)) * MFI = 100 * (posSumMF/(posSumMF+negSumMF)) @@ -300,9 +300,9 @@ } else { - /* Skip the unstable period. Do the processing + /* Skip the unstable period. Do the processing * but do not write it in the output. - */ + */ while( today < startIdx ) { posSumMF -= CIRCBUF_REF(mflow[mflow_Idx])positive; @@ -458,7 +458,7 @@ /* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam); /* Generated */ #endif /* Generated */ #endif -/* Generated */ CIRCBUF_INIT_CLASS( mflow, MoneyFlow, optInTimePeriod ); +/* Generated */ CIRCBUF_INIT_CLASS( mflow, MoneyFlow, optInTimePeriod ); /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); /* Generated */ lookbackTotal = optInTimePeriod + TA_GLOBALS_UNSTABLE_PERIOD(TA_FUNC_UNST_MFI,Mfi); diff --git a/src/ta_func/ta_MIDPOINT.c b/src/ta_func/ta_MIDPOINT.c index aaa1ba31d..37ae973b2 100644 --- a/src/ta_func/ta_MIDPOINT.c +++ b/src/ta_func/ta_MIDPOINT.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -228,7 +228,7 @@ outIdx = 0; today = startIdx; trailingIdx = startIdx-nbInitialElementNeeded; - + while( today <= endIdx ) { lowest = inReal[trailingIdx++]; diff --git a/src/ta_func/ta_MIDPRICE.c b/src/ta_func/ta_MIDPRICE.c index 1b86330b5..023008033 100644 --- a/src/ta_func/ta_MIDPRICE.c +++ b/src/ta_func/ta_MIDPRICE.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -232,7 +232,7 @@ outIdx = 0; today = startIdx; trailingIdx = startIdx-nbInitialElementNeeded; - + while( today <= endIdx ) { lowest = inLow[trailingIdx]; diff --git a/src/ta_func/ta_MIN.c b/src/ta_func/ta_MIN.c index 3df1c53b0..fe3f06599 100644 --- a/src/ta_func/ta_MIN.c +++ b/src/ta_func/ta_MIN.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -225,7 +225,7 @@ trailingIdx = startIdx-nbInitialElementNeeded; lowestIdx = -1; lowest = 0.0; - + while( today <= endIdx ) { tmp = inReal[today]; @@ -253,7 +253,7 @@ outReal[outIdx++] = lowest; trailingIdx++; - today++; + today++; } /* Keep the outBegIdx relative to the @@ -367,7 +367,7 @@ /* Generated */ } /* Generated */ outReal[outIdx++] = lowest; /* Generated */ trailingIdx++; -/* Generated */ today++; +/* Generated */ today++; /* Generated */ } /* Generated */ VALUE_HANDLE_DEREF(outBegIdx) = startIdx; /* Generated */ VALUE_HANDLE_DEREF(outNBElement) = outIdx; diff --git a/src/ta_func/ta_MININDEX.c b/src/ta_func/ta_MININDEX.c index e859f2095..a93aaf1dc 100644 --- a/src/ta_func/ta_MININDEX.c +++ b/src/ta_func/ta_MININDEX.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -220,7 +220,7 @@ trailingIdx = startIdx-nbInitialElementNeeded; lowestIdx = -1; lowest = 0.0; - + while( today <= endIdx ) { tmp = inReal[today]; @@ -248,7 +248,7 @@ outInteger[outIdx++] = lowestIdx; trailingIdx++; - today++; + today++; } /* Keep the outBegIdx relative to the @@ -362,7 +362,7 @@ /* Generated */ } /* Generated */ outInteger[outIdx++] = lowestIdx; /* Generated */ trailingIdx++; -/* Generated */ today++; +/* Generated */ today++; /* Generated */ } /* Generated */ VALUE_HANDLE_DEREF(outBegIdx) = startIdx; /* Generated */ VALUE_HANDLE_DEREF(outNBElement) = outIdx; diff --git a/src/ta_func/ta_MINMAX.c b/src/ta_func/ta_MINMAX.c index d34c764ef..1175e4dc0 100644 --- a/src/ta_func/ta_MINMAX.c +++ b/src/ta_func/ta_MINMAX.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -102,7 +102,7 @@ /**** END GENCODE SECTION 2 - DO NOT DELETE THIS LINE ****/ /* insert lookback code here. */ - + return (optInTimePeriod-1); } @@ -280,7 +280,7 @@ outMin[outIdx] = lowest; outIdx++; trailingIdx++; - today++; + today++; } /* Keep the outBegIdx relative to the @@ -424,7 +424,7 @@ /* Generated */ outMin[outIdx] = lowest; /* Generated */ outIdx++; /* Generated */ trailingIdx++; -/* Generated */ today++; +/* Generated */ today++; /* Generated */ } /* Generated */ VALUE_HANDLE_DEREF(outBegIdx) = startIdx; /* Generated */ VALUE_HANDLE_DEREF(outNBElement) = outIdx; diff --git a/src/ta_func/ta_MINMAXINDEX.c b/src/ta_func/ta_MINMAXINDEX.c index 1c7236ed6..aac7c6a50 100644 --- a/src/ta_func/ta_MINMAXINDEX.c +++ b/src/ta_func/ta_MINMAXINDEX.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -102,7 +102,7 @@ /**** END GENCODE SECTION 2 - DO NOT DELETE THIS LINE ****/ /* insert lookback code here. */ - + return (optInTimePeriod-1); } @@ -280,7 +280,7 @@ outMinIdx[outIdx] = lowestIdx; outIdx++; trailingIdx++; - today++; + today++; } /* Keep the outBegIdx relative to the @@ -424,7 +424,7 @@ /* Generated */ outMinIdx[outIdx] = lowestIdx; /* Generated */ outIdx++; /* Generated */ trailingIdx++; -/* Generated */ today++; +/* Generated */ today++; /* Generated */ } /* Generated */ VALUE_HANDLE_DEREF(outBegIdx) = startIdx; /* Generated */ VALUE_HANDLE_DEREF(outNBElement) = outIdx; diff --git a/src/ta_func/ta_MINUS_DI.c b/src/ta_func/ta_MINUS_DI.c index 8bb5570b5..9719b66f0 100644 --- a/src/ta_func/ta_MINUS_DI.c +++ b/src/ta_func/ta_MINUS_DI.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -225,10 +225,10 @@ /* Insert TA function code here. */ - /* + /* * The DM1 (one period) is base on the largest part of * today's range that is outside of yesterdays range. - * + * * The following 7 cases explain how the +DM and -DM are * calculated on one period: * @@ -237,8 +237,8 @@ * | | C| * | +DM1 = (C-A) B| | +DM1 = 0 * | -DM1 = 0 | -DM1 = (B-D) - * A| | D| - * | D| + * A| | D| + * | D| * B| * * Case 3: Case 4: @@ -246,11 +246,11 @@ * | A| | * | +DM1 = (C-A) | | +DM1 = 0 * | -DM1 = 0 B| | -DM1 = (B-D) - * A| | | + * A| | | * | | D| * B| | * D| - * + * * Case 5: Case 6: * A| A| C| * | C| +DM1 = 0 | | +DM1 = 0 @@ -260,7 +260,7 @@ * * * Case 7: - * + * * C| * A| | * | | +DM1=0 @@ -277,18 +277,18 @@ * equal the lows). * * When calculating the DM over a period > 1, the one-period DM - * for the desired period are initialy sum. In other word, - * for a -DM14, sum the -DM1 for the first 14 days (that's + * for the desired period are initialy sum. In other word, + * for a -DM14, sum the -DM1 for the first 14 days (that's * 13 values because there is no DM for the first day!) * Subsequent DM are calculated using the Wilder's * smoothing approach: - * + * * Previous -DM14 * Today's -DM14 = Previous -DM14 - -------------- + Today's -DM1 * 14 * * Calculation of a -DI14 is as follow: - * + * * -DM14 * -DI14 = -------- * TR14 @@ -311,7 +311,7 @@ * * This was understandable in the context that at the time the book * was written, most user were doing the calculation by hand. - * + * * For a computer, rounding is unnecessary (and even problematic when inputs * are close to 1). * @@ -358,7 +358,7 @@ prevLow = inLow[today]; prevClose = inClose[today]; while( today < endIdx ) - { + { today++; tempReal = inHigh[today]; diffP = tempReal-prevHigh; /* Plus Delta */ @@ -368,7 +368,7 @@ prevLow = tempReal; if( (diffM > 0) && (diffP < diffM) ) { - /* Case 2 and 4: +DM=0,-DM=diffM */ + /* Case 2 and 4: +DM=0,-DM=diffM */ TRUE_RANGE(prevHigh,prevLow,prevClose,tempReal); if( TA_IS_ZERO(tempReal) ) outReal[outIdx++] = (double)0.0; @@ -602,7 +602,7 @@ /* Generated */ prevLow = inLow[today]; /* Generated */ prevClose = inClose[today]; /* Generated */ while( today < endIdx ) -/* Generated */ { +/* Generated */ { /* Generated */ today++; /* Generated */ tempReal = inHigh[today]; /* Generated */ diffP = tempReal-prevHigh; diff --git a/src/ta_func/ta_MINUS_DM.c b/src/ta_func/ta_MINUS_DM.c index ae584bd8f..f564a90cc 100644 --- a/src/ta_func/ta_MINUS_DM.c +++ b/src/ta_func/ta_MINUS_DM.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -204,10 +204,10 @@ /* Insert TA function code here. */ - /* + /* * The DM1 (one period) is base on the largest part of * today's range that is outside of yesterdays range. - * + * * The following 7 cases explain how the +DM and -DM are * calculated on one period: * @@ -216,8 +216,8 @@ * | | C| * | +DM1 = (C-A) B| | +DM1 = 0 * | -DM1 = 0 | -DM1 = (B-D) - * A| | D| - * | D| + * A| | D| + * | D| * B| * * Case 3: Case 4: @@ -225,11 +225,11 @@ * | A| | * | +DM1 = (C-A) | | +DM1 = 0 * | -DM1 = 0 B| | -DM1 = (B-D) - * A| | | + * A| | | * | | D| * B| | * D| - * + * * Case 5: Case 6: * A| A| C| * | C| +DM1 = 0 | | +DM1 = 0 @@ -239,7 +239,7 @@ * * * Case 7: - * + * * C| * A| | * | | +DM=0 @@ -256,12 +256,12 @@ * equal the lows). * * When calculating the DM over a period > 1, the one-period DM - * for the desired period are initialy sum. In other word, - * for a -DM14, sum the -DM1 for the first 14 days (that's + * for the desired period are initialy sum. In other word, + * for a -DM14, sum the -DM1 for the first 14 days (that's * 13 values because there is no DM for the first day!) * Subsequent DM are calculated using the Wilder's * smoothing approach: - * + * * Previous -DM14 * Today's -DM14 = Previous -DM14 - -------------- + Today's -DM1 * 14 @@ -303,7 +303,7 @@ prevHigh = inHigh[today]; prevLow = inLow[today]; while( today < endIdx ) - { + { today++; tempReal = inHigh[today]; diffP = tempReal-prevHigh; /* Plus Delta */ @@ -499,7 +499,7 @@ /* Generated */ prevHigh = inHigh[today]; /* Generated */ prevLow = inLow[today]; /* Generated */ while( today < endIdx ) -/* Generated */ { +/* Generated */ { /* Generated */ today++; /* Generated */ tempReal = inHigh[today]; /* Generated */ diffP = tempReal-prevHigh; diff --git a/src/ta_func/ta_MOM.c b/src/ta_func/ta_MOM.c index 9efa39c02..8be66ff5b 100644 --- a/src/ta_func/ta_MOM.c +++ b/src/ta_func/ta_MOM.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -204,20 +204,20 @@ * ROCR100 = (price/prevPrice)*100 [Rate of change ratio 100 Scale] * * Here are the equivalent function in other software: - * TA-Lib | Tradestation | Metastock + * TA-Lib | Tradestation | Metastock * ================================================= * MOM | Momentum | ROC (Point) * ROC | ROC | ROC (Percent) - * ROCP | PercentChange | - + * ROCP | PercentChange | - * ROCR | - | - * ROCR100 | - | MO * * The MOM function is the only one who is not normalized, and thus * should be avoided for comparing different time serie of prices. - * + * * ROC and ROCP are centered at zero and can have positive and negative * value. Here are some equivalence: - * ROC = ROCP/100 + * ROC = ROCP/100 * = ((price-prevPrice)/prevPrice)/100 * = ((price/prevPrice)-1)*100 * diff --git a/src/ta_func/ta_MULT.c b/src/ta_func/ta_MULT.c index d61cff0af..2e6b45d9d 100644 --- a/src/ta_func/ta_MULT.c +++ b/src/ta_func/ta_MULT.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_NATR.c b/src/ta_func/ta_NATR.c index 825143a93..aedb782f5 100644 --- a/src/ta_func/ta_NATR.c +++ b/src/ta_func/ta_NATR.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -225,16 +225,16 @@ * - Long term analysis where the price changes drastically. * - Cross-market or cross-security ATR comparison. * - * More Info: + * More Info: * Technical Analysis of Stock & Commodities (TASC) * May 2006 by John Forman */ - /* Average True Range is the greatest of the following: + /* Average True Range is the greatest of the following: * * val1 = distance from today's high to today's low. * val2 = distance from yesterday's close to today's high. - * val3 = distance from yesterday's close to today's low. + * val3 = distance from yesterday's close to today's low. * * These value are averaged for the specified period using * Wilder method. This method have an unstable period comparable @@ -289,28 +289,28 @@ if( retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) { ARRAY_FREE( tempBuffer ); - return retCode; + return retCode; } prevATR = prevATRTemp[0]; /* Subsequent value are smoothed using the * previous ATR value (Wilder's approach). - * 1) Multiply the previous ATR by 'period-1'. - * 2) Add today TR value. + * 1) Multiply the previous ATR by 'period-1'. + * 2) Add today TR value. * 3) Divide by 'period'. */ today = optInTimePeriod; outIdx = TA_GLOBALS_UNSTABLE_PERIOD(TA_FUNC_UNST_NATR,Natr); /* Skip the unstable period. */ while( outIdx != 0 ) - { + { prevATR *= optInTimePeriod - 1; prevATR += tempBuffer[today++]; prevATR /= optInTimePeriod; outIdx--; } - /* Now start to write the final ATR in the caller + /* Now start to write the final ATR in the caller * provided outReal. */ outIdx = 1; @@ -322,7 +322,7 @@ /* Now do the number of requested ATR. */ nbATR = (endIdx - startIdx)+1; - + while( --nbATR != 0 ) { prevATR *= optInTimePeriod - 1; @@ -338,9 +338,9 @@ VALUE_HANDLE_DEREF(outBegIdx) = startIdx; VALUE_HANDLE_DEREF(outNBElement) = outIdx; - + ARRAY_FREE( tempBuffer ); - + return retCode; } @@ -452,13 +452,13 @@ /* Generated */ if( retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) /* Generated */ { /* Generated */ ARRAY_FREE( tempBuffer ); -/* Generated */ return retCode; +/* Generated */ return retCode; /* Generated */ } /* Generated */ prevATR = prevATRTemp[0]; /* Generated */ today = optInTimePeriod; /* Generated */ outIdx = TA_GLOBALS_UNSTABLE_PERIOD(TA_FUNC_UNST_NATR,Natr); /* Generated */ while( outIdx != 0 ) -/* Generated */ { +/* Generated */ { /* Generated */ prevATR *= optInTimePeriod - 1; /* Generated */ prevATR += tempBuffer[today++]; /* Generated */ prevATR /= optInTimePeriod; diff --git a/src/ta_func/ta_NVI.c b/src/ta_func/ta_NVI.c index 2cdbbdf4d..8e742f443 100644 --- a/src/ta_func/ta_NVI.c +++ b/src/ta_func/ta_NVI.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -51,7 +51,7 @@ * generated by gen_code. Any modification will be lost * next time gen_code is run. */ -/* Generated */ +/* Generated */ /* Generated */ #if defined( _MANAGED ) /* Generated */ #using /* Generated */ #include "Core.h" @@ -62,24 +62,24 @@ /* Generated */ #include /* Generated */ #include "ta_func.h" /* Generated */ #endif -/* Generated */ +/* Generated */ /* Generated */ #ifndef TA_UTILITY_H /* Generated */ #include "ta_utility.h" /* Generated */ #endif -/* Generated */ +/* Generated */ /* Generated */ #ifndef TA_MEMORY_H /* Generated */ #include "ta_memory.h" /* Generated */ #endif -/* Generated */ +/* Generated */ /* Generated */ #define TA_PREFIX(x) TA_##x /* Generated */ #define INPUT_TYPE double -/* Generated */ +/* Generated */ /* Generated */ #if defined( _MANAGED ) /* Generated */ int Core::NVI_Lookback( /* Generated */ void ) -/* Generated */ +/* Generated */ /* Generated */ #else /* Generated */ int TA_NVI_Lookback( /* Generated */ void ) -/* Generated */ +/* Generated */ /* Generated */ #endif /**** END GENCODE SECTION 1 - DO NOT DELETE THIS LINE ****/ { @@ -90,12 +90,12 @@ /**** START GENCODE SECTION 3 - DO NOT DELETE THIS LINE ****/ /* * TA_NVI - Negative Volume Index - * + * * Input = Close, Volume * Output = double - * + * */ -/* Generated */ +/* Generated */ /* Generated */ #if defined( _MANAGED ) /* Generated */ enum Core::TA_RetCode Core::NVI( int startIdx, /* Generated */ int endIdx, @@ -118,25 +118,25 @@ /* insert local variable here */ /**** START GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/ -/* Generated */ +/* Generated */ /* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK -/* Generated */ +/* Generated */ /* Generated */ /* Validate the requested output range. */ /* 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 */ +/* Generated */ /* Generated */ /* Validate the parameters. */ /* Generated */ /* Verify required price component. */ /* Generated */ if(!inClose||!inVolume) /* Generated */ return TA_BAD_PARAM; -/* Generated */ +/* Generated */ /* Generated */ if( outReal == NULL ) /* Generated */ return TA_BAD_PARAM; -/* Generated */ +/* Generated */ /* Generated */ #endif /* TA_FUNC_NO_RANGE_CHECK */ -/* Generated */ +/* Generated */ /**** END GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/ /* Insert TA function code here. */ @@ -149,7 +149,7 @@ } /**** START GENCODE SECTION 5 - DO NOT DELETE THIS LINE ****/ -/* Generated */ +/* Generated */ /* Generated */ #define USE_SINGLE_PRECISION_INPUT /* Generated */ #if !defined( _MANAGED ) /* Generated */ #undef TA_PREFIX @@ -184,12 +184,12 @@ /* Generated */ return TA_BAD_PARAM; /* Generated */ if( outReal == NULL ) /* Generated */ return TA_BAD_PARAM; -/* Generated */ #endif +/* Generated */ #endif /* Generated */ *outBegIdx = 0; /* Generated */ *outNBElement = 0; /* Generated */ return TA_SUCCESS; /* Generated */ } -/* Generated */ +/* Generated */ /* Generated */ #if defined( _MANAGED ) /* Generated */ }} // Close namespace TA.Lib /* Generated */ #endif diff --git a/src/ta_func/ta_OBV.c b/src/ta_func/ta_OBV.c index 718dd990f..bad1ba230 100644 --- a/src/ta_func/ta_OBV.c +++ b/src/ta_func/ta_OBV.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_PLUS_DI.c b/src/ta_func/ta_PLUS_DI.c index 04e9ed3dd..09ed15d41 100644 --- a/src/ta_func/ta_PLUS_DI.c +++ b/src/ta_func/ta_PLUS_DI.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -224,10 +224,10 @@ /**** END GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/ /* Insert TA function code here. */ - /* + /* * The DM1 (one period) is base on the largest part of * today's range that is outside of yesterdays range. - * + * * The following 7 cases explain how the +DM and -DM are * calculated on one period: * @@ -236,8 +236,8 @@ * | | C| * | +DM1 = (C-A) B| | +DM1 = 0 * | -DM1 = 0 | -DM1 = (B-D) - * A| | D| - * | D| + * A| | D| + * | D| * B| * * Case 3: Case 4: @@ -245,11 +245,11 @@ * | A| | * | +DM1 = (C-A) | | +DM1 = 0 * | -DM1 = 0 B| | -DM1 = (B-D) - * A| | | + * A| | | * | | D| * B| | * D| - * + * * Case 5: Case 6: * A| A| C| * | C| +DM1 = 0 | | +DM1 = 0 @@ -259,7 +259,7 @@ * * * Case 7: - * + * * C| * A| | * | | +DM1=0 @@ -276,18 +276,18 @@ * equal the lows). * * When calculating the DM over a period > 1, the one-period DM - * for the desired period are initialy sum. In other word, - * for a -DM14, sum the -DM1 for the first 14 days (that's + * for the desired period are initialy sum. In other word, + * for a -DM14, sum the -DM1 for the first 14 days (that's * 13 values because there is no DM for the first day!) * Subsequent DM are calculated using the Wilder's * smoothing approach: - * + * * Previous +DM14 * Today's +DM14 = Previous +DM14 - -------------- + Today's +DM1 * 14 * * Calculation of a +DI14 is as follow: - * + * * +DM14 * +DI14 = -------- * TR14 @@ -310,7 +310,7 @@ * * This was understandable in the context that at the time the book * was written, most user were doing the calculation by hand. - * + * * For a computer, rounding is unnecessary (and even problematic when inputs * are close to 1). * @@ -357,7 +357,7 @@ prevLow = inLow[today]; prevClose = inClose[today]; while( today < endIdx ) - { + { today++; tempReal = inHigh[today]; diffP = tempReal-prevHigh; /* Plus Delta */ @@ -488,7 +488,7 @@ outReal[outIdx++] = round_pos(100.0*(prevPlusDM/prevTR)); else outReal[outIdx++] = 0.0; - + } VALUE_HANDLE_DEREF(outNBElement) = outIdx; @@ -602,7 +602,7 @@ /* Generated */ prevLow = inLow[today]; /* Generated */ prevClose = inClose[today]; /* Generated */ while( today < endIdx ) -/* Generated */ { +/* Generated */ { /* Generated */ today++; /* Generated */ tempReal = inHigh[today]; /* Generated */ diffP = tempReal-prevHigh; diff --git a/src/ta_func/ta_PLUS_DM.c b/src/ta_func/ta_PLUS_DM.c index 9015d96b5..7528362d0 100644 --- a/src/ta_func/ta_PLUS_DM.c +++ b/src/ta_func/ta_PLUS_DM.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -205,10 +205,10 @@ /* Insert TA function code here. */ - /* + /* * The DM1 (one period) is base on the largest part of * today's range that is outside of yesterdays range. - * + * * The following 7 cases explain how the +DM and -DM are * calculated on one period: * @@ -217,8 +217,8 @@ * | | C| * | +DM1 = (C-A) B| | +DM1 = 0 * | -DM1 = 0 | -DM1 = (B-D) - * A| | D| - * | D| + * A| | D| + * | D| * B| * * Case 3: Case 4: @@ -226,11 +226,11 @@ * | A| | * | +DM1 = (C-A) | | +DM1 = 0 * | -DM1 = 0 B| | -DM1 = (B-D) - * A| | | + * A| | | * | | D| * B| | * D| - * + * * Case 5: Case 6: * A| A| C| * | C| +DM1 = 0 | | +DM1 = 0 @@ -240,7 +240,7 @@ * * * Case 7: - * + * * C| * A| | * | | +DM=0 @@ -257,12 +257,12 @@ * equal the lows). * * When calculating the DM over a period > 1, the one-period DM - * for the desired period are initialy sum. In other word, - * for a +DM14, sum the +DM1 for the first 14 days (that's + * for the desired period are initialy sum. In other word, + * for a +DM14, sum the +DM1 for the first 14 days (that's * 13 values because there is no DM for the first day!) * Subsequent DM are calculated using the Wilder's * smoothing approach: - * + * * Previous +DM14 * Today's +DM14 = Previous +DM14 - -------------- + Today's +DM1 * 14 @@ -304,7 +304,7 @@ prevHigh = inHigh[today]; prevLow = inLow[today]; while( today < endIdx ) - { + { today++; tempReal = inHigh[today]; diffP = tempReal-prevHigh; /* Plus Delta */ @@ -500,7 +500,7 @@ /* Generated */ prevHigh = inHigh[today]; /* Generated */ prevLow = inLow[today]; /* Generated */ while( today < endIdx ) -/* Generated */ { +/* Generated */ { /* Generated */ today++; /* Generated */ tempReal = inHigh[today]; /* Generated */ diffP = tempReal-prevHigh; diff --git a/src/ta_func/ta_PPO.c b/src/ta_func/ta_PPO.c index a25d1c98f..dd3954a7b 100644 --- a/src/ta_func/ta_PPO.c +++ b/src/ta_func/ta_PPO.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -255,7 +255,7 @@ 1 /* Do percentage processing. */ ); ARRAY_FREE( tempBuffer ); - + return retCode; } diff --git a/src/ta_func/ta_PVI.c b/src/ta_func/ta_PVI.c index 86d86914f..a9b0951c3 100644 --- a/src/ta_func/ta_PVI.c +++ b/src/ta_func/ta_PVI.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -51,7 +51,7 @@ * generated by gen_code. Any modification will be lost * next time gen_code is run. */ -/* Generated */ +/* Generated */ /* Generated */ #if defined( _MANAGED ) /* Generated */ #using /* Generated */ #include "Core.h" @@ -62,24 +62,24 @@ /* Generated */ #include /* Generated */ #include "ta_func.h" /* Generated */ #endif -/* Generated */ +/* Generated */ /* Generated */ #ifndef TA_UTILITY_H /* Generated */ #include "ta_utility.h" /* Generated */ #endif -/* Generated */ +/* Generated */ /* Generated */ #ifndef TA_MEMORY_H /* Generated */ #include "ta_memory.h" /* Generated */ #endif -/* Generated */ +/* Generated */ /* Generated */ #define TA_PREFIX(x) TA_##x /* Generated */ #define INPUT_TYPE double -/* Generated */ +/* Generated */ /* Generated */ #if defined( _MANAGED ) /* Generated */ int Core::PVI_Lookback( /* Generated */ void ) -/* Generated */ +/* Generated */ /* Generated */ #else /* Generated */ int TA_PVI_Lookback( /* Generated */ void ) -/* Generated */ +/* Generated */ /* Generated */ #endif /**** END GENCODE SECTION 1 - DO NOT DELETE THIS LINE ****/ { @@ -90,12 +90,12 @@ /**** START GENCODE SECTION 3 - DO NOT DELETE THIS LINE ****/ /* * TA_PVI - Positive Volume Index - * + * * Input = Close, Volume * Output = double - * + * */ -/* Generated */ +/* Generated */ /* Generated */ #if defined( _MANAGED ) /* Generated */ enum Core::TA_RetCode Core::PVI( int startIdx, /* Generated */ int endIdx, @@ -118,25 +118,25 @@ /* insert local variable here */ /**** START GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/ -/* Generated */ +/* Generated */ /* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK -/* Generated */ +/* Generated */ /* Generated */ /* Validate the requested output range. */ /* 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 */ +/* Generated */ /* Generated */ /* Validate the parameters. */ /* Generated */ /* Verify required price component. */ /* Generated */ if(!inClose||!inVolume) /* Generated */ return TA_BAD_PARAM; -/* Generated */ +/* Generated */ /* Generated */ if( outReal == NULL ) /* Generated */ return TA_BAD_PARAM; -/* Generated */ +/* Generated */ /* Generated */ #endif /* TA_FUNC_NO_RANGE_CHECK */ -/* Generated */ +/* Generated */ /**** END GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/ /* Insert TA function code here. */ @@ -149,7 +149,7 @@ } /**** START GENCODE SECTION 5 - DO NOT DELETE THIS LINE ****/ -/* Generated */ +/* Generated */ /* Generated */ #define USE_SINGLE_PRECISION_INPUT /* Generated */ #if !defined( _MANAGED ) /* Generated */ #undef TA_PREFIX @@ -184,12 +184,12 @@ /* Generated */ return TA_BAD_PARAM; /* Generated */ if( outReal == NULL ) /* Generated */ return TA_BAD_PARAM; -/* Generated */ #endif +/* Generated */ #endif /* Generated */ *outBegIdx = 0; /* Generated */ *outNBElement = 0; /* Generated */ return TA_SUCCESS; /* Generated */ } -/* Generated */ +/* Generated */ /* Generated */ #if defined( _MANAGED ) /* Generated */ }} // Close namespace TA.Lib /* Generated */ #endif diff --git a/src/ta_func/ta_ROC.c b/src/ta_func/ta_ROC.c index a1989ad59..311f6a40b 100644 --- a/src/ta_func/ta_ROC.c +++ b/src/ta_func/ta_ROC.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -203,20 +203,20 @@ * ROCR100 = (price/prevPrice)*100 [Rate of change ratio 100 Scale] * * Here are the equivalent function in other software: - * TA-Lib | Tradestation | Metastock + * TA-Lib | Tradestation | Metastock * ================================================= * MOM | Momentum | ROC (Point) * ROC | ROC | ROC (Percent) - * ROCP | PercentChange | - + * ROCP | PercentChange | - * ROCR | - | - * ROCR100 | - | MO * * The MOM function is the only one who is not normalized, and thus * should be avoided for comparing different time serie of prices. - * + * * ROC and ROCP are centered at zero and can have positive and negative * value. Here are some equivalence: - * ROC = ROCP/100 + * ROC = ROCP/100 * = ((price-prevPrice)/prevPrice)/100 * = ((price/prevPrice)-1)*100 * diff --git a/src/ta_func/ta_ROCP.c b/src/ta_func/ta_ROCP.c index 39b8d5b9f..babc1aefa 100644 --- a/src/ta_func/ta_ROCP.c +++ b/src/ta_func/ta_ROCP.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -203,20 +203,20 @@ * ROCR100 = (price/prevPrice)*100 [Rate of change ratio 100 Scale] * * Here are the equivalent function in other software: - * TA-Lib | Tradestation | Metastock + * TA-Lib | Tradestation | Metastock * ================================================= * MOM | Momentum | ROC (Point) * ROC | ROC | ROC (Percent) - * ROCP | PercentChange | - + * ROCP | PercentChange | - * ROCR | - | - * ROCR100 | - | MO * * The MOM function is the only one who is not normalized, and thus * should be avoided for comparing different time serie of prices. - * + * * ROC and ROCP are centered at zero and can have positive and negative * value. Here are some equivalence: - * ROC = ROCP/100 + * ROC = ROCP/100 * = ((price-prevPrice)/prevPrice)/100 * = ((price/prevPrice)-1)*100 * @@ -249,8 +249,8 @@ if( tempReal != 0.0 ) outReal[outIdx++] = (inReal[inIdx]-tempReal)/tempReal; else - outReal[outIdx++] = 0.0; - + outReal[outIdx++] = 0.0; + inIdx++; } @@ -340,7 +340,7 @@ /* Generated */ if( tempReal != 0.0 ) /* Generated */ outReal[outIdx++] = (inReal[inIdx]-tempReal)/tempReal; /* Generated */ else -/* Generated */ outReal[outIdx++] = 0.0; +/* Generated */ outReal[outIdx++] = 0.0; /* Generated */ inIdx++; /* Generated */ } /* Generated */ VALUE_HANDLE_DEREF(outNBElement) = outIdx; diff --git a/src/ta_func/ta_ROCR.c b/src/ta_func/ta_ROCR.c index 4a8288344..c2abdf961 100644 --- a/src/ta_func/ta_ROCR.c +++ b/src/ta_func/ta_ROCR.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -204,20 +204,20 @@ * ROCR100 = (price/prevPrice)*100 [Rate of change ratio 100 Scale] * * Here are the equivalent function in other software: - * TA-Lib | Tradestation | Metastock + * TA-Lib | Tradestation | Metastock * ================================================= * MOM | Momentum | ROC (Point) * ROC | ROC | ROC (Percent) - * ROCP | PercentChange | - + * ROCP | PercentChange | - * ROCR | - | - * ROCR100 | - | MO * * The MOM function is the only one who is not normalized, and thus * should be avoided for comparing different time serie of prices. - * + * * ROC and ROCP are centered at zero and can have positive and negative * value. Here are some equivalence: - * ROC = ROCP/100 + * ROC = ROCP/100 * = ((price-prevPrice)/prevPrice)/100 * = ((price/prevPrice)-1)*100 * @@ -250,8 +250,8 @@ if( tempReal != 0.0 ) outReal[outIdx++] = (inReal[inIdx] / tempReal); else - outReal[outIdx++] = 0.0; - + outReal[outIdx++] = 0.0; + inIdx++; } @@ -341,7 +341,7 @@ /* Generated */ if( tempReal != 0.0 ) /* Generated */ outReal[outIdx++] = (inReal[inIdx] / tempReal); /* Generated */ else -/* Generated */ outReal[outIdx++] = 0.0; +/* Generated */ outReal[outIdx++] = 0.0; /* Generated */ inIdx++; /* Generated */ } /* Generated */ VALUE_HANDLE_DEREF(outNBElement) = outIdx; diff --git a/src/ta_func/ta_ROCR100.c b/src/ta_func/ta_ROCR100.c index 7d7c30167..54bbe16b8 100644 --- a/src/ta_func/ta_ROCR100.c +++ b/src/ta_func/ta_ROCR100.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -203,20 +203,20 @@ * ROCR100 = (price/prevPrice)*100 [Rate of change ratio 100 Scale] * * Here are the equivalent function in other software: - * TA-Lib | Tradestation | Metastock + * TA-Lib | Tradestation | Metastock * ================================================= * MOM | Momentum | ROC (Point) * ROC | ROC | ROC (Percent) - * ROCP | PercentChange | - + * ROCP | PercentChange | - * ROCR | - | - * ROCR100 | - | MO * * The MOM function is the only one who is not normalized, and thus * should be avoided for comparing different time serie of prices. - * + * * ROC and ROCP are centered at zero and can have positive and negative * value. Here are some equivalence: - * ROC = ROCP/100 + * ROC = ROCP/100 * = ((price-prevPrice)/prevPrice)/100 * = ((price/prevPrice)-1)*100 * @@ -249,8 +249,8 @@ if( tempReal != 0.0 ) outReal[outIdx++] = (inReal[inIdx] / tempReal)*100.0; else - outReal[outIdx++] = 0.0; - + outReal[outIdx++] = 0.0; + inIdx++; } @@ -340,7 +340,7 @@ /* Generated */ if( tempReal != 0.0 ) /* Generated */ outReal[outIdx++] = (inReal[inIdx] / tempReal)*100.0; /* Generated */ else -/* Generated */ outReal[outIdx++] = 0.0; +/* Generated */ outReal[outIdx++] = 0.0; /* Generated */ inIdx++; /* Generated */ } /* Generated */ VALUE_HANDLE_DEREF(outNBElement) = outIdx; diff --git a/src/ta_func/ta_RSI.c b/src/ta_func/ta_RSI.c index 6f420783b..a0772501a 100644 --- a/src/ta_func/ta_RSI.c +++ b/src/ta_func/ta_RSI.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -204,7 +204,7 @@ /* Insert TA function code here. */ - /* The following algorithm is base on the original + /* The following algorithm is base on the original * work from Wilder's and shall represent the * original idea behind the classic RSI. * @@ -214,14 +214,14 @@ * previous one (no gain or loss). */ - /* If changing this function, please check also CMO - * which is mostly identical (just different in one step + /* If changing this function, please check also CMO + * which is mostly identical (just different in one step * of calculation). */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); - + /* Adjust startIdx to account for the lookback period. */ lookbackTotal = LOOKBACK_CALL(RSI)( optInTimePeriod ); @@ -251,7 +251,7 @@ return ENUM_VALUE(RetCode,TA_SUCCESS,Success); } - /* Accumulate Wilder's "Average Gain" and "Average Loss" + /* Accumulate Wilder's "Average Gain" and "Average Loss" * among the initial period. */ today = startIdx-lookbackTotal; @@ -267,10 +267,10 @@ * no need to calculate since this * first value will be surely skip. */ - if( (unstablePeriod == 0) && + if( (unstablePeriod == 0) && (TA_GLOBALS_COMPATIBILITY == ENUM_VALUE(Compatibility,TA_COMPATIBILITY_METASTOCK,Metastock))) { - /* Preserve prevValue because it may get + /* Preserve prevValue because it may get * overwritten by the output. *(because output ptr could be the same as input ptr). */ @@ -337,10 +337,10 @@ prevGain += tempValue2; } - + /* Subsequent prevLoss and prevGain are smoothed * using the previous values (Wilder's approach). - * 1) Multiply the previous by 'period-1'. + * 1) Multiply the previous by 'period-1'. * 2) Add today value. * 3) Divide by 'period'. */ @@ -365,9 +365,9 @@ } else { - /* Skip the unstable period. Do the processing + /* Skip the unstable period. Do the processing * but do not write it in the output. - */ + */ while( today < startIdx ) { tempValue1 = inReal[today]; @@ -510,7 +510,7 @@ /* Generated */ today = startIdx-lookbackTotal; /* Generated */ prevValue = inReal[today]; /* Generated */ unstablePeriod = TA_GLOBALS_UNSTABLE_PERIOD(TA_FUNC_UNST_RSI,Rsi); -/* Generated */ if( (unstablePeriod == 0) && +/* Generated */ if( (unstablePeriod == 0) && /* Generated */ (TA_GLOBALS_COMPATIBILITY == ENUM_VALUE(Compatibility,TA_COMPATIBILITY_METASTOCK,Metastock))) /* Generated */ { /* Generated */ savePrevValue = prevValue; diff --git a/src/ta_func/ta_SAR.c b/src/ta_func/ta_SAR.c index 69d564dde..f025337e3 100644 --- a/src/ta_func/ta_SAR.c +++ b/src/ta_func/ta_SAR.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -252,7 +252,7 @@ * - Calculate +DM and -DM between the first and * second bar. The highest directional indication will * indicate the assumed direction of the trade for the second - * price bar. + * price bar. * - In the case of a tie between +DM and -DM, * the direction is LONG by default. * @@ -293,7 +293,7 @@ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); return ENUM_VALUE(RetCode,TA_SUCCESS,Success); - } + } /* Make sure the acceleration and maximum are coherent. * If not, correct the acceleration. @@ -357,14 +357,14 @@ prevLow = newLow; prevHigh = newHigh; newLow = inLow[todayIdx]; - newHigh = inHigh[todayIdx]; + newHigh = inHigh[todayIdx]; todayIdx++; SAR_ROUNDING(newLow); SAR_ROUNDING(newHigh); if( isLong == 1 ) - { + { /* Switch to short if the low penetrates the SAR value. */ if( newLow <= sar ) { @@ -376,7 +376,7 @@ * yesterday's and today's range. */ if( sar < prevHigh ) - sar = prevHigh; + sar = prevHigh; if( sar < newHigh ) sar = newHigh; @@ -386,7 +386,7 @@ /* Adjust af and ep */ af = optInAcceleration; ep = newLow; - + /* Calculate the new SAR */ sar = sar + af * (ep - sar); SAR_ROUNDING( sar ); @@ -395,7 +395,7 @@ * yesterday's and today's range. */ if( sar < prevHigh ) - sar = prevHigh; + sar = prevHigh; if( sar < newHigh ) sar = newHigh; } @@ -405,7 +405,7 @@ /* Output the SAR (was calculated in the previous iteration) */ outReal[outIdx++] = sar; - + /* Adjust af and ep. */ if( newHigh > ep ) { @@ -423,7 +423,7 @@ * yesterday's and today's range. */ if( sar > prevLow ) - sar = prevLow; + sar = prevLow; if( sar > newLow ) sar = newLow; } @@ -441,7 +441,7 @@ * yesterday's and today's range. */ if( sar > prevLow ) - sar = prevLow; + sar = prevLow; if( sar > newLow ) sar = newLow; @@ -460,7 +460,7 @@ * yesterday's and today's range. */ if( sar > prevLow ) - sar = prevLow; + sar = prevLow; if( sar > newLow ) sar = newLow; } @@ -488,7 +488,7 @@ * yesterday's and today's range. */ if( sar < prevHigh ) - sar = prevHigh; + sar = prevHigh; if( sar < newHigh ) sar = newHigh; } @@ -587,7 +587,7 @@ /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); /* Generated */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success); -/* Generated */ } +/* Generated */ } /* Generated */ af = optInAcceleration; /* Generated */ if( af > optInMaximum ) /* Generated */ af = optInAcceleration = optInMaximum; @@ -629,18 +629,18 @@ /* Generated */ prevLow = newLow; /* Generated */ prevHigh = newHigh; /* Generated */ newLow = inLow[todayIdx]; -/* Generated */ newHigh = inHigh[todayIdx]; +/* Generated */ newHigh = inHigh[todayIdx]; /* Generated */ todayIdx++; /* Generated */ SAR_ROUNDING(newLow); /* Generated */ SAR_ROUNDING(newHigh); /* Generated */ if( isLong == 1 ) -/* Generated */ { +/* Generated */ { /* Generated */ if( newLow <= sar ) /* Generated */ { /* Generated */ isLong = 0; /* Generated */ sar = ep; /* Generated */ if( sar < prevHigh ) -/* Generated */ sar = prevHigh; +/* Generated */ sar = prevHigh; /* Generated */ if( sar < newHigh ) /* Generated */ sar = newHigh; /* Generated */ outReal[outIdx++] = sar; @@ -649,7 +649,7 @@ /* Generated */ sar = sar + af * (ep - sar); /* Generated */ SAR_ROUNDING( sar ); /* Generated */ if( sar < prevHigh ) -/* Generated */ sar = prevHigh; +/* Generated */ sar = prevHigh; /* Generated */ if( sar < newHigh ) /* Generated */ sar = newHigh; /* Generated */ } @@ -666,7 +666,7 @@ /* Generated */ sar = sar + af * (ep - sar); /* Generated */ SAR_ROUNDING( sar ); /* Generated */ if( sar > prevLow ) -/* Generated */ sar = prevLow; +/* Generated */ sar = prevLow; /* Generated */ if( sar > newLow ) /* Generated */ sar = newLow; /* Generated */ } @@ -678,7 +678,7 @@ /* Generated */ isLong = 1; /* Generated */ sar = ep; /* Generated */ if( sar > prevLow ) -/* Generated */ sar = prevLow; +/* Generated */ sar = prevLow; /* Generated */ if( sar > newLow ) /* Generated */ sar = newLow; /* Generated */ outReal[outIdx++] = sar; @@ -687,7 +687,7 @@ /* Generated */ sar = sar + af * (ep - sar); /* Generated */ SAR_ROUNDING( sar ); /* Generated */ if( sar > prevLow ) -/* Generated */ sar = prevLow; +/* Generated */ sar = prevLow; /* Generated */ if( sar > newLow ) /* Generated */ sar = newLow; /* Generated */ } @@ -704,7 +704,7 @@ /* Generated */ sar = sar + af * (ep - sar); /* Generated */ SAR_ROUNDING( sar ); /* Generated */ if( sar < prevHigh ) -/* Generated */ sar = prevHigh; +/* Generated */ sar = prevHigh; /* Generated */ if( sar < newHigh ) /* Generated */ sar = newHigh; /* Generated */ } diff --git a/src/ta_func/ta_SAREXT.c b/src/ta_func/ta_SAREXT.c index 57de71f3d..31cc26a46 100644 --- a/src/ta_func/ta_SAREXT.c +++ b/src/ta_func/ta_SAREXT.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -391,7 +391,7 @@ * - Calculate +DM and -DM between the first and * second bar. The highest directional indication will * indicate the assumed direction of the trade for the second - * price bar. + * price bar. * - In the case of a tie between +DM and -DM, * the direction is LONG by default. * @@ -422,7 +422,7 @@ * Yes. Using the optInStartValue_0 parameter: * optInStartValue_0 > 0 : SAR is long at optInStartValue_0. * optInStartValue_0 < 0 : SAR is short at fabs(optInStartValue_0). - * + * * And when optInStartValue_0 == 0, the logic is the same as for TA_SAR * (See previous two sections). */ @@ -442,12 +442,12 @@ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); return ENUM_VALUE(RetCode,TA_SUCCESS,Success); - } + } /* Check if the acceleration factors are being defined by the user. * Make sure the acceleration and maximum are coherent. - * If not, correct the acceleration. + * If not, correct the acceleration. * Default afLong = 0.02 * Default afShort = 0.02 */ @@ -461,11 +461,11 @@ if( optInAccelerationLong > optInAccelerationMaxLong ) optInAccelerationLong = optInAccelerationMaxLong; - if( afShort > optInAccelerationMaxShort) + if( afShort > optInAccelerationMaxShort) afShort = optInAccelerationInitShort = optInAccelerationMaxShort; if( optInAccelerationShort > optInAccelerationMaxShort ) - optInAccelerationShort = optInAccelerationMaxShort; + optInAccelerationShort = optInAccelerationMaxShort; /* Initialise SAR calculations */ @@ -549,14 +549,14 @@ prevLow = newLow; prevHigh = newHigh; newLow = inLow[todayIdx]; - newHigh = inHigh[todayIdx]; + newHigh = inHigh[todayIdx]; todayIdx++; SAR_ROUNDING(newLow); SAR_ROUNDING(newHigh); if( isLong == 1 ) - { + { /* Switch to short if the low penetrates the SAR value. */ if( newLow <= sar ) { @@ -568,19 +568,19 @@ * yesterday's and today's range. */ if( sar < prevHigh ) - sar = prevHigh; + sar = prevHigh; if( sar < newHigh ) sar = newHigh; /* Output the overide SAR */ if( optInOffsetOnReverse != 0.0 ) - sar += sar * optInOffsetOnReverse; + sar += sar * optInOffsetOnReverse; outReal[outIdx++] = -sar; /* Adjust afShort and ep */ afShort = optInAccelerationInitShort; ep = newLow; - + /* Calculate the new SAR */ sar = sar + afShort * (ep - sar); SAR_ROUNDING( sar ); @@ -589,7 +589,7 @@ * yesterday's and today's range. */ if( sar < prevHigh ) - sar = prevHigh; + sar = prevHigh; if( sar < newHigh ) sar = newHigh; } @@ -599,7 +599,7 @@ /* Output the SAR (was calculated in the previous iteration) */ outReal[outIdx++] = sar; - + /* Adjust afLong and ep. */ if( newHigh > ep ) { @@ -617,7 +617,7 @@ * yesterday's and today's range. */ if( sar > prevLow ) - sar = prevLow; + sar = prevLow; if( sar > newLow ) sar = newLow; } @@ -635,7 +635,7 @@ * yesterday's and today's range. */ if( sar > prevLow ) - sar = prevLow; + sar = prevLow; if( sar > newLow ) sar = newLow; @@ -656,7 +656,7 @@ * yesterday's and today's range. */ if( sar > prevLow ) - sar = prevLow; + sar = prevLow; if( sar > newLow ) sar = newLow; } @@ -684,7 +684,7 @@ * yesterday's and today's range. */ if( sar < prevHigh ) - sar = prevHigh; + sar = prevHigh; if( sar < newHigh ) sar = newHigh; } @@ -831,17 +831,17 @@ /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); /* Generated */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success); -/* Generated */ } +/* Generated */ } /* Generated */ afLong = optInAccelerationInitLong; /* Generated */ afShort = optInAccelerationInitShort; /* Generated */ if( afLong > optInAccelerationMaxLong ) /* Generated */ afLong = optInAccelerationInitLong = optInAccelerationMaxLong; /* Generated */ if( optInAccelerationLong > optInAccelerationMaxLong ) /* Generated */ optInAccelerationLong = optInAccelerationMaxLong; -/* Generated */ if( afShort > optInAccelerationMaxShort) +/* Generated */ if( afShort > optInAccelerationMaxShort) /* Generated */ afShort = optInAccelerationInitShort = optInAccelerationMaxShort; /* Generated */ if( optInAccelerationShort > optInAccelerationMaxShort ) -/* Generated */ optInAccelerationShort = optInAccelerationMaxShort; +/* Generated */ optInAccelerationShort = optInAccelerationMaxShort; /* Generated */ if(optInStartValue == 0) /* Generated */ { /* Generated */ retCode = FUNCTION_CALL(MINUS_DM)( startIdx, startIdx, inHigh, inLow, 1, @@ -904,29 +904,29 @@ /* Generated */ prevLow = newLow; /* Generated */ prevHigh = newHigh; /* Generated */ newLow = inLow[todayIdx]; -/* Generated */ newHigh = inHigh[todayIdx]; +/* Generated */ newHigh = inHigh[todayIdx]; /* Generated */ todayIdx++; /* Generated */ SAR_ROUNDING(newLow); /* Generated */ SAR_ROUNDING(newHigh); /* Generated */ if( isLong == 1 ) -/* Generated */ { +/* Generated */ { /* Generated */ if( newLow <= sar ) /* Generated */ { /* Generated */ isLong = 0; /* Generated */ sar = ep; /* Generated */ if( sar < prevHigh ) -/* Generated */ sar = prevHigh; +/* Generated */ sar = prevHigh; /* Generated */ if( sar < newHigh ) /* Generated */ sar = newHigh; /* Generated */ if( optInOffsetOnReverse != 0.0 ) -/* Generated */ sar += sar * optInOffsetOnReverse; +/* Generated */ sar += sar * optInOffsetOnReverse; /* Generated */ outReal[outIdx++] = -sar; /* Generated */ afShort = optInAccelerationInitShort; /* Generated */ ep = newLow; /* Generated */ sar = sar + afShort * (ep - sar); /* Generated */ SAR_ROUNDING( sar ); /* Generated */ if( sar < prevHigh ) -/* Generated */ sar = prevHigh; +/* Generated */ sar = prevHigh; /* Generated */ if( sar < newHigh ) /* Generated */ sar = newHigh; /* Generated */ } @@ -943,7 +943,7 @@ /* Generated */ sar = sar + afLong * (ep - sar); /* Generated */ SAR_ROUNDING( sar ); /* Generated */ if( sar > prevLow ) -/* Generated */ sar = prevLow; +/* Generated */ sar = prevLow; /* Generated */ if( sar > newLow ) /* Generated */ sar = newLow; /* Generated */ } @@ -955,7 +955,7 @@ /* Generated */ isLong = 1; /* Generated */ sar = ep; /* Generated */ if( sar > prevLow ) -/* Generated */ sar = prevLow; +/* Generated */ sar = prevLow; /* Generated */ if( sar > newLow ) /* Generated */ sar = newLow; /* Generated */ if( optInOffsetOnReverse != 0.0 ) @@ -966,7 +966,7 @@ /* Generated */ sar = sar + afLong * (ep - sar); /* Generated */ SAR_ROUNDING( sar ); /* Generated */ if( sar > prevLow ) -/* Generated */ sar = prevLow; +/* Generated */ sar = prevLow; /* Generated */ if( sar > newLow ) /* Generated */ sar = newLow; /* Generated */ } @@ -983,7 +983,7 @@ /* Generated */ sar = sar + afShort * (ep - sar); /* Generated */ SAR_ROUNDING( sar ); /* Generated */ if( sar < prevHigh ) -/* Generated */ sar = prevHigh; +/* Generated */ sar = prevHigh; /* Generated */ if( sar < newHigh ) /* Generated */ sar = newHigh; /* Generated */ } diff --git a/src/ta_func/ta_SIN.c b/src/ta_func/ta_SIN.c index 54adcd90a..912790f77 100644 --- a/src/ta_func/ta_SIN.c +++ b/src/ta_func/ta_SIN.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_SINH.c b/src/ta_func/ta_SINH.c index 23ba82540..53bb13c75 100644 --- a/src/ta_func/ta_SINH.c +++ b/src/ta_func/ta_SINH.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_SMA.c b/src/ta_func/ta_SMA.c index a991885bf..e04ef7afd 100644 --- a/src/ta_func/ta_SMA.c +++ b/src/ta_func/ta_SMA.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -233,7 +233,7 @@ TA_RetCode TA_PREFIX(INT_SMA)( int startIdx, { double periodTotal, tempReal; int i, outIdx, trailingIdx, lookbackTotal; - + /* Identify the minimum number of price bar needed * to calculate at least one output. */ diff --git a/src/ta_func/ta_SQRT.c b/src/ta_func/ta_SQRT.c index de418b1c8..bc4973bbd 100644 --- a/src/ta_func/ta_SQRT.c +++ b/src/ta_func/ta_SQRT.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_STDDEV.c b/src/ta_func/ta_STDDEV.c index 1bf4ceea3..6425c09c6 100644 --- a/src/ta_func/ta_STDDEV.c +++ b/src/ta_func/ta_STDDEV.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -258,7 +258,7 @@ // No INT function #else -/* The inMovAvg is the moving average of the inReal. +/* The inMovAvg is the moving average of the inReal. * * inMovAvgBegIdx is relative to inReal, in other word * this is the 'outBegIdx' who was returned when doing the @@ -269,34 +269,34 @@ * * Note: This function is not used by TA_STDDEV, since TA_STDDEV * is optimized considering it uses always a simple moving - * average. Still the function is put here because it is + * average. Still the function is put here because it is * closely related. */ #if defined( _MANAGED ) && defined( USE_SUBARRAY ) void Core::TA_INT_stddev_using_precalc_ma( SubArray^ inReal, SubArray^ inMovAvg, - int inMovAvgBegIdx, + int inMovAvgBegIdx, int inMovAvgNbElement, int timePeriod, SubArray^ output) #elif defined( _MANAGED ) void Core::TA_INT_stddev_using_precalc_ma( cli::array^ inReal, cli::array^ inMovAvg, - int inMovAvgBegIdx, + int inMovAvgBegIdx, int inMovAvgNbElement, int timePeriod, cli::array^ output) #elif defined( _JAVA ) void TA_INT_stddev_using_precalc_ma( INPUT_TYPE inReal[], double inMovAvg[], - int inMovAvgBegIdx, + int inMovAvgBegIdx, int inMovAvgNbElement, int timePeriod, double output[] ) #else void TA_PREFIX(INT_stddev_using_precalc_ma)( const INPUT_TYPE *inReal, const double *inMovAvg, - int inMovAvgBegIdx, + int inMovAvgBegIdx, int inMovAvgNbElement, int timePeriod, double *output ) @@ -334,7 +334,7 @@ void TA_PREFIX(INT_stddev_using_precalc_ma)( const INPUT_TYPE *inReal, tempReal = inMovAvg[outIdx]; tempReal *= tempReal; meanValue2 -= tempReal; - + if( !TA_IS_ZERO_OR_NEG(meanValue2) ) output[outIdx] = std_sqrt(meanValue2); else @@ -450,28 +450,28 @@ void TA_PREFIX(INT_stddev_using_precalc_ma)( const INPUT_TYPE *inReal, /* Generated */ #if defined( _MANAGED ) && defined( USE_SUBARRAY ) /* Generated */ void Core::TA_INT_stddev_using_precalc_ma( SubArray^ inReal, /* Generated */ SubArray^ inMovAvg, -/* Generated */ int inMovAvgBegIdx, +/* Generated */ int inMovAvgBegIdx, /* Generated */ int inMovAvgNbElement, /* Generated */ int timePeriod, /* Generated */ SubArray^ output) /* Generated */ #elif defined( _MANAGED ) /* Generated */ void Core::TA_INT_stddev_using_precalc_ma( cli::array^ inReal, /* Generated */ cli::array^ inMovAvg, -/* Generated */ int inMovAvgBegIdx, +/* Generated */ int inMovAvgBegIdx, /* Generated */ int inMovAvgNbElement, /* Generated */ int timePeriod, /* Generated */ cli::array^ output) /* Generated */ #elif defined( _JAVA ) /* Generated */ void TA_INT_stddev_using_precalc_ma( INPUT_TYPE inReal[], /* Generated */ double inMovAvg[], -/* Generated */ int inMovAvgBegIdx, +/* Generated */ int inMovAvgBegIdx, /* Generated */ int inMovAvgNbElement, /* Generated */ int timePeriod, /* Generated */ double output[] ) /* Generated */ #else /* Generated */ void TA_PREFIX(INT_stddev_using_precalc_ma)( const INPUT_TYPE *inReal, /* Generated */ const double *inMovAvg, -/* Generated */ int inMovAvgBegIdx, +/* Generated */ int inMovAvgBegIdx, /* Generated */ int inMovAvgNbElement, /* Generated */ int timePeriod, /* Generated */ double *output ) diff --git a/src/ta_func/ta_STOCH.c b/src/ta_func/ta_STOCH.c index 1a6d4371c..ad20fe182 100644 --- a/src/ta_func/ta_STOCH.c +++ b/src/ta_func/ta_STOCH.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -140,12 +140,12 @@ /**** END GENCODE SECTION 2 - DO NOT DELETE THIS LINE ****/ /* insert lookback code here. */ - + /* Account for the initial data needed for Fast-K. */ retValue = (optInFastK_Period - 1); - + /* Add the smoothing being done for %K slow */ - retValue += LOOKBACK_CALL(MA)( optInSlowK_Period, optInSlowK_MAType ); + retValue += LOOKBACK_CALL(MA)( optInSlowK_Period, optInSlowK_MAType ); /* Add the smoothing being done for %D slow. */ retValue += LOOKBACK_CALL(MA)( optInSlowD_Period, optInSlowD_MAType ); @@ -325,16 +325,16 @@ * (Today's Close - LowestLow) * FASTK(Kperiod) = --------------------------- * 100 * (HighestHigh - LowestLow) - * + * * FASTD(FastDperiod, MA type) = MA Smoothed FASTK over FastDperiod - * + * * SLOWK(SlowKperiod, MA type) = MA Smoothed FASTK over SlowKperiod * * SLOWD(SlowDperiod, MA Type) = MA Smoothed SLOWK over SlowDperiod * * The HighestHigh and LowestLow are the extreme values among the * last 'Kperiod'. - * + * * SLOWK and FASTD are equivalent when using the same period. * * The following shows how these four lines are made available in TA-LIB: @@ -384,7 +384,7 @@ */ outIdx = 0; - /* Calculate just enough K for ending up with the caller + /* Calculate just enough K for ending up with the caller * requested range. (The range of k must consider all * the lookback involve with the smoothing). */ @@ -410,8 +410,8 @@ */ ARRAY_ALLOC( tempBuffer, endIdx-today+1 ); #else - if( (outSlowK == inHigh) || - (outSlowK == inLow) || + if( (outSlowK == inHigh) || + (outSlowK == inLow) || (outSlowK == inClose) ) { tempBuffer = outSlowK; @@ -491,31 +491,31 @@ tempBuffer[outIdx++] = 0.0; trailingIdx++; - today++; + today++; } /* Un-smoothed K calculation completed. This K calculation is not returned * to the caller. It is always smoothed and then return. - * Some documentation will refer to the smoothed version as being + * Some documentation will refer to the smoothed version as being * "K-Slow", but often this end up to be shorten to "K". */ retCode = FUNCTION_CALL_DOUBLE(MA)( 0, outIdx-1, tempBuffer, optInSlowK_Period, - optInSlowK_MAType, + optInSlowK_MAType, outBegIdx, outNBElement, tempBuffer ); if( (retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) || ((int)VALUE_HANDLE_DEREF(outNBElement) == 0) ) { #if defined(USE_SINGLE_PRECISION_INPUT) - ARRAY_FREE( tempBuffer ); + ARRAY_FREE( tempBuffer ); #else - ARRAY_FREE_COND( bufferIsAllocated, tempBuffer ); + ARRAY_FREE_COND( bufferIsAllocated, tempBuffer ); #endif /* Something wrong happen? No further data? */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); - return retCode; + return retCode; } /* Calculate the %D which is simply a moving average of @@ -526,7 +526,7 @@ optInSlowD_MAType, outBegIdx, outNBElement, outSlowD ); - /* Copy tempBuffer into the caller buffer. + /* Copy tempBuffer into the caller buffer. * (Calculation could not be done directly in the * caller buffer because more input data then the * requested range was needed for doing %D). @@ -535,9 +535,9 @@ /* Don't need K anymore, free it if it was allocated here. */ #if defined(USE_SINGLE_PRECISION_INPUT) - ARRAY_FREE( tempBuffer ); + ARRAY_FREE( tempBuffer ); #else - ARRAY_FREE_COND( bufferIsAllocated, tempBuffer ); + ARRAY_FREE_COND( bufferIsAllocated, tempBuffer ); #endif if( retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) @@ -700,8 +700,8 @@ /* Generated */ #if defined(USE_SINGLE_PRECISION_INPUT) || defined( USE_SUBARRAY ) /* Generated */ ARRAY_ALLOC( tempBuffer, endIdx-today+1 ); /* Generated */ #else -/* Generated */ if( (outSlowK == inHigh) || -/* Generated */ (outSlowK == inLow) || +/* Generated */ if( (outSlowK == inHigh) || +/* Generated */ (outSlowK == inLow) || /* Generated */ (outSlowK == inClose) ) /* Generated */ { /* Generated */ tempBuffer = outSlowK; @@ -773,22 +773,22 @@ /* Generated */ else /* Generated */ tempBuffer[outIdx++] = 0.0; /* Generated */ trailingIdx++; -/* Generated */ today++; +/* Generated */ today++; /* Generated */ } /* Generated */ retCode = FUNCTION_CALL_DOUBLE(MA)( 0, outIdx-1, /* Generated */ tempBuffer, optInSlowK_Period, -/* Generated */ optInSlowK_MAType, +/* Generated */ optInSlowK_MAType, /* Generated */ outBegIdx, outNBElement, tempBuffer ); /* Generated */ if( (retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) || ((int)VALUE_HANDLE_DEREF(outNBElement) == 0) ) /* Generated */ { /* Generated */ #if defined(USE_SINGLE_PRECISION_INPUT) -/* Generated */ ARRAY_FREE( tempBuffer ); +/* Generated */ ARRAY_FREE( tempBuffer ); /* Generated */ #else -/* Generated */ ARRAY_FREE_COND( bufferIsAllocated, tempBuffer ); +/* 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 */ return retCode; /* Generated */ } /* Generated */ retCode = FUNCTION_CALL_DOUBLE(MA)( 0, (int)VALUE_HANDLE_DEREF(outNBElement)-1, /* Generated */ tempBuffer, optInSlowD_Period, @@ -796,9 +796,9 @@ /* 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 */ ARRAY_FREE( tempBuffer ); /* Generated */ #else -/* Generated */ ARRAY_FREE_COND( bufferIsAllocated, tempBuffer ); +/* Generated */ ARRAY_FREE_COND( bufferIsAllocated, tempBuffer ); /* Generated */ #endif /* Generated */ if( retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) /* Generated */ { diff --git a/src/ta_func/ta_STOCHF.c b/src/ta_func/ta_STOCHF.c index 1f6f0c7ce..df68667fa 100644 --- a/src/ta_func/ta_STOCHF.c +++ b/src/ta_func/ta_STOCHF.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -122,10 +122,10 @@ /**** END GENCODE SECTION 2 - DO NOT DELETE THIS LINE ****/ /* insert lookback code here. */ - + /* Account for the initial data needed for Fast-K. */ retValue = (optInFastK_Period - 1); - + /* Add the smoothing being done for Fast-D */ retValue += LOOKBACK_CALL(MA)( optInFastD_Period, optInFastD_MAType ); @@ -278,16 +278,16 @@ * (Today's Close - LowestLow) * FASTK(Kperiod) = --------------------------- * 100 * (HighestHigh - LowestLow) - * + * * FASTD(FastDperiod, MA type) = MA Smoothed FASTK over FastDperiod - * + * * SLOWK(SlowKperiod, MA type) = MA Smoothed FASTK over SlowKperiod * * SLOWD(SlowDperiod, MA Type) = MA Smoothed SLOWK over SlowDperiod * * The HighestHigh and LowestLow are the extreme values among the * last 'Kperiod'. - * + * * SLOWK and FASTD are equivalent when using the same period. * * The following shows how these four lines are made available in TA-LIB: @@ -336,7 +336,7 @@ */ outIdx = 0; - /* Calculate just enough K for ending up with the caller + /* Calculate just enough K for ending up with the caller * requested range. (The range of k must consider all * the lookback involve with the smoothing). */ @@ -362,8 +362,8 @@ */ ARRAY_ALLOC( tempBuffer, endIdx-today+1 ); #else - if( (outFastK == inHigh) || - (outFastK == inLow) || + if( (outFastK == inHigh) || + (outFastK == inLow) || (outFastK == inClose) ) { tempBuffer = outFastK; @@ -443,7 +443,7 @@ tempBuffer[outIdx++] = 0.0; trailingIdx++; - today++; + today++; } /* Fast-K calculation completed. This K calculation is returned @@ -451,24 +451,24 @@ */ retCode = FUNCTION_CALL_DOUBLE(MA)( 0, outIdx-1, tempBuffer, optInFastD_Period, - optInFastD_MAType, + optInFastD_MAType, outBegIdx, outNBElement, outFastD ); if( (retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) || ((int)VALUE_HANDLE_DEREF(outNBElement)) == 0 ) { #if defined(USE_SINGLE_PRECISION_INPUT) - ARRAY_FREE( tempBuffer ); + ARRAY_FREE( tempBuffer ); #else - ARRAY_FREE_COND( bufferIsAllocated, tempBuffer ); + ARRAY_FREE_COND( bufferIsAllocated, tempBuffer ); #endif /* Something wrong happen? No further data? */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); - return retCode; + return retCode; } - /* Copy tempBuffer into the caller buffer. + /* Copy tempBuffer into the caller buffer. * (Calculation could not be done directly in the * caller buffer because more input data then the * requested range was needed for doing %D). @@ -477,9 +477,9 @@ /* Don't need K anymore, free it if it was allocated here. */ #if defined(USE_SINGLE_PRECISION_INPUT) - ARRAY_FREE( tempBuffer ); + ARRAY_FREE( tempBuffer ); #else - ARRAY_FREE_COND( bufferIsAllocated, tempBuffer ); + ARRAY_FREE_COND( bufferIsAllocated, tempBuffer ); #endif if( retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) @@ -622,8 +622,8 @@ /* Generated */ #if defined(USE_SINGLE_PRECISION_INPUT) || defined( USE_SUBARRAY ) /* Generated */ ARRAY_ALLOC( tempBuffer, endIdx-today+1 ); /* Generated */ #else -/* Generated */ if( (outFastK == inHigh) || -/* Generated */ (outFastK == inLow) || +/* Generated */ if( (outFastK == inHigh) || +/* Generated */ (outFastK == inLow) || /* Generated */ (outFastK == inClose) ) /* Generated */ { /* Generated */ tempBuffer = outFastK; @@ -695,28 +695,28 @@ /* Generated */ else /* Generated */ tempBuffer[outIdx++] = 0.0; /* Generated */ trailingIdx++; -/* Generated */ today++; +/* Generated */ today++; /* Generated */ } /* Generated */ retCode = FUNCTION_CALL_DOUBLE(MA)( 0, outIdx-1, /* Generated */ tempBuffer, optInFastD_Period, -/* Generated */ optInFastD_MAType, +/* Generated */ optInFastD_MAType, /* Generated */ outBegIdx, outNBElement, outFastD ); /* Generated */ if( (retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) || ((int)VALUE_HANDLE_DEREF(outNBElement)) == 0 ) /* Generated */ { /* Generated */ #if defined(USE_SINGLE_PRECISION_INPUT) -/* Generated */ ARRAY_FREE( tempBuffer ); +/* Generated */ ARRAY_FREE( tempBuffer ); /* Generated */ #else -/* Generated */ ARRAY_FREE_COND( bufferIsAllocated, tempBuffer ); +/* 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 */ return retCode; /* Generated */ } /* Generated */ ARRAY_MEMMOVE( outFastK, 0, tempBuffer, lookbackFastD, (int)VALUE_HANDLE_DEREF(outNBElement) ); /* Generated */ #if defined(USE_SINGLE_PRECISION_INPUT) -/* Generated */ ARRAY_FREE( tempBuffer ); +/* Generated */ ARRAY_FREE( tempBuffer ); /* Generated */ #else -/* Generated */ ARRAY_FREE_COND( bufferIsAllocated, tempBuffer ); +/* Generated */ ARRAY_FREE_COND( bufferIsAllocated, tempBuffer ); /* Generated */ #endif /* Generated */ if( retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) /* Generated */ { diff --git a/src/ta_func/ta_STOCHRSI.c b/src/ta_func/ta_STOCHRSI.c index 378864534..072e753eb 100644 --- a/src/ta_func/ta_STOCHRSI.c +++ b/src/ta_func/ta_STOCHRSI.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -272,9 +272,9 @@ /**** END GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/ /* Insert TA function code here. */ - + /* Stochastic RSI - * + * * Reference: "Stochastic RSI and Dynamic Momentum Index" * by Tushar Chande and Stanley Kroll * Stock&Commodities V.11:5 (189-199) @@ -282,10 +282,10 @@ * The TA-Lib version offer flexibility beyond what is explain * in the Stock&Commodities article. * - * To calculate the "Unsmoothed stochastic RSI" with symetry like + * To calculate the "Unsmoothed stochastic RSI" with symetry like * explain in the article, keep the optInTimePeriod and optInFastK_Period * equal. Example: - * + * * unsmoothed stoch RSI 14 : optInTimePeriod = 14 * optInFastK_Period = 14 * optInFastD_Period = 'x' @@ -322,12 +322,12 @@ ARRAY_ALLOC( tempRSIBuffer, tempArraySize ); - retCode = FUNCTION_CALL(RSI)(startIdx-lookbackSTOCHF, - endIdx, - inReal, - optInTimePeriod, + retCode = FUNCTION_CALL(RSI)(startIdx-lookbackSTOCHF, + endIdx, + inReal, + optInTimePeriod, VALUE_HANDLE_OUT(outBegIdx1), - VALUE_HANDLE_OUT(outNbElement1), + VALUE_HANDLE_OUT(outNbElement1), tempRSIBuffer); if( retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) || VALUE_HANDLE_GET(outNbElement1) == 0 ) @@ -337,7 +337,7 @@ VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); return retCode; } - + retCode = FUNCTION_CALL_DOUBLE(STOCHF)(0, tempArraySize-1, tempRSIBuffer, @@ -350,7 +350,7 @@ outNBElement, outFastK, outFastD); - + ARRAY_FREE( tempRSIBuffer ); if( retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) || ((int)VALUE_HANDLE_DEREF(outNBElement)) == 0 ) @@ -476,12 +476,12 @@ /* Generated */ VALUE_HANDLE_DEREF(outBegIdx) = startIdx; /* Generated */ tempArraySize = (endIdx - startIdx) + 1 + lookbackSTOCHF; /* Generated */ ARRAY_ALLOC( tempRSIBuffer, tempArraySize ); -/* Generated */ retCode = FUNCTION_CALL(RSI)(startIdx-lookbackSTOCHF, -/* Generated */ endIdx, -/* Generated */ inReal, -/* Generated */ optInTimePeriod, +/* Generated */ retCode = FUNCTION_CALL(RSI)(startIdx-lookbackSTOCHF, +/* Generated */ endIdx, +/* Generated */ inReal, +/* Generated */ optInTimePeriod, /* Generated */ VALUE_HANDLE_OUT(outBegIdx1), -/* Generated */ VALUE_HANDLE_OUT(outNbElement1), +/* Generated */ VALUE_HANDLE_OUT(outNbElement1), /* Generated */ tempRSIBuffer); /* Generated */ if( retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) || VALUE_HANDLE_GET(outNbElement1) == 0 ) /* Generated */ { diff --git a/src/ta_func/ta_SUB.c b/src/ta_func/ta_SUB.c index a2cebaf10..efb04c730 100644 --- a/src/ta_func/ta_SUB.c +++ b/src/ta_func/ta_SUB.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_SUM.c b/src/ta_func/ta_SUM.c index c8f7e17d5..097cbfc3a 100644 --- a/src/ta_func/ta_SUM.c +++ b/src/ta_func/ta_SUM.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_T3.c b/src/ta_func/ta_T3.c index f620e086e..e55da03a6 100644 --- a/src/ta_func/ta_T3.c +++ b/src/ta_func/ta_T3.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -46,7 +46,7 @@ * 032003 MHL Implementation of T3 * 040503 MF Adapt for compatibility with published code * for TradeStation and Metastock. - * See "Smoothing Techniques For More Accurate Signals" + * See "Smoothing Techniques For More Accurate Signals" * from Tim Tillson in Stock&Commodities V16:1 Page 33-37 * 052603 MF Adapt code to compile with .NET Managed C++ */ @@ -223,7 +223,7 @@ /* For an explanation of this function, please read: * - * Magazine articles written by Tim Tillson + * Magazine articles written by Tim Tillson * * Essentially, a T3 of time serie 't' is: * EMA1(x,Period) = EMA(x,Period) @@ -247,7 +247,7 @@ { VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); - return ENUM_VALUE(RetCode,TA_SUCCESS,Success); + return ENUM_VALUE(RetCode,TA_SUCCESS,Success); } VALUE_HANDLE_DEREF(outBegIdx) = startIdx; @@ -258,13 +258,13 @@ /* Initialize e1 */ tempReal = inReal[today++]; - for( i=optInTimePeriod-1; i > 0 ; i-- ) + for( i=optInTimePeriod-1; i > 0 ; i-- ) tempReal += inReal[today++]; e1 = tempReal / optInTimePeriod; /* Initialize e2 */ tempReal = e1; - for( i=optInTimePeriod-1; i > 0 ; i-- ) + for( i=optInTimePeriod-1; i > 0 ; i-- ) { e1 = (k*inReal[today++])+(one_minus_k*e1); tempReal += e1; @@ -273,7 +273,7 @@ /* Initialize e3 */ tempReal = e2; - for( i=optInTimePeriod-1; i > 0 ; i-- ) + for( i=optInTimePeriod-1; i > 0 ; i-- ) { e1 = (k*inReal[today++])+(one_minus_k*e1); e2 = (k*e1)+(one_minus_k*e2); @@ -283,7 +283,7 @@ /* Initialize e4 */ tempReal = e3; - for( i=optInTimePeriod-1; i > 0 ; i-- ) + for( i=optInTimePeriod-1; i > 0 ; i-- ) { e1 = (k*inReal[today++])+(one_minus_k*e1); e2 = (k*e1)+(one_minus_k*e2); @@ -294,7 +294,7 @@ /* Initialize e5 */ tempReal = e4; - for( i=optInTimePeriod-1; i > 0 ; i-- ) + for( i=optInTimePeriod-1; i > 0 ; i-- ) { e1 = (k*inReal[today++])+(one_minus_k*e1); e2 = (k*e1)+(one_minus_k*e2); @@ -306,7 +306,7 @@ /* Initialize e6 */ tempReal = e5; - for( i=optInTimePeriod-1; i > 0 ; i-- ) + for( i=optInTimePeriod-1; i > 0 ; i-- ) { e1 = (k*inReal[today++])+(one_minus_k*e1); e2 = (k*e1)+(one_minus_k*e2); @@ -441,25 +441,25 @@ /* Generated */ { /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); -/* Generated */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success); +/* Generated */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success); /* Generated */ } /* Generated */ VALUE_HANDLE_DEREF(outBegIdx) = startIdx; /* Generated */ today = startIdx - lookbackTotal; /* Generated */ k = 2.0/(optInTimePeriod+1.0); /* Generated */ one_minus_k = 1.0-k; /* Generated */ tempReal = inReal[today++]; -/* Generated */ for( i=optInTimePeriod-1; i > 0 ; i-- ) +/* Generated */ for( i=optInTimePeriod-1; i > 0 ; i-- ) /* Generated */ tempReal += inReal[today++]; /* Generated */ e1 = tempReal / optInTimePeriod; /* Generated */ tempReal = e1; -/* Generated */ for( i=optInTimePeriod-1; i > 0 ; i-- ) +/* Generated */ for( i=optInTimePeriod-1; i > 0 ; i-- ) /* Generated */ { /* Generated */ e1 = (k*inReal[today++])+(one_minus_k*e1); /* Generated */ tempReal += e1; /* Generated */ } /* Generated */ e2 = tempReal / optInTimePeriod; /* Generated */ tempReal = e2; -/* Generated */ for( i=optInTimePeriod-1; i > 0 ; i-- ) +/* Generated */ for( i=optInTimePeriod-1; i > 0 ; i-- ) /* Generated */ { /* Generated */ e1 = (k*inReal[today++])+(one_minus_k*e1); /* Generated */ e2 = (k*e1)+(one_minus_k*e2); @@ -467,7 +467,7 @@ /* Generated */ } /* Generated */ e3 = tempReal / optInTimePeriod; /* Generated */ tempReal = e3; -/* Generated */ for( i=optInTimePeriod-1; i > 0 ; i-- ) +/* Generated */ for( i=optInTimePeriod-1; i > 0 ; i-- ) /* Generated */ { /* Generated */ e1 = (k*inReal[today++])+(one_minus_k*e1); /* Generated */ e2 = (k*e1)+(one_minus_k*e2); @@ -476,7 +476,7 @@ /* Generated */ } /* Generated */ e4 = tempReal / optInTimePeriod; /* Generated */ tempReal = e4; -/* Generated */ for( i=optInTimePeriod-1; i > 0 ; i-- ) +/* Generated */ for( i=optInTimePeriod-1; i > 0 ; i-- ) /* Generated */ { /* Generated */ e1 = (k*inReal[today++])+(one_minus_k*e1); /* Generated */ e2 = (k*e1)+(one_minus_k*e2); @@ -486,7 +486,7 @@ /* Generated */ } /* Generated */ e5 = tempReal / optInTimePeriod; /* Generated */ tempReal = e5; -/* Generated */ for( i=optInTimePeriod-1; i > 0 ; i-- ) +/* Generated */ for( i=optInTimePeriod-1; i > 0 ; i-- ) /* Generated */ { /* Generated */ e1 = (k*inReal[today++])+(one_minus_k*e1); /* Generated */ e2 = (k*e1)+(one_minus_k*e2); diff --git a/src/ta_func/ta_TAN.c b/src/ta_func/ta_TAN.c index 4c0fca8c7..85bf914bd 100644 --- a/src/ta_func/ta_TAN.c +++ b/src/ta_func/ta_TAN.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_TANH.c b/src/ta_func/ta_TANH.c index e78e82756..59dc599c4 100644 --- a/src/ta_func/ta_TANH.c +++ b/src/ta_func/ta_TANH.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_TEMA.c b/src/ta_func/ta_TEMA.c index 25112cd5e..cbf4b716c 100644 --- a/src/ta_func/ta_TEMA.c +++ b/src/ta_func/ta_TEMA.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -210,10 +210,10 @@ /* Insert TA function code here. */ /* For an explanation of this function, please read: - * - * Stocks & Commodities V. 12:1 (11-19): + * + * Stocks & Commodities V. 12:1 (11-19): * Smoothing Data With Faster Moving Averages - * Stocks & Commodities V. 12:2 (72-80): + * Stocks & Commodities V. 12:2 (72-80): * Smoothing Data With Less Lag * * Both magazine articles written by Patrick G. Mulloy @@ -246,7 +246,7 @@ /* Make sure there is still something to evaluate. */ if( startIdx > endIdx ) - return ENUM_VALUE(RetCode,TA_SUCCESS,Success); + return ENUM_VALUE(RetCode,TA_SUCCESS,Success); /* Allocate a temporary buffer for the firstEMA. */ tempInt = lookbackTotal+(endIdx-startIdx)+1; @@ -256,13 +256,13 @@ return ENUM_VALUE(RetCode,TA_ALLOC_ERR,AllocErr); #endif - /* Calculate the first EMA */ + /* Calculate the first EMA */ k = PER_TO_K(optInTimePeriod); retCode = FUNCTION_CALL(INT_EMA)( startIdx-(lookbackEMA*2), endIdx, inReal, optInTimePeriod, k, VALUE_HANDLE_OUT(firstEMABegIdx), VALUE_HANDLE_OUT(firstEMANbElement), firstEMA ); - + /* Verify for failure or if not enough data after * calculating the first EMA. */ @@ -279,18 +279,18 @@ { ARRAY_FREE( firstEMA ); return ENUM_VALUE(RetCode,TA_ALLOC_ERR,AllocErr); - } + } #endif retCode = FUNCTION_CALL_DOUBLE(INT_EMA)( 0, VALUE_HANDLE_GET(firstEMANbElement)-1, firstEMA, optInTimePeriod, k, - VALUE_HANDLE_OUT(secondEMABegIdx), VALUE_HANDLE_OUT(secondEMANbElement), + VALUE_HANDLE_OUT(secondEMABegIdx), VALUE_HANDLE_OUT(secondEMANbElement), secondEMA ); /* Return empty output on failure or if not enough data after * calculating the second EMA. */ - if( (retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) || (VALUE_HANDLE_GET(secondEMANbElement) == 0) ) + if( (retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) || (VALUE_HANDLE_GET(secondEMANbElement) == 0) ) { ARRAY_FREE( firstEMA ); ARRAY_FREE( secondEMA ); @@ -325,7 +325,7 @@ * the value by using the EMA2 and EMA1. */ outIdx = 0; - while( outIdx < VALUE_HANDLE_GET(thirdEMANbElement) ) + while( outIdx < VALUE_HANDLE_GET(thirdEMANbElement) ) { outReal[outIdx] += (3.0*firstEMA[firstEMAIdx++]) - (3.0*secondEMA[secondEMAIdx++]); outIdx++; @@ -422,7 +422,7 @@ /* Generated */ if( startIdx < lookbackTotal ) /* Generated */ startIdx = lookbackTotal; /* Generated */ if( startIdx > endIdx ) -/* Generated */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success); +/* Generated */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success); /* Generated */ tempInt = lookbackTotal+(endIdx-startIdx)+1; /* Generated */ ARRAY_ALLOC(firstEMA,tempInt); /* Generated */ #if !defined( _JAVA ) @@ -445,13 +445,13 @@ /* Generated */ { /* Generated */ ARRAY_FREE( firstEMA ); /* Generated */ return ENUM_VALUE(RetCode,TA_ALLOC_ERR,AllocErr); -/* Generated */ } +/* 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 */ VALUE_HANDLE_OUT(secondEMABegIdx), VALUE_HANDLE_OUT(secondEMANbElement), /* Generated */ secondEMA ); -/* Generated */ if( (retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) || (VALUE_HANDLE_GET(secondEMANbElement) == 0) ) +/* Generated */ if( (retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) || (VALUE_HANDLE_GET(secondEMANbElement) == 0) ) /* Generated */ { /* Generated */ ARRAY_FREE( firstEMA ); /* Generated */ ARRAY_FREE( secondEMA ); @@ -471,7 +471,7 @@ /* 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 */ while( outIdx < VALUE_HANDLE_GET(thirdEMANbElement) ) /* Generated */ { /* Generated */ outReal[outIdx] += (3.0*firstEMA[firstEMAIdx++]) - (3.0*secondEMA[secondEMAIdx++]); /* Generated */ outIdx++; diff --git a/src/ta_func/ta_TRANGE.c b/src/ta_func/ta_TRANGE.c index 5661264e0..204d53d38 100644 --- a/src/ta_func/ta_TRANGE.c +++ b/src/ta_func/ta_TRANGE.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -179,11 +179,11 @@ /* Generated */ /**** END GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/ - /* True Range is the greatest of the following: + /* True Range is the greatest of the following: * * val1 = distance from today's high to today's low. * val2 = distance from yesterday's close to today's high. - * val3 = distance from yesterday's close to today's low. + * val3 = distance from yesterday's close to today's low. * * Some books and software makes the first TR value to be * the (high - low) of the first bar. This function instead @@ -197,7 +197,7 @@ * Always one price bar gets consumed. */ if( startIdx < 1 ) - startIdx = 1; + startIdx = 1; /* Make sure there is still something to evaluate. */ if( startIdx > endIdx ) @@ -231,7 +231,7 @@ } VALUE_HANDLE_DEREF(outNBElement) = outIdx; - VALUE_HANDLE_DEREF(outBegIdx) = startIdx; + VALUE_HANDLE_DEREF(outBegIdx) = startIdx; return ENUM_VALUE(RetCode,TA_SUCCESS,Success); } @@ -301,7 +301,7 @@ /* Generated */ #endif /* Generated */ #endif /* Generated */ if( startIdx < 1 ) -/* Generated */ startIdx = 1; +/* Generated */ startIdx = 1; /* Generated */ if( startIdx > endIdx ) /* Generated */ { /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); @@ -326,7 +326,7 @@ /* Generated */ today++; /* Generated */ } /* Generated */ VALUE_HANDLE_DEREF(outNBElement) = outIdx; -/* Generated */ VALUE_HANDLE_DEREF(outBegIdx) = startIdx; +/* Generated */ VALUE_HANDLE_DEREF(outBegIdx) = startIdx; /* Generated */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success); /* Generated */ } /* Generated */ diff --git a/src/ta_func/ta_TRIMA.c b/src/ta_func/ta_TRIMA.c index 125c4ef6e..c325413ad 100644 --- a/src/ta_func/ta_TRIMA.c +++ b/src/ta_func/ta_TRIMA.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -46,7 +46,7 @@ * 031703 MF Fix #701060. Correct logic when using a range with * startIdx/endIdx. Thanks to Chris for reporting this. * 052603 MF Adapt code to compile with .NET Managed C++ - * + * */ /**** START GENCODE SECTION 1 - DO NOT DELETE THIS LINE ****/ @@ -262,7 +262,7 @@ * * It is not clear to me if the Tradestation approach is a bug or a deliberate * decision to do things differently. - * + * * Metastock Implementation * ======================== * Output is the same as the generally accepted implementation. @@ -279,7 +279,7 @@ * * TRIMA at time 'd': ((1*a)+(2*b)+(2*c)+(1*d)) / 6 * TRIMA at time 'e': ((1*b)+(2*c)+(2*d)+(1*e)) / 6 - * + * * To go from TRIMA 'd' to 'e', the following is done: * 1) 'a' and 'b' are substract from the numerator. * 2) 'd' is added to the numerator. @@ -335,11 +335,11 @@ * = 3 * 4 = 12 */ - /* Note: entirely done with int and becomes double only + /* Note: entirely done with int and becomes double only * on assignement to the factor variable. */ i = (optInTimePeriod>>1); - factor = (i+1)*(i+1); + factor = (i+1)*(i+1); factor = 1.0/factor; /* Initialize all the variable before @@ -367,7 +367,7 @@ /* Write the first output */ outIdx = 0; - tempReal = inReal[trailingIdx++]; + tempReal = inReal[trailingIdx++]; outReal[outIdx++] = numerator * factor; todayIdx++; @@ -396,13 +396,13 @@ numerator += tempReal; /* Step (4) */ - tempReal = inReal[trailingIdx++]; + tempReal = inReal[trailingIdx++]; outReal[outIdx++] = numerator * factor; } } else { - /* Even logic. + /* Even logic. * * Very similar to the odd logic, except: * - calculation of the factor is different. @@ -411,7 +411,7 @@ * - Adjustment of numeratorAdd is different. See Step (2). */ i = (optInTimePeriod>>1); - factor = i*(i+1); + factor = i*(i+1); factor = 1.0/factor; /* Initialize all the variable before @@ -441,7 +441,7 @@ /* Write the first output */ outIdx = 0; - tempReal = inReal[trailingIdx++]; + tempReal = inReal[trailingIdx++]; outReal[outIdx++] = numerator * factor; todayIdx++; @@ -470,12 +470,12 @@ numerator += tempReal; /* Step (4) */ - tempReal = inReal[trailingIdx++]; + tempReal = inReal[trailingIdx++]; outReal[outIdx++] = numerator * factor; } } - + VALUE_HANDLE_DEREF(outNBElement) = outIdx; VALUE_HANDLE_DEREF(outBegIdx) = startIdx; @@ -561,7 +561,7 @@ /* Generated */ if( (optInTimePeriod % 2) == 1 ) /* Generated */ { /* Generated */ i = (optInTimePeriod>>1); -/* Generated */ factor = (i+1)*(i+1); +/* Generated */ factor = (i+1)*(i+1); /* Generated */ factor = 1.0/factor; /* Generated */ trailingIdx = startIdx-lookbackTotal; /* Generated */ middleIdx = trailingIdx + i; @@ -583,7 +583,7 @@ /* Generated */ numerator += numeratorAdd; /* Generated */ } /* Generated */ outIdx = 0; -/* Generated */ tempReal = inReal[trailingIdx++]; +/* Generated */ tempReal = inReal[trailingIdx++]; /* Generated */ outReal[outIdx++] = numerator * factor; /* Generated */ todayIdx++; /* Generated */ while( todayIdx <= endIdx ) @@ -597,14 +597,14 @@ /* Generated */ tempReal = inReal[todayIdx++]; /* Generated */ numeratorAdd += tempReal; /* Generated */ numerator += tempReal; -/* Generated */ tempReal = inReal[trailingIdx++]; +/* Generated */ tempReal = inReal[trailingIdx++]; /* Generated */ outReal[outIdx++] = numerator * factor; /* Generated */ } /* Generated */ } /* Generated */ else /* Generated */ { /* Generated */ i = (optInTimePeriod>>1); -/* Generated */ factor = i*(i+1); +/* Generated */ factor = i*(i+1); /* Generated */ factor = 1.0/factor; /* Generated */ trailingIdx = startIdx-lookbackTotal; /* Generated */ middleIdx = trailingIdx + i - 1; @@ -626,7 +626,7 @@ /* Generated */ numerator += numeratorAdd; /* Generated */ } /* Generated */ outIdx = 0; -/* Generated */ tempReal = inReal[trailingIdx++]; +/* Generated */ tempReal = inReal[trailingIdx++]; /* Generated */ outReal[outIdx++] = numerator * factor; /* Generated */ todayIdx++; /* Generated */ while( todayIdx <= endIdx ) @@ -640,7 +640,7 @@ /* Generated */ tempReal = inReal[todayIdx++]; /* Generated */ numeratorAdd += tempReal; /* Generated */ numerator += tempReal; -/* Generated */ tempReal = inReal[trailingIdx++]; +/* Generated */ tempReal = inReal[trailingIdx++]; /* Generated */ outReal[outIdx++] = numerator * factor; /* Generated */ } /* Generated */ } diff --git a/src/ta_func/ta_TRIX.c b/src/ta_func/ta_TRIX.c index 624d05372..9a8a49e8b 100644 --- a/src/ta_func/ta_TRIX.c +++ b/src/ta_func/ta_TRIX.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -211,10 +211,10 @@ { VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); - return ENUM_VALUE(RetCode,TA_SUCCESS,Success); + return ENUM_VALUE(RetCode,TA_SUCCESS,Success); } - VALUE_HANDLE_DEREF(outBegIdx) = startIdx; + VALUE_HANDLE_DEREF(outBegIdx) = startIdx; nbElementToOutput = (endIdx-startIdx)+1+totalLookback; @@ -232,13 +232,13 @@ } #endif - /* Calculate the first EMA */ - k = PER_TO_K(optInTimePeriod); + /* Calculate the first EMA */ + k = PER_TO_K(optInTimePeriod); retCode = FUNCTION_CALL(INT_EMA)( (startIdx-totalLookback), endIdx, inReal, optInTimePeriod, k, VALUE_HANDLE_OUT(begIdx), VALUE_HANDLE_OUT(nbElement), tempBuffer ); - + /* Verify for failure or if not enough data after * calculating the EMA. */ @@ -252,13 +252,13 @@ nbElementToOutput--; /* Make this variable zero base from now on. */ - /* Calculate the second EMA */ + /* Calculate the second EMA */ nbElementToOutput -= emaLookback; retCode = FUNCTION_CALL_DOUBLE(INT_EMA)( 0, nbElementToOutput, tempBuffer, optInTimePeriod, k, VALUE_HANDLE_OUT(begIdx), VALUE_HANDLE_OUT(nbElement), tempBuffer ); - + /* Verify for failure or if not enough data after * calculating the EMA. */ @@ -270,13 +270,13 @@ return retCode; } - /* Calculate the third EMA */ + /* Calculate the third EMA */ nbElementToOutput -= emaLookback; retCode = FUNCTION_CALL_DOUBLE(INT_EMA)( 0, nbElementToOutput, tempBuffer, optInTimePeriod, k, VALUE_HANDLE_OUT(begIdx), VALUE_HANDLE_OUT(nbElement), tempBuffer ); - + /* Verify for failure or if not enough data after * calculating the EMA. */ @@ -386,9 +386,9 @@ /* Generated */ { /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); -/* Generated */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success); +/* Generated */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success); /* Generated */ } -/* Generated */ VALUE_HANDLE_DEREF(outBegIdx) = startIdx; +/* Generated */ VALUE_HANDLE_DEREF(outBegIdx) = startIdx; /* Generated */ nbElementToOutput = (endIdx-startIdx)+1+totalLookback; /* Generated */ ARRAY_ALLOC(tempBuffer, nbElementToOutput ); /* Generated */ #if !defined( _JAVA ) && !defined( USE_SUBARRAY ) @@ -399,7 +399,7 @@ /* Generated */ return ENUM_VALUE(RetCode,TA_ALLOC_ERR,AllocErr); /* Generated */ } /* Generated */ #endif -/* Generated */ k = PER_TO_K(optInTimePeriod); +/* Generated */ k = PER_TO_K(optInTimePeriod); /* Generated */ retCode = FUNCTION_CALL(INT_EMA)( (startIdx-totalLookback), endIdx, inReal, /* Generated */ optInTimePeriod, k, /* Generated */ VALUE_HANDLE_OUT(begIdx), VALUE_HANDLE_OUT(nbElement), diff --git a/src/ta_func/ta_TSF.c b/src/ta_func/ta_TSF.c index 8ee281d0c..6c3f7f2f2 100644 --- a/src/ta_func/ta_TSF.c +++ b/src/ta_func/ta_TSF.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_TYPPRICE.c b/src/ta_func/ta_TYPPRICE.c index beb8ea888..205576769 100644 --- a/src/ta_func/ta_TYPPRICE.c +++ b/src/ta_func/ta_TYPPRICE.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_ULTOSC.c b/src/ta_func/ta_ULTOSC.c index 516535b75..01d91d2ce 100644 --- a/src/ta_func/ta_ULTOSC.c +++ b/src/ta_func/ta_ULTOSC.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -94,7 +94,7 @@ /* Generated */ /* Generated */ #endif /**** END GENCODE SECTION 1 - DO NOT DELETE THIS LINE ****/ -{ +{ /* insert local variable here */ int maxPeriod; /**** START GENCODE SECTION 2 - DO NOT DELETE THIS LINE ****/ @@ -267,13 +267,13 @@ usedFlag[0] = 0; usedFlag[1] = 0; usedFlag[2] = 0; - for ( i = 0; i < 3; ++i ) + for ( i = 0; i < 3; ++i ) { longestPeriod = 0; longestIndex = 0; - for ( j = 0; j < 3; ++j ) + for ( j = 0; j < 3; ++j ) { - if ( (usedFlag[j] == 0) && (periods[j] > longestPeriod) ) + if ( (usedFlag[j] == 0) && (periods[j] > longestPeriod) ) { longestPeriod = periods[j]; longestIndex = j; @@ -289,10 +289,10 @@ /* Adjust startIdx for lookback period. */ lookbackTotal = LOOKBACK_CALL(ULTOSC)( optInTimePeriod1, optInTimePeriod2, optInTimePeriod3 ); if( startIdx < lookbackTotal ) startIdx = lookbackTotal; - + /* Make sure there is still something to evaluate. */ if( startIdx > endIdx ) return ENUM_VALUE(RetCode,TA_SUCCESS,Success); - + /* Prime running totals used in moving averages */ #define CALC_TERMS(day) \ { \ @@ -335,7 +335,7 @@ trailingIdx2 = today - optInTimePeriod2 + 1; trailingIdx3 = today - optInTimePeriod3 + 1; while( today <= endIdx ) - { + { /* Add on today's terms */ CALC_TERMS(today); a1Total += closeMinusTrueLow; @@ -344,14 +344,14 @@ b1Total += trueRange; b2Total += trueRange; b3Total += trueRange; - + /* Calculate the oscillator value for today */ - output = 0.0; - + output = 0.0; + if( !TA_IS_ZERO(b1Total) ) output += 4.0*(a1Total/b1Total); if( !TA_IS_ZERO(b2Total) ) output += 2.0*(a2Total/b2Total); - if( !TA_IS_ZERO(b3Total) ) output += a3Total/b3Total; - + if( !TA_IS_ZERO(b3Total) ) output += a3Total/b3Total; + /* Remove the trailing terms to prepare for next day */ CALC_TERMS(trailingIdx1); a1Total -= closeMinusTrueLow; @@ -360,28 +360,28 @@ CALC_TERMS(trailingIdx2); a2Total -= closeMinusTrueLow; b2Total -= trueRange; - + CALC_TERMS(trailingIdx3); a3Total -= closeMinusTrueLow; b3Total -= trueRange; - + /* Last operation is to write the output. Must * be done after the trailing index have all been * taken care of because the caller is allowed - * to have the input array to be also the output + * to have the input array to be also the output * array. */ outReal[outIdx] = 100.0 * (output / 7.0); /* Increment indexes */ outIdx++; - today++; - trailingIdx1++; - trailingIdx2++; + today++; + trailingIdx1++; + trailingIdx2++; trailingIdx3++; } #undef CALC_TERMS - + /* All done. Indicate the output limits and return. */ VALUE_HANDLE_DEREF(outNBElement) = outIdx; VALUE_HANDLE_DEREF(outBegIdx) = startIdx; @@ -493,13 +493,13 @@ /* Generated */ usedFlag[0] = 0; /* Generated */ usedFlag[1] = 0; /* Generated */ usedFlag[2] = 0; -/* Generated */ for ( i = 0; i < 3; ++i ) +/* Generated */ for ( i = 0; i < 3; ++i ) /* Generated */ { /* Generated */ longestPeriod = 0; /* Generated */ longestIndex = 0; -/* Generated */ for ( j = 0; j < 3; ++j ) +/* Generated */ for ( j = 0; j < 3; ++j ) /* Generated */ { -/* Generated */ if ( (usedFlag[j] == 0) && (periods[j] > longestPeriod) ) +/* Generated */ if ( (usedFlag[j] == 0) && (periods[j] > longestPeriod) ) /* Generated */ { /* Generated */ longestPeriod = periods[j]; /* Generated */ longestIndex = j; @@ -550,7 +550,7 @@ /* Generated */ trailingIdx2 = today - optInTimePeriod2 + 1; /* Generated */ trailingIdx3 = today - optInTimePeriod3 + 1; /* Generated */ while( today <= endIdx ) -/* Generated */ { +/* Generated */ { /* Generated */ CALC_TERMS(today); /* Generated */ a1Total += closeMinusTrueLow; /* Generated */ a2Total += closeMinusTrueLow; @@ -558,10 +558,10 @@ /* Generated */ b1Total += trueRange; /* Generated */ b2Total += trueRange; /* Generated */ b3Total += trueRange; -/* Generated */ output = 0.0; +/* Generated */ output = 0.0; /* Generated */ if( !TA_IS_ZERO(b1Total) ) output += 4.0*(a1Total/b1Total); /* Generated */ if( !TA_IS_ZERO(b2Total) ) output += 2.0*(a2Total/b2Total); -/* Generated */ if( !TA_IS_ZERO(b3Total) ) output += a3Total/b3Total; +/* Generated */ if( !TA_IS_ZERO(b3Total) ) output += a3Total/b3Total; /* Generated */ CALC_TERMS(trailingIdx1); /* Generated */ a1Total -= closeMinusTrueLow; /* Generated */ b1Total -= trueRange; @@ -573,9 +573,9 @@ /* Generated */ b3Total -= trueRange; /* Generated */ outReal[outIdx] = 100.0 * (output / 7.0); /* Generated */ outIdx++; -/* Generated */ today++; -/* Generated */ trailingIdx1++; -/* Generated */ trailingIdx2++; +/* Generated */ today++; +/* Generated */ trailingIdx1++; +/* Generated */ trailingIdx2++; /* Generated */ trailingIdx3++; /* Generated */ } /* Generated */ #undef CALC_TERMS diff --git a/src/ta_func/ta_VAR.c b/src/ta_func/ta_VAR.c index 35fcaa702..db6af4dea 100644 --- a/src/ta_func/ta_VAR.c +++ b/src/ta_func/ta_VAR.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -211,7 +211,7 @@ /* Insert TA function code here. */ return FUNCTION_CALL(INT_VAR)( startIdx, endIdx, inReal, - optInTimePeriod, /* From 1 to TA_INTEGER_MAX */ + optInTimePeriod, /* From 1 to TA_INTEGER_MAX */ outBegIdx, outNBElement, outReal ); } @@ -224,15 +224,15 @@ enum class Core::RetCode Core::TA_INT_VAR( int startIdx, int endIdx, SubArray^ inReal, - int optInTimePeriod, + int optInTimePeriod, [Out]int% outBegIdx, [Out]int% outNBElement, SubArray^ outReal ) -#elif defined( _MANAGED ) +#elif defined( _MANAGED ) enum class Core::RetCode Core::TA_INT_VAR( int startIdx, int endIdx, cli::array^ inReal, - int optInTimePeriod, + int optInTimePeriod, [Out]int% outBegIdx, [Out]int% outNBElement, cli::array^ outReal ) @@ -240,7 +240,7 @@ enum class Core::RetCode Core::TA_INT_VAR( int startIdx, public RetCode TA_INT_VAR( int startIdx, int endIdx, INPUT_TYPE inReal[], - int optInTimePeriod, /* From 1 to TA_INTEGER_MAX */ + int optInTimePeriod, /* From 1 to TA_INTEGER_MAX */ MInteger outBegIdx, MInteger outNBElement, double outReal[] ) @@ -248,7 +248,7 @@ public RetCode TA_INT_VAR( int startIdx, TA_RetCode TA_PREFIX(INT_VAR)( int startIdx, int endIdx, const INPUT_TYPE *inReal, - int optInTimePeriod, /* From 1 to TA_INTEGER_MAX */ + int optInTimePeriod, /* From 1 to TA_INTEGER_MAX */ int *outBegIdx, int *outNBElement, double *outReal ) @@ -403,7 +403,7 @@ TA_RetCode TA_PREFIX(INT_VAR)( int startIdx, /* Generated */ #endif /* Generated */ #endif /* Generated */ return FUNCTION_CALL(INT_VAR)( startIdx, endIdx, inReal, -/* Generated */ optInTimePeriod, +/* Generated */ optInTimePeriod, /* Generated */ outBegIdx, outNBElement, outReal ); /* Generated */ } /* Generated */ #if defined( _MANAGED ) && defined( USE_SUBARRAY ) && defined(USE_SINGLE_PRECISION_INPUT) @@ -413,15 +413,15 @@ TA_RetCode TA_PREFIX(INT_VAR)( int startIdx, /* Generated */ enum class Core::RetCode Core::TA_INT_VAR( int startIdx, /* Generated */ int endIdx, /* Generated */ SubArray^ inReal, -/* Generated */ int optInTimePeriod, +/* Generated */ int optInTimePeriod, /* Generated */ [Out]int% outBegIdx, /* Generated */ [Out]int% outNBElement, /* Generated */ SubArray^ outReal ) -/* Generated */ #elif defined( _MANAGED ) +/* Generated */ #elif defined( _MANAGED ) /* Generated */ enum class Core::RetCode Core::TA_INT_VAR( int startIdx, /* Generated */ int endIdx, /* Generated */ cli::array^ inReal, -/* Generated */ int optInTimePeriod, +/* Generated */ int optInTimePeriod, /* Generated */ [Out]int% outBegIdx, /* Generated */ [Out]int% outNBElement, /* Generated */ cli::array^ outReal ) @@ -429,7 +429,7 @@ TA_RetCode TA_PREFIX(INT_VAR)( int startIdx, /* Generated */ public RetCode TA_INT_VAR( int startIdx, /* Generated */ int endIdx, /* Generated */ INPUT_TYPE inReal[], -/* Generated */ int optInTimePeriod, +/* Generated */ int optInTimePeriod, /* Generated */ MInteger outBegIdx, /* Generated */ MInteger outNBElement, /* Generated */ double outReal[] ) @@ -437,7 +437,7 @@ TA_RetCode TA_PREFIX(INT_VAR)( int startIdx, /* Generated */ TA_RetCode TA_PREFIX(INT_VAR)( int startIdx, /* Generated */ int endIdx, /* Generated */ const INPUT_TYPE *inReal, -/* Generated */ int optInTimePeriod, +/* Generated */ int optInTimePeriod, /* Generated */ int *outBegIdx, /* Generated */ int *outNBElement, /* Generated */ double *outReal ) diff --git a/src/ta_func/ta_WCLPRICE.c b/src/ta_func/ta_WCLPRICE.c index c117aec20..6732c6343 100644 --- a/src/ta_func/ta_WCLPRICE.c +++ b/src/ta_func/ta_WCLPRICE.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/ta_func/ta_WILLR.c b/src/ta_func/ta_WILLR.c index 43d29dce2..469ee2338 100644 --- a/src/ta_func/ta_WILLR.c +++ b/src/ta_func/ta_WILLR.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -237,7 +237,7 @@ trailingIdx = startIdx-nbInitialElementNeeded; lowestIdx = highestIdx = -1; diff = highest = lowest = 0.0; - + while( today <= endIdx ) { /* Set the lowest low */ @@ -294,9 +294,9 @@ outReal[outIdx++] = (highest-inClose[today])/diff; else outReal[outIdx++] = 0.0; - + trailingIdx++; - today++; + today++; } /* Keep the outBegIdx relative to the @@ -449,7 +449,7 @@ /* Generated */ else /* Generated */ outReal[outIdx++] = 0.0; /* Generated */ trailingIdx++; -/* Generated */ today++; +/* Generated */ today++; /* Generated */ } /* Generated */ VALUE_HANDLE_DEREF(outBegIdx) = startIdx; /* Generated */ VALUE_HANDLE_DEREF(outNBElement) = outIdx; diff --git a/src/ta_func/ta_WMA.c b/src/ta_func/ta_WMA.c index 28f7b32c7..b933d85ae 100644 --- a/src/ta_func/ta_WMA.c +++ b/src/ta_func/ta_WMA.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -216,15 +216,15 @@ * In that case outputs equals inputs for the requested * range. */ - if( optInTimePeriod == 1 ) - { + if( optInTimePeriod == 1 ) + { VALUE_HANDLE_DEREF(outBegIdx) = startIdx; VALUE_HANDLE_DEREF(outNBElement) = endIdx-startIdx+1; #if defined( USE_SINGLE_PRECISION_INPUT ) - ARRAY_MEMMOVEMIX( outReal, 0, inReal, startIdx, (int)VALUE_HANDLE_DEREF(outNBElement) ); - #else - ARRAY_MEMMOVE ( outReal, 0, inReal, startIdx, (int)VALUE_HANDLE_DEREF(outNBElement) ); + ARRAY_MEMMOVEMIX( outReal, 0, inReal, startIdx, (int)VALUE_HANDLE_DEREF(outNBElement) ); + #else + ARRAY_MEMMOVE ( outReal, 0, inReal, startIdx, (int)VALUE_HANDLE_DEREF(outNBElement) ); #endif return ENUM_VALUE(RetCode,TA_SUCCESS,Success); @@ -238,13 +238,13 @@ /* The algo used here use a very basic property of * multiplication/addition: (x*2) = x+x - * - * As an example, a 3 period weighted can be + * + * As an example, a 3 period weighted can be * interpreted in two way: * (x1*1)+(x2*2)+(x3*3) * OR * x1+x2+x2+x3+x3+x3 (this is the periodSum) - * + * * When you move forward in the time serie * you can quickly adjust the periodSum for the * period by substracting: @@ -386,14 +386,14 @@ /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); /* Generated */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success); /* Generated */ } -/* Generated */ if( optInTimePeriod == 1 ) -/* Generated */ { +/* Generated */ if( optInTimePeriod == 1 ) +/* Generated */ { /* Generated */ VALUE_HANDLE_DEREF(outBegIdx) = startIdx; /* Generated */ VALUE_HANDLE_DEREF(outNBElement) = endIdx-startIdx+1; /* Generated */ #if defined( USE_SINGLE_PRECISION_INPUT ) -/* Generated */ ARRAY_MEMMOVEMIX( outReal, 0, inReal, startIdx, (int)VALUE_HANDLE_DEREF(outNBElement) ); -/* Generated */ #else -/* Generated */ ARRAY_MEMMOVE ( outReal, 0, inReal, startIdx, (int)VALUE_HANDLE_DEREF(outNBElement) ); +/* Generated */ ARRAY_MEMMOVEMIX( outReal, 0, inReal, startIdx, (int)VALUE_HANDLE_DEREF(outNBElement) ); +/* Generated */ #else +/* Generated */ ARRAY_MEMMOVE ( outReal, 0, inReal, startIdx, (int)VALUE_HANDLE_DEREF(outNBElement) ); /* Generated */ #endif /* Generated */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success); /* Generated */ } diff --git a/src/ta_func/ta_utility.c b/src/ta_func/ta_utility.c index 818656045..7b929ef66 100644 --- a/src/ta_func/ta_utility.c +++ b/src/ta_func/ta_utility.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -74,11 +74,11 @@ TA_RetCode TA_SetUnstablePeriod( TA_FuncUnstId id, if( id == ENUM_VALUE(FuncUnstId,TA_FUNC_UNST_ALL,FuncUnstAll) ) { for( i=0; i < (int)ENUM_VALUE(FuncUnstId,TA_FUNC_UNST_ALL,FuncUnstAll); i++ ) - { + { #if defined( _MANAGED ) Globals->unstablePeriod[(int)i] = unstablePeriod; #else - TA_Globals->unstablePeriod[i] = unstablePeriod; + TA_Globals->unstablePeriod[i] = unstablePeriod; #endif } } @@ -87,8 +87,8 @@ TA_RetCode TA_SetUnstablePeriod( TA_FuncUnstId id, #if defined( _MANAGED ) Globals->unstablePeriod[(int)id] = unstablePeriod; #else - TA_Globals->unstablePeriod[id] = unstablePeriod; - #endif + TA_Globals->unstablePeriod[id] = unstablePeriod; + #endif } return ENUM_VALUE(RetCode,TA_SUCCESS,Success); diff --git a/src/tools/gen_code/gen_code.c b/src/tools/gen_code/gen_code.c index 717469aa5..2d6d2bb37 100644 --- a/src/tools/gen_code/gen_code.c +++ b/src/tools/gen_code/gen_code.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or diff --git a/src/tools/ta_regtest/ta_regtest.c b/src/tools/ta_regtest/ta_regtest.c index 13f93d384..331329e80 100644 --- a/src/tools/ta_regtest/ta_regtest.c +++ b/src/tools/ta_regtest/ta_regtest.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -136,7 +136,7 @@ int main( int argc, char **argv ) return TA_REGTEST_BAD_USER_PARAM; } - /* Some tests are using randomness. */ + /* Some tests are using randomness. */ srand( (unsigned)time( NULL ) ); /* Test utility like List/Stack/Dictionary/Memory Allocation etc... */ @@ -168,7 +168,7 @@ int main( int argc, char **argv ) } else if( nbProfiledCall > 0 ) { - printf( "\nNumber profiled function call = %d function calls", nbProfiledCall ); + printf( "\nNumber profiled function call = %d function calls", nbProfiledCall ); #ifdef WIN32 QueryPerformanceFrequency(&QPFrequency); @@ -181,8 +181,8 @@ int main( int argc, char **argv ) printf( "\nTotal execution time = %g milliseconds", timeInProfiledCall/freq/1000.0 ); printf( "\nWorst single function call = %g milliseconds", worstProfiledCall/freq/1000.0 ); printf( "\nAverage execution time per function = %g microseconds\n", (timeInProfiledCall/freq/1000000.0)/((double)nbProfiledCall) ); -#endif - } +#endif + } printf( "\n* All tests succeeded. Enjoy the library. *\n" ); } @@ -252,7 +252,7 @@ static ErrorNumber testTAFunction_ALL( void ) printf( "done.\n" ); \ fflush(stdout); \ } - DO_TEST( test_func_1in_1out, "MATH,VECTOR,DCPERIOD/PHASE,TRENDLINE/MODE" ); + DO_TEST( test_func_1in_1out, "MATH,VECTOR,DCPERIOD/PHASE,TRENDLINE/MODE" ); DO_TEST( test_func_ma, "All Moving Averages" ); DO_TEST( test_func_per_hl, "AROON,CORREL,BETA" ); DO_TEST( test_func_per_hlc, "CCI,WILLR,ULTOSC,NATR" ); @@ -265,7 +265,7 @@ static ErrorNumber testTAFunction_ALL( void ) DO_TEST( test_func_sar, "SAR,SAREXT" ); DO_TEST( test_func_stoch, "STOCH,STOCHF,STOCHRSI" ); DO_TEST( test_func_per_hlcv, "MFI,AD,ADOSC" ); - DO_TEST( test_func_1in_2out, "PHASOR,SINE" ); + DO_TEST( test_func_1in_2out, "PHASOR,SINE" ); DO_TEST( test_func_per_ema, "TRIX" ); DO_TEST( test_func_macd, "MACD,MACDFIX,MACDEXT" ); DO_TEST( test_func_mom_roc, "MOM,ROC,ROCP,ROCR,ROCR100" ); diff --git a/src/tools/ta_regtest/ta_test_func/test_1in_1out.c b/src/tools/ta_regtest/ta_test_func/test_1in_1out.c index 36dbfea22..6d3375230 100644 --- a/src/tools/ta_regtest/ta_test_func/test_1in_1out.c +++ b/src/tools/ta_regtest/ta_test_func/test_1in_1out.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -49,7 +49,7 @@ /* Description: * * Test functions which have the following - * characterisic: + * characterisic: * - have one input and one output * - there is no optional parameters */ @@ -90,7 +90,7 @@ typedef struct TA_Integer startIdx; TA_Integer endIdx; - + TA_RetCode expectedRetCode; TA_Integer oneOfTheExpectedOutRealIndex0; @@ -173,7 +173,7 @@ ErrorNumber test_func_1in_1out( TA_History *history ) TA_SetUnstablePeriod( TA_FUNC_UNST_ALL, 0 ); /* All test succeed. */ - return TA_TEST_PASS; + return TA_TEST_PASS; } /**** Local functions definitions. ****/ @@ -197,8 +197,8 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, (void)outputBufferInt; *isOutputInteger = 0; - - testParam = (TA_RangeTestParam *)opaqueData; + + testParam = (TA_RangeTestParam *)opaqueData; switch( testParam->test->theFunction ) { @@ -207,7 +207,7 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, endIdx, testParam->price, outBegIdx, - outNbElement, + outNbElement, outputBuffer ); *lookback = TA_HT_DCPERIOD_Lookback(); break; @@ -279,7 +279,7 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, endIdx, testParam->price, outBegIdx, - outNbElement, + outNbElement, outputBuffer ); *lookback = TA_SIN_Lookback(); break; @@ -390,7 +390,7 @@ static ErrorNumber do_test( const TA_History *history, outBegIdx = outNbElement = 0; - /* Make another call where the input and the output + /* Make another call where the input and the output * are the same buffer. */ switch( test->theFunction ) @@ -470,31 +470,31 @@ static ErrorNumber do_test( const TA_History *history, switch( test->theFunction ) { case TA_HT_DCPERIOD_TEST: - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_HT_DCPERIOD, (void *)&testParam, 1, 0 ); break; case TA_HT_DCPHASE_TEST: - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_HT_DCPHASE, (void *)&testParam, 1, 360 ); break; case TA_HT_TRENDLINE_TEST: - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_HT_TRENDLINE, (void *)&testParam, 1, 0 ); break; case TA_HT_TRENDMODE_TEST: - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_HT_TRENDMODE, (void *)&testParam, 1, 0 ); break; default: - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_NONE, (void *)&testParam, 1, 0 ); } diff --git a/src/tools/ta_regtest/ta_test_func/test_1in_2out.c b/src/tools/ta_regtest/ta_test_func/test_1in_2out.c index a967ec484..edcf0d4e3 100644 --- a/src/tools/ta_regtest/ta_test_func/test_1in_2out.c +++ b/src/tools/ta_regtest/ta_test_func/test_1in_2out.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -49,7 +49,7 @@ /* Description: * * Test functions which have the following - * characterisic: + * characterisic: * - have one input and two outputs * - there is no optional parameters */ @@ -87,7 +87,7 @@ typedef struct TA_Integer startIdx; TA_Integer endIdx; - + TA_RetCode expectedRetCode; TA_Integer oneOfTheExpectedOutRealIndex0; @@ -140,24 +140,24 @@ static TA_Test tableTest[] = 252-64, 1.00, 63, 252-63 }, - { 1, TA_HT_PHASOR_TEST, 0, 0, 251, TA_SUCCESS, 0, 0.9456, - 0, 5.2143, + { 1, TA_HT_PHASOR_TEST, 0, 0, 251, TA_SUCCESS, 0, 0.9456, + 0, 5.2143, 32, 252-32 }, /* First Value */ - { 0, TA_HT_PHASOR_TEST, 0, 0, 251, TA_SUCCESS, 1, 2.7539, + { 0, TA_HT_PHASOR_TEST, 0, 0, 251, TA_SUCCESS, 1, 2.7539, 1, 2.4129, 32, 252-32 }, - { 0, TA_HT_PHASOR_TEST, 0, 0, 251, TA_SUCCESS, 9, -0.7235, + { 0, TA_HT_PHASOR_TEST, 0, 0, 251, TA_SUCCESS, 9, -0.7235, 9, -5.9336, 32, 252-32 }, { 0, TA_HT_PHASOR_TEST, 0, 0, 251, TA_SUCCESS, 252-34, 0.8386, - 252-34, -0.8913, + 252-34, -0.8913, 32, 252-32 }, { 0, TA_HT_PHASOR_TEST, 0, 0, 251, TA_SUCCESS, 252-33, 0.3258, - 252-33, -0.9447, + 252-33, -0.9447, 32, 252-32 }, /* Last Value */ @@ -196,7 +196,7 @@ ErrorNumber test_func_1in_2out( TA_History *history ) TA_SetUnstablePeriod( TA_FUNC_UNST_ALL, 0 ); /* All test succeed. */ - return TA_TEST_PASS; + return TA_TEST_PASS; } /**** Local functions definitions. ****/ @@ -216,15 +216,15 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, TA_Real *out1; TA_Real *out2; TA_Real *dummyOutput; - + (void)outputBufferInt; *isOutputInteger = 0; - - testParam = (TA_RangeTestParam *)opaqueData; + + testParam = (TA_RangeTestParam *)opaqueData; dummyOutput = TA_Malloc( (endIdx-startIdx+1) * sizeof(TA_Real) ); - + if( outputNb == 0 ) { out1 = outputBuffer; @@ -243,7 +243,7 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, endIdx, testParam->price, outBegIdx, - outNbElement, + outNbElement, out1, out2 ); *lookback = TA_HT_PHASOR_Lookback(); break; @@ -252,7 +252,7 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, endIdx, testParam->price, outBegIdx, - outNbElement, + outNbElement, out1, out2 ); *lookback = TA_HT_SINE_Lookback(); break; @@ -342,7 +342,7 @@ static ErrorNumber do_test( const TA_History *history, outBegIdx = outNbElement = 0; - /* Make another call where the input and the output + /* Make another call where the input and the output * are the same buffer. */ switch( test->theFunction ) @@ -388,7 +388,7 @@ static ErrorNumber do_test( const TA_History *history, CHECK_EXPECTED_VALUE( gBuffer[0].in, 0 ); CHECK_EXPECTED_VALUE( gBuffer[1].out1, 1 ); - /* Make another call where the input and the output + /* Make another call where the input and the output * are the same buffer. */ switch( test->theFunction ) @@ -445,18 +445,18 @@ static ErrorNumber do_test( const TA_History *history, switch( test->theFunction ) { case TA_HT_PHASOR_TEST: - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_HT_PHASOR, (void *)&testParam, 1, 0 ); break; case TA_HT_SINE_TEST: - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_HT_SINE, (void *)&testParam, 1, 10 ); break; default: - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_NONE, (void *)&testParam, 1, 0 ); } diff --git a/src/tools/ta_regtest/ta_test_func/test_adx.c b/src/tools/ta_regtest/ta_test_func/test_adx.c index 312ff275a..170605bb1 100644 --- a/src/tools/ta_regtest/ta_test_func/test_adx.c +++ b/src/tools/ta_regtest/ta_test_func/test_adx.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -122,7 +122,7 @@ static TA_Test tableTest[] = { TST_PLUS_DI, 1, 0, 0, 251, 1, TA_SUCCESS, 0, 0.478, 1, 252-1 }, { TST_MINUS_DM, 1, 0, 0, 251, 1, TA_SUCCESS, 0, 0.0, 1, 252-1 }, { TST_PLUS_DM, 1, 0, 0, 251, 1, TA_SUCCESS, 0, 1.69, 1, 252-1 }, - + /* Normal regression tests. */ { TST_ADXR,1, 0, 0, 251, 14, TA_SUCCESS, 0, 19.8666, 40, 252-40 }, /* First Value */ { TST_ADXR,0, 0, 0, 251, 14, TA_SUCCESS, 1, 18.9092, 40, 252-40 }, @@ -149,8 +149,8 @@ static TA_Test tableTest[] = { TST_MINUS_DI, 0, 0, 0, 251, 14, TA_SUCCESS, 237, 21.1988, 14, 252-14 }, /* Last Value */ { TST_DX, 1, 0, 0, 251, 14, TA_SUCCESS, 0, 19.3689, 14, 252-14 }, /* First Value */ - { TST_DX, 0, 0, 0, 251, 14, TA_SUCCESS, 1, 9.7131, 14, 252-14 }, - { TST_DX, 0, 0, 0, 251, 14, TA_SUCCESS, 2, 17.2905, 14, 252-14 }, + { TST_DX, 0, 0, 0, 251, 14, TA_SUCCESS, 1, 9.7131, 14, 252-14 }, + { TST_DX, 0, 0, 0, 251, 14, TA_SUCCESS, 2, 17.2905, 14, 252-14 }, { TST_DX, 0, 0, 0, 251, 14, TA_SUCCESS, 236, 10.6731, 14, 252-14 }, { TST_DX, 0, 0, 0, 251, 14, TA_SUCCESS, 237, 0.4722, 14, 252-14 }, /* Last Value */ @@ -176,9 +176,9 @@ static TA_Test tableTest[] = { TST_MINUS_DI, 0, 0, 0, 251, 14, TA_SUCCESS, 237, 21.0, 14, 252-14 }, /* Last Value */ { TST_DX, 1, 0, 0, 251, 14, TA_SUCCESS, 0, 20.0, 14, 252-14 }, /* First Value */ - { TST_DX, 0, 0, 0, 251, 14, TA_SUCCESS, 1, 9.0, 14, 252-14 }, - { TST_DX, 0, 0, 0, 251, 14, TA_SUCCESS, 2, 18.0, 14, 252-14 }, - { TST_DX, 0, 0, 0, 251, 14, TA_SUCCESS, 236, 10.0, 14, 252-14 }, + { TST_DX, 0, 0, 0, 251, 14, TA_SUCCESS, 1, 9.0, 14, 252-14 }, + { TST_DX, 0, 0, 0, 251, 14, TA_SUCCESS, 2, 18.0, 14, 252-14 }, + { TST_DX, 0, 0, 0, 251, 14, TA_SUCCESS, 236, 10.0, 14, 252-14 }, { TST_DX, 0, 0, 0, 251, 14, TA_SUCCESS, 237, 0.0, 14, 252-14 }, /* Last Value */ { TST_ADX, 1, 0, 0, 251, 14, TA_SUCCESS, 0, 23.0, 27, 252-27 }, /* First Value */ @@ -221,7 +221,7 @@ ErrorNumber test_func_adx( TA_History *history ) TA_SetUnstablePeriod( TA_FUNC_UNST_ALL, 0 ); /* All test succeed. */ - return TA_TEST_PASS; + return TA_TEST_PASS; } /**** Local functions definitions. ****/ @@ -241,10 +241,10 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, (void)outputNb; (void)outputBufferInt; - + *isOutputInteger = 0; - testParam = (TA_RangeTestParam *)opaqueData; + testParam = (TA_RangeTestParam *)opaqueData; switch( testParam->test->id ) { @@ -632,43 +632,43 @@ static ErrorNumber do_test( const TA_History *history, switch( test->id ) { case TST_MINUS_DM: - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_MINUS_DM, (void *)&testParam, 1, 0 ); break; case TST_MINUS_DI: - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_MINUS_DI, (void *)&testParam, 1, 2 ); break; case TST_DX: - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_DX, (void *)&testParam, 1, 2 ); break; case TST_ADX: - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_ADX, (void *)&testParam, 1, 2 ); break; case TST_PLUS_DM: - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_PLUS_DM, (void *)&testParam, 1, 0 ); break; case TST_PLUS_DI: - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_PLUS_DI, (void *)&testParam, 1, 2 ); break; case TST_ADXR: - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_ADX, (void *)&testParam, 1, 2 ); break; diff --git a/src/tools/ta_regtest/ta_test_func/test_avgdev.c b/src/tools/ta_regtest/ta_test_func/test_avgdev.c index 039f80632..49bf28067 100644 --- a/src/tools/ta_regtest/ta_test_func/test_avgdev.c +++ b/src/tools/ta_regtest/ta_test_func/test_avgdev.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -104,7 +104,7 @@ static TA_Test tableTest[] = /* AVGDEV TEST */ /*************************/ { 1, 0, 251, 5, TA_SUCCESS, 0, 1.0184, 4, 252-4 }, /* First Value */ - { 0, 0, 251, 5, TA_SUCCESS, 1, 0.3684, 4, 252-4 }, + { 0, 0, 251, 5, TA_SUCCESS, 1, 0.3684, 4, 252-4 }, { 0, 0, 251, 5, TA_SUCCESS, 252-5, 0.5952, 4, 252-4 }, /* Last Value */ }; @@ -135,7 +135,7 @@ ErrorNumber test_func_avgdev( TA_History *history ) } /* All test succeed. */ - return TA_TEST_PASS; + return TA_TEST_PASS; } /**** Local functions definitions. ****/ @@ -157,14 +157,14 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, (void)outputBufferInt; *isOutputInteger = 0; - - testParam = (TA_RangeTestParam *)opaqueData; - + + testParam = (TA_RangeTestParam *)opaqueData; + retCode = TA_AVGDEV( startIdx, endIdx, testParam->close, - testParam->test->optInTimePeriod, + testParam->test->optInTimePeriod, outBegIdx, outNbElement, outputBuffer ); @@ -190,13 +190,13 @@ static ErrorNumber do_test( const TA_History *history, /* Build the input. */ setInputBuffer( 0, history->close, history->nbBars ); setInputBuffer( 1, history->close, history->nbBars ); - + /* Make a simple first call. */ retCode = TA_AVGDEV( test->startIdx, test->endIdx, gBuffer[0].in, - test->optInTimePeriod, + test->optInTimePeriod, &outBegIdx, &outNbElement, gBuffer[0].out0 ); @@ -216,7 +216,7 @@ static ErrorNumber do_test( const TA_History *history, test->startIdx, test->endIdx, gBuffer[1].in, - test->optInTimePeriod, + test->optInTimePeriod, &outBegIdx, &outNbElement, gBuffer[1].in ); @@ -244,7 +244,7 @@ static ErrorNumber do_test( const TA_History *history, if( test->doRangeTestFlag ) { errNb = doRangeTest( - rangeTestFunction, + rangeTestFunction, TA_FUNC_UNST_NONE, (void *)&testParam, 1, 0 ); if( errNb != TA_TEST_PASS ) diff --git a/src/tools/ta_regtest/ta_test_func/test_bbands.c b/src/tools/ta_regtest/ta_test_func/test_bbands.c index 4ffb284b5..bf85e6a17 100644 --- a/src/tools/ta_regtest/ta_test_func/test_bbands.c +++ b/src/tools/ta_regtest/ta_test_func/test_bbands.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -86,7 +86,7 @@ typedef struct TA_Integer expectedBegIdx; TA_Integer expectedNbElement; - + TA_Integer oneOfTheExpectedOutRealIndex0; TA_Real oneOfTheExpectedOutReal0; @@ -102,7 +102,7 @@ typedef struct { const TA_Test *test; const TA_Real *close; -} TA_RangeTestParam; +} TA_RangeTestParam; /**** Local functions declarations. ****/ static ErrorNumber do_test( const TA_History *history, @@ -147,7 +147,7 @@ static TA_Test tableTest[] = 0, 87.7086 }, /* Lower */ /* With distinctive upper/lower multiplier. */ - + /******************************/ /* BBANDS - METASTOCK - SMA */ /******************************/ @@ -236,7 +236,7 @@ static TA_Test tableTest[] = 252-20, 114.5564, /* Upper */ 252-20, 108.5265, /* Middle */ 252-20, 102.4965}, /* Lower */ - + /* With distinctive upper/lower multiplier. */ { 0, 0, 251, 20, 2.0, 1.5, TA_MAType_EMA, TA_COMPATIBILITY_METASTOCK, TA_SUCCESS, 19, 252-19, @@ -285,7 +285,7 @@ ErrorNumber test_func_bbands( TA_History *history ) } /* All test succeed. */ - return TA_TEST_PASS; + return TA_TEST_PASS; } /**** Local functions definitions. ****/ @@ -309,7 +309,7 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, *isOutputInteger = 0; - testParam = (TA_RangeTestParam *)opaqueData; + testParam = (TA_RangeTestParam *)opaqueData; dummyBuffer1 = TA_Malloc( ((endIdx-startIdx)+1)*sizeof(TA_Real)); if( !dummyBuffer1 ) @@ -401,8 +401,8 @@ static ErrorNumber do_test( const TA_History *history, (TA_MAType)test->optInMethod_3, &outBegIdx, &outNbElement, - gBuffer[0].out0, - gBuffer[0].out1, + gBuffer[0].out0, + gBuffer[0].out1, gBuffer[0].out2 ); errNb = checkDataSame( gBuffer[0].in, history->close, history->nbBars ); @@ -426,7 +426,7 @@ static ErrorNumber do_test( const TA_History *history, test->optInNbDevDn, (TA_MAType)test->optInMethod_3, &outBegIdx, &outNbElement, - gBuffer[1].in, gBuffer[1].out1, gBuffer[1].out2 ); + gBuffer[1].in, gBuffer[1].out1, gBuffer[1].out2 ); /* The previous call should have the same output * as this call. @@ -455,7 +455,7 @@ static ErrorNumber do_test( const TA_History *history, test->optInNbDevDn, (TA_MAType)test->optInMethod_3, &outBegIdx, &outNbElement, - gBuffer[2].out1, + gBuffer[2].out1, gBuffer[2].in, gBuffer[2].out2 ); @@ -486,7 +486,7 @@ static ErrorNumber do_test( const TA_History *history, test->optInNbDevDn, (TA_MAType)test->optInMethod_3, &outBegIdx, &outNbElement, - gBuffer[3].out0, + gBuffer[3].out0, gBuffer[3].out1, gBuffer[3].in ); @@ -514,13 +514,13 @@ static ErrorNumber do_test( const TA_History *history, { if( test->optInMethod_3 == TA_MAType_EMA ) { - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_EMA, (void *)&testParam, 3, 0 ); } else { - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_NONE, (void *)&testParam, 3, 0 ); } diff --git a/src/tools/ta_regtest/ta_test_func/test_candlestick.c b/src/tools/ta_regtest/ta_test_func/test_candlestick.c index 4aaad1aa4..87473fea9 100644 --- a/src/tools/ta_regtest/ta_test_func/test_candlestick.c +++ b/src/tools/ta_regtest/ta_test_func/test_candlestick.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -47,7 +47,7 @@ */ /* Description: - * Test functions for candlestick. + * Test functions for candlestick. */ /**** Headers ****/ @@ -71,9 +71,9 @@ #define MAX_OPTIN_PARAM 5 #define MAX_TESTED_OUTPUT 3 -TA_RetCode TA_SetCandleSettings( TA_CandleSettingType settingType, - TA_RangeType rangeType, - int avgPeriod, +TA_RetCode TA_SetCandleSettings( TA_CandleSettingType settingType, + TA_RangeType rangeType, + int avgPeriod, double factor ); typedef struct @@ -113,7 +113,7 @@ typedef struct typedef struct { int index; - int value; + int value; } TA_ExpectedOutput; @@ -122,24 +122,24 @@ typedef struct /* Indicate which function will be called */ const char *name; - /* Indicate if ranging test should be done. + /* Indicate if ranging test should be done. * (These tests are very time consuming). */ int doRangeTestFlag; - /* Range for the function call. - * When both value are -1 a series of automated range + /* Range for the function call. + * When both value are -1 a series of automated range * tests are performed. */ TA_Integer startIdx; TA_Integer endIdx; - /* Up to 5 parameters depending of functions. + /* Up to 5 parameters depending of functions. * Will be converted to integer when input is integer. */ TA_Real params[MAX_OPTIN_PARAM]; - /* The expected return code. */ + /* The expected return code. */ TA_RetCode expectedRetCode; /* When return code is TA_SUCCESS, the following output's @@ -151,7 +151,7 @@ typedef struct typedef struct { - /* Allows to pass key information as an + /* Allows to pass key information as an * opaque parameter for doRangeTest. */ const TA_Test *test; @@ -177,7 +177,7 @@ static ErrorNumber callCandlestick( TA_ParamHolder **paramHolderPtr, const double *inClose, const double optInArray[], int *outBegIdx, - int *outNbElement, + int *outNbElement, int outInteger[], int *lookback, TA_RetCode *retCode ); @@ -280,7 +280,7 @@ ErrorNumber test_candlestick( TA_History *history ) TA_SetUnstablePeriod( TA_FUNC_UNST_ALL, 0 ); /* All tests succeed. */ - return TA_TEST_PASS; + return TA_TEST_PASS; } /**** Local functions definitions. ****/ @@ -288,7 +288,7 @@ ErrorNumber test_candlestick( TA_History *history ) /* Abstract call for all candlestick functions. * * Call the function by 'name'. - * + * * Optional inputs are pass as an array of double. * Elements will be converted to integer as needed. * @@ -308,7 +308,7 @@ static ErrorNumber callCandlestick( TA_ParamHolder **paramHolderPtr, const double *inClose, const double optInArray[], int *outBegIdx, - int *outNbElement, + int *outNbElement, int outInteger[], int *lookback, TA_RetCode *taFuncRetCode ) @@ -324,8 +324,8 @@ static ErrorNumber callCandlestick( TA_ParamHolder **paramHolderPtr, TA_RetCode retCode; (void)optInArray; - - /* Speed optimization if paramHolder is already initialized. */ + + /* Speed optimization if paramHolder is already initialized. */ paramHolder = *paramHolderPtr; if( !paramHolder ) { @@ -333,9 +333,9 @@ static ErrorNumber callCandlestick( TA_ParamHolder **paramHolderPtr, if( retCode != TA_SUCCESS ) { printf( "Can't get the function handle [%d]\n", retCode ); - return TA_TSTCDL_GETFUNCHANDLE_FAIL; + return TA_TSTCDL_GETFUNCHANDLE_FAIL; } - + retCode = TA_ParamHolderAlloc( handle, ¶mHolder ); if( retCode != TA_SUCCESS ) { @@ -360,7 +360,7 @@ static ErrorNumber callCandlestick( TA_ParamHolder **paramHolderPtr, printf( "Candlestick are expected to use only OHLC as input.\n" ); return TA_TSTCDL_INPUT_TYPE_WRONG; } - + if( inputInfo->flags != (TA_IN_PRICE_OPEN | TA_IN_PRICE_HIGH | TA_IN_PRICE_LOW | @@ -369,9 +369,9 @@ static ErrorNumber callCandlestick( TA_ParamHolder **paramHolderPtr, printf( "Candlestick are expected to use only OHLC as input.\n" ); return TA_TSTCDL_INPUT_FLAG_WRONG; } - + /* Set the optional inputs. */ - + /* Verify that there is only one output. */ if( funcInfo->nbOutput != 1 ) { @@ -386,7 +386,7 @@ static ErrorNumber callCandlestick( TA_ParamHolder **paramHolderPtr, return TA_TSTCDL_OUTPUT_TYPE_WRONG; } - /* !!!!!!!!!!!!! TO BE DONE !!!!!!!!!!!!!!!!!! + /* !!!!!!!!!!!!! TO BE DONE !!!!!!!!!!!!!!!!!! * For now all candlestick functions will be called with default optional parameter. */ } @@ -406,7 +406,7 @@ static ErrorNumber callCandlestick( TA_ParamHolder **paramHolderPtr, printf( "TA_CallFunc() failed [%d]\n", *taFuncRetCode ); TA_ParamHolderFree( paramHolder ); return TA_TSTCDL_CALLFUNC_FAIL; - } + } /* Do the lookback function call. */ retCode = TA_GetLookback( paramHolder, lookback ); @@ -417,10 +417,10 @@ static ErrorNumber callCandlestick( TA_ParamHolder **paramHolderPtr, return TA_TSTCDL_GETLOOKBACK_FAIL; } - return TA_TEST_PASS; + return TA_TEST_PASS; } -/* rangeTestFunction is a different way to call any of +/* rangeTestFunction is a different way to call any of * the TA function. * * This is called by doRangeTest found in test_util.c @@ -432,7 +432,7 @@ static ErrorNumber callCandlestick( TA_ParamHolder **paramHolderPtr, * - output inconsistency for different start/end index. * - ... many other limit cases... * - * In the case of candlestick, the output is integer and + * In the case of candlestick, the output is integer and * should be put in outputBufferInt, and outputBuffer is * ignored. */ @@ -473,11 +473,11 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, testParam1->close, testParam2->params, outBegIdx, - outNbElement, + outNbElement, outputBufferInt, lookback, &retCode ); - + if( errNb != TA_TEST_PASS ) retCode = TA_INTERNAL_ERROR(168); @@ -501,8 +501,8 @@ static ErrorNumber do_test( const TA_History *history, setInputBuffer( 1, history->high, history->nbBars ); setInputBuffer( 2, history->low, history->nbBars ); setInputBuffer( 3, history->close, history->nbBars ); - - + + #if 0 /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */ /* Test for specific value not yet implemented */ @@ -721,8 +721,8 @@ static ErrorNumber do_test( const TA_History *history, if( test->doRangeTestFlag ) { - - errNb = doRangeTest( rangeTestFunction, + + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_NONE, (void *)&testParam, 1, 0 ); @@ -735,7 +735,7 @@ static ErrorNumber do_test( const TA_History *history, return TA_TSTCDL_PARAMHOLDERFREE_FAIL; } } - + if( errNb != TA_TEST_PASS ) return errNb; } diff --git a/src/tools/ta_regtest/ta_test_func/test_imi.c b/src/tools/ta_regtest/ta_test_func/test_imi.c index 31420ff44..6987c1299 100644 --- a/src/tools/ta_regtest/ta_test_func/test_imi.c +++ b/src/tools/ta_regtest/ta_test_func/test_imi.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -107,7 +107,7 @@ static TA_Test tableTest[] = /* AVGDEV TEST */ /*************************/ { 1, 0, 0, 251, 5, TA_SUCCESS, 0, 55.9194, 4, 252-4 }, /* First Value */ - { 0, 0, 0, 251, 5, TA_SUCCESS, 1, 64.6143, 4, 252-4 }, + { 0, 0, 0, 251, 5, TA_SUCCESS, 1, 64.6143, 4, 252-4 }, { 0, 0, 0, 251, 5, TA_SUCCESS, 252-5, 7.730673, 4, 252-4 }, /* Last Value */ }; @@ -144,7 +144,7 @@ ErrorNumber test_func_imi( TA_History *history ) TA_SetUnstablePeriod( TA_FUNC_UNST_ALL, 0 ); /* All test succeed. */ - return TA_TEST_PASS; + return TA_TEST_PASS; } /**** Local functions definitions. ****/ @@ -166,15 +166,15 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, (void)outputBufferInt; *isOutputInteger = 0; - - testParam = (TA_RangeTestParam *)opaqueData; - + + testParam = (TA_RangeTestParam *)opaqueData; + retCode = TA_IMI( startIdx, endIdx, testParam->open, testParam->close, - testParam->test->optInTimePeriod, + testParam->test->optInTimePeriod, outBegIdx, outNbElement, outputBuffer ); @@ -214,7 +214,7 @@ static ErrorNumber do_test( const TA_History *history, test->endIdx, gBuffer[0].in, gBuffer[1].in, - test->optInTimePeriod, + test->optInTimePeriod, &outBegIdx, &outNbElement, gBuffer[0].out0 ); @@ -240,7 +240,7 @@ static ErrorNumber do_test( const TA_History *history, test->endIdx, gBuffer[2].in, gBuffer[1].in, - test->optInTimePeriod, + test->optInTimePeriod, &outBegIdx, &outNbElement, gBuffer[2].in ); @@ -274,7 +274,7 @@ static ErrorNumber do_test( const TA_History *history, if( test->doRangeTestFlag ) { errNb = doRangeTest( - rangeTestFunction, + rangeTestFunction, TA_FUNC_UNST_IMI, (void *)&testParam, 1, 0 ); if( errNb != TA_TEST_PASS ) diff --git a/src/tools/ta_regtest/ta_test_func/test_ma.c b/src/tools/ta_regtest/ta_test_func/test_ma.c index 674811a3d..f7673355f 100644 --- a/src/tools/ta_regtest/ta_test_func/test_ma.c +++ b/src/tools/ta_regtest/ta_test_func/test_ma.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -402,7 +402,7 @@ ErrorNumber test_func_ma( TA_History *history ) TA_SetUnstablePeriod( TA_FUNC_UNST_ALL, 0 ); /* All test succeed. */ - return TA_TEST_PASS; + return TA_TEST_PASS; } /**** Local functions definitions. ****/ @@ -420,12 +420,12 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, TA_RetCode retCode; TA_RangeTestParam *testParam; TA_Real *dummyBuffer; - + (void)outputBufferInt; *isOutputInteger = 0; - testParam = (TA_RangeTestParam *)opaqueData; + testParam = (TA_RangeTestParam *)opaqueData; switch( testParam->test->optInMAType_1 ) { @@ -436,7 +436,7 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, retCode = TA_MAMA( startIdx, endIdx, testParam->close, - 0.5, 0.05, + 0.5, 0.05, outBegIdx, outNbElement, outputBuffer, @@ -447,7 +447,7 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, retCode = TA_MAMA( startIdx, endIdx, testParam->close, - 0.5, 0.05, + 0.5, 0.05, outBegIdx, outNbElement, &dummyBuffer[300], @@ -528,7 +528,7 @@ static ErrorNumber do_test_ma( const TA_History *history, /* Re-initialize all the unstable period to zero. */ TA_SetUnstablePeriod( TA_FUNC_UNST_ALL, 0 ); - + /* Set the unstable period requested for that test. */ switch( test->optInMAType_1 ) { @@ -571,7 +571,7 @@ static ErrorNumber do_test_ma( const TA_History *history, else referenceInput = history->close; - + /* Make a simple first call. */ switch( test->id ) @@ -605,7 +605,7 @@ static ErrorNumber do_test_ma( const TA_History *history, retCode = TA_MAMA( test->startIdx, test->endIdx, gBuffer[0].in, - 0.5, 0.05, + 0.5, 0.05, &outBegIdx, &outNbElement, gBuffer[0].out0, @@ -616,7 +616,7 @@ static ErrorNumber do_test_ma( const TA_History *history, retCode = TA_MAMA( test->startIdx, test->endIdx, gBuffer[0].in, - 0.5, 0.05, + 0.5, 0.05, &outBegIdx, &outNbElement, gBuffer[0].out2, @@ -629,12 +629,12 @@ static ErrorNumber do_test_ma( const TA_History *history, if( errNb != TA_TEST_PASS ) return errNb; - errNb = checkExpectedValue( gBuffer[0].out0, + errNb = checkExpectedValue( gBuffer[0].out0, retCode, test->expectedRetCode, outBegIdx, test->expectedBegIdx, outNbElement, test->expectedNbElement, test->oneOfTheExpectedOutReal, - test->oneOfTheExpectedOutRealIndex ); + test->oneOfTheExpectedOutRealIndex ); if( errNb != TA_TEST_PASS ) return errNb; @@ -674,7 +674,7 @@ static ErrorNumber do_test_ma( const TA_History *history, retCode = TA_MAMA( test->startIdx, test->endIdx, gBuffer[1].in, - 0.5, 0.05, + 0.5, 0.05, &outBegIdx, &outNbElement, gBuffer[1].in, @@ -684,7 +684,7 @@ static ErrorNumber do_test_ma( const TA_History *history, retCode = TA_MAMA( test->startIdx, test->endIdx, gBuffer[1].in, - 0.5, 0.05, + 0.5, 0.05, &outBegIdx, &outNbElement, gBuffer[0].out2, @@ -702,12 +702,12 @@ static ErrorNumber do_test_ma( const TA_History *history, if( errNb != TA_TEST_PASS ) return errNb; - errNb = checkExpectedValue( gBuffer[1].in, + errNb = checkExpectedValue( gBuffer[1].in, retCode, test->expectedRetCode, outBegIdx, test->expectedBegIdx, outNbElement, test->expectedNbElement, test->oneOfTheExpectedOutReal, - test->oneOfTheExpectedOutRealIndex ); + test->oneOfTheExpectedOutRealIndex ); if( errNb != TA_TEST_PASS ) return errNb; @@ -721,50 +721,50 @@ static ErrorNumber do_test_ma( const TA_History *history, case TA_MAType_WMA: temp = TA_WMA_Lookback( test->optInTimePeriod ); break; - + case TA_MAType_SMA: temp = TA_SMA_Lookback( test->optInTimePeriod ); break; - + case TA_MAType_EMA: temp = TA_EMA_Lookback( test->optInTimePeriod ); break; - + case TA_MAType_DEMA: temp = TA_DEMA_Lookback( test->optInTimePeriod ); break; - + case TA_MAType_TEMA: temp = TA_TEMA_Lookback( test->optInTimePeriod ); break; - + case TA_MAType_KAMA: temp = TA_KAMA_Lookback( test->optInTimePeriod ); break; - + case TA_MAType_MAMA: temp = TA_MAMA_Lookback( 0.5, 0.05 ); break; - + case TA_MAType_TRIMA: temp = TA_TRIMA_Lookback( test->optInTimePeriod ); break; - + case TA_MAType_T3: temp = TA_T3_Lookback( test->optInTimePeriod, 0.7 ); break; - + default: return TA_TEST_TFRR_BAD_MA_TYPE; } - + temp2 = TA_MA_Lookback( test->optInTimePeriod, (TA_MAType)test->optInMAType_1 ); - + if( temp != temp2 ) { printf( "\nFailed for MA Type #%d for period %d\n", test->optInMAType_1, test->optInTimePeriod ); return TA_TEST_TFFR_BAD_MA_LOOKBACK; - } + } } /* Do a systematic test of most of the @@ -782,27 +782,27 @@ static ErrorNumber do_test_ma( const TA_History *history, case TA_MAType_TEMA: case TA_MAType_DEMA: case TA_MAType_EMA: - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_EMA, (void *)&testParam, 1, 0 ); break; case TA_MAType_T3: - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_T3, (void *)&testParam, 1, 0 ); break; case TA_MAType_KAMA: - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_KAMA, (void *)&testParam, 1, 0 ); break; case TA_MAType_MAMA: - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_MAMA, (void *)&testParam, 2, 0 ); break; default: - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_NONE, (void *)&testParam, 1, 0 ); } diff --git a/src/tools/ta_regtest/ta_test_func/test_macd.c b/src/tools/ta_regtest/ta_test_func/test_macd.c index 0b468af07..dbe2731ac 100644 --- a/src/tools/ta_regtest/ta_test_func/test_macd.c +++ b/src/tools/ta_regtest/ta_test_func/test_macd.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -76,7 +76,7 @@ TA_MACDEXT_TEST } TA_TestId; typedef struct -{ +{ TA_Integer doRangeTestFlag; TA_TestId testId; @@ -92,7 +92,7 @@ typedef struct TA_Integer expectedBegIdx; TA_Integer expectedNbElement; - + TA_Integer oneOfTheExpectedOutRealIndex0; TA_Real oneOfTheExpectedOutReal0; @@ -103,7 +103,7 @@ typedef struct TA_Real oneOfTheExpectedOutReal2; } TA_Test; - + typedef struct { const TA_Test *test; @@ -121,13 +121,13 @@ static TA_Test tableTest[] = /*********************/ /* MACD - CLASSIC */ /*********************/ - { 0, TA_MACD_TEST, 0, 251, 12, 26, 9, TA_COMPATIBILITY_DEFAULT, TA_SUCCESS, 33, 252-33, /* 25, 252-25,*/ + { 0, TA_MACD_TEST, 0, 251, 12, 26, 9, TA_COMPATIBILITY_DEFAULT, TA_SUCCESS, 33, 252-33, /* 25, 252-25,*/ 0, -1.9738, /* MACD */ 0, -2.7071, /* Signal */ 0, (-1.9738)-(-2.7071) }, /* Histogram */ /* Test period inversion */ - { 0, TA_MACD_TEST, 0, 251, 26, 12, 9, TA_COMPATIBILITY_DEFAULT, TA_SUCCESS, 33, 252-33, /* 25, 252-25,*/ + { 0, TA_MACD_TEST, 0, 251, 26, 12, 9, TA_COMPATIBILITY_DEFAULT, TA_SUCCESS, 33, 252-33, /* 25, 252-25,*/ 0, -1.9738, /* MACD */ 0, -2.7071, /* Signal */ 0, (-1.9738)-(-2.7071) }, /* Histogram */ @@ -139,7 +139,7 @@ static TA_Test tableTest[] = /*******************************/ /* MACDEXT - MIMIC CLASSIC */ /*******************************/ - { 0, TA_MACDEXT_TEST, 0, 251, 12, 26, 9, TA_COMPATIBILITY_DEFAULT, TA_SUCCESS, 33, 252-33, /* 25, 252-25,*/ + { 0, TA_MACDEXT_TEST, 0, 251, 12, 26, 9, TA_COMPATIBILITY_DEFAULT, TA_SUCCESS, 33, 252-33, /* 25, 252-25,*/ 0, -1.9738, /* MACD */ 0, -2.7071, /* Signal */ 0, (-1.9738)-(-2.7071)}, /* Histogram */ @@ -151,17 +151,17 @@ static TA_Test tableTest[] = /***************************/ /* MACD FIX - METASTOCK */ /***************************/ - { 1, TA_MACDFIX_TEST, 0, 251, 12, 26, 9, TA_COMPATIBILITY_METASTOCK, TA_SUCCESS, 33, 252-33, /* 25, 252-25,*/ + { 1, TA_MACDFIX_TEST, 0, 251, 12, 26, 9, TA_COMPATIBILITY_METASTOCK, TA_SUCCESS, 33, 252-33, /* 25, 252-25,*/ 0, -1.2185, /* MACD */ 0, -1.7119, /* Signal */ 0, (-1.2185)-(-1.7119) }, /* Histogram */ - { 0, TA_MACDFIX_TEST, 0, 251, 12, 26, 9, TA_COMPATIBILITY_METASTOCK, TA_SUCCESS, 33, 252-33, + { 0, TA_MACDFIX_TEST, 0, 251, 12, 26, 9, TA_COMPATIBILITY_METASTOCK, TA_SUCCESS, 33, 252-33, 252-34, 0.8764, /* MACD */ 252-34, 1.3533, /* Signal */ 252-34, (0.8764)-(1.3533)}, /* Histogram */ /* Test period inversion */ - { 0, TA_MACDFIX_TEST, 0, 251, 26, 12, 9, TA_COMPATIBILITY_METASTOCK, TA_SUCCESS, 33, 252-33, + { 0, TA_MACDFIX_TEST, 0, 251, 26, 12, 9, TA_COMPATIBILITY_METASTOCK, TA_SUCCESS, 33, 252-33, 252-34, 0.8764, /* MACD */ 252-34, 1.3533, /* Signal */ 252-34, (0.8764)-(1.3533)} /* Histogram */ @@ -197,7 +197,7 @@ ErrorNumber test_func_macd( TA_History *history ) } /* All test succeed. */ - return TA_TEST_PASS; + return TA_TEST_PASS; } /**** Local functions definitions. ****/ @@ -221,7 +221,7 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, *isOutputInteger = 0; - testParam = (TA_RangeTestParam *)opaqueData; + testParam = (TA_RangeTestParam *)opaqueData; dummyBuffer1 = TA_Malloc( ((endIdx-startIdx)+1)*sizeof(TA_Real)); if( !dummyBuffer1 ) @@ -335,7 +335,7 @@ static ErrorNumber do_test( const TA_History *history, setInputBuffer( 1, history->close, history->nbBars ); setInputBuffer( 2, history->close, history->nbBars ); setInputBuffer( 3, history->close, history->nbBars ); - + CLEAR_EXPECTED_VALUE(0); CLEAR_EXPECTED_VALUE(1); CLEAR_EXPECTED_VALUE(2); @@ -349,7 +349,7 @@ static ErrorNumber do_test( const TA_History *history, gBuffer[0].in, test->optInSignalPeriod_2, &outBegIdx, &outNbElement, - gBuffer[0].out0, + gBuffer[0].out0, gBuffer[0].out1, gBuffer[0].out2 ); break; @@ -361,7 +361,7 @@ static ErrorNumber do_test( const TA_History *history, test->optInSlowPeriod, test->optInSignalPeriod_2, &outBegIdx, &outNbElement, - gBuffer[0].out0, + gBuffer[0].out0, gBuffer[0].out1, gBuffer[0].out2 ); break; @@ -376,7 +376,7 @@ static ErrorNumber do_test( const TA_History *history, test->optInSignalPeriod_2, TA_MAType_EMA, &outBegIdx, &outNbElement, - gBuffer[0].out0, + gBuffer[0].out0, gBuffer[0].out1, gBuffer[0].out2 ); break; @@ -405,7 +405,7 @@ static ErrorNumber do_test( const TA_History *history, gBuffer[1].in, test->optInSignalPeriod_2, &outBegIdx, &outNbElement, - gBuffer[1].in, + gBuffer[1].in, gBuffer[1].out1, gBuffer[1].out2 ); break; @@ -417,7 +417,7 @@ static ErrorNumber do_test( const TA_History *history, test->optInSlowPeriod, test->optInSignalPeriod_2, &outBegIdx, &outNbElement, - gBuffer[1].in, + gBuffer[1].in, gBuffer[1].out1, gBuffer[1].out2 ); break; @@ -432,10 +432,10 @@ static ErrorNumber do_test( const TA_History *history, test->optInSignalPeriod_2, TA_MAType_EMA, &outBegIdx, &outNbElement, - gBuffer[1].in, + gBuffer[1].in, gBuffer[1].out1, gBuffer[1].out2 ); - break; + break; } /* The previous call should have the same output @@ -537,7 +537,7 @@ static ErrorNumber do_test( const TA_History *history, gBuffer[3].in, test->optInSignalPeriod_2, &outBegIdx, &outNbElement, - gBuffer[3].out1, + gBuffer[3].out1, gBuffer[3].out2, gBuffer[3].in ); break; @@ -549,7 +549,7 @@ static ErrorNumber do_test( const TA_History *history, test->optInSlowPeriod, test->optInSignalPeriod_2, &outBegIdx, &outNbElement, - gBuffer[3].out1, + gBuffer[3].out1, gBuffer[3].out2, gBuffer[3].in ); break; @@ -564,7 +564,7 @@ static ErrorNumber do_test( const TA_History *history, test->optInSignalPeriod_2, TA_MAType_EMA, &outBegIdx, &outNbElement, - gBuffer[3].out1, + gBuffer[3].out1, gBuffer[3].out2, gBuffer[3].in ); break; @@ -592,7 +592,7 @@ static ErrorNumber do_test( const TA_History *history, if( test->doRangeTestFlag ) { - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_EMA, (void *)&testParam, 3, 0 ); if( errNb != TA_TEST_PASS ) diff --git a/src/tools/ta_regtest/ta_test_func/test_minmax.c b/src/tools/ta_regtest/ta_test_func/test_minmax.c index e0127d185..58897482d 100644 --- a/src/tools/ta_regtest/ta_test_func/test_minmax.c +++ b/src/tools/ta_regtest/ta_test_func/test_minmax.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -89,7 +89,7 @@ typedef struct TA_Integer endIdx; TA_Integer optInTimePeriod; - + TA_RetCode expectedRetCode; TA_Integer oneOfTheExpectedOutRealIndex0; @@ -291,7 +291,7 @@ ErrorNumber test_func_minmax( TA_History *history ) } /* All test succeed. */ - return TA_TEST_PASS; + return TA_TEST_PASS; } /**** Local functions definitions. ****/ @@ -315,13 +315,13 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, TA_Integer *dummyBufferInt; TA_Integer *out1Int; TA_Integer *out2Int; - + (void)outputNb; (void)outputBufferInt; *isOutputInteger = 0; - testParam = (TA_RangeTestParam *)opaqueData; + testParam = (TA_RangeTestParam *)opaqueData; dummyBufferReal = TA_Malloc( ((endIdx-startIdx)+1)*sizeof(TA_Real)); if( !dummyBufferReal ) @@ -338,13 +338,13 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, { case 0: out1Real = outputBuffer; - out2Real = dummyBufferReal; + out2Real = dummyBufferReal; out1Int = outputBufferInt; - out2Int = dummyBufferInt; + out2Int = dummyBufferInt; break; case 1: out1Real = dummyBufferReal; - out2Real = outputBuffer; + out2Real = outputBuffer; out1Int = dummyBufferInt; out2Int = outputBufferInt; break; @@ -355,24 +355,24 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, switch( testParam->test->theFunction ) { - case TA_MIN_TEST: + case TA_MIN_TEST: retCode = TA_MIN( startIdx, endIdx, testParam->close, - testParam->test->optInTimePeriod, + testParam->test->optInTimePeriod, outBegIdx, outNbElement, outputBuffer ); *lookback = TA_MIN_Lookback( testParam->test->optInTimePeriod ); break; - - case TA_MAX_TEST: + + case TA_MAX_TEST: retCode = TA_MAX( startIdx, endIdx, testParam->close, testParam->test->optInTimePeriod, outBegIdx, - outNbElement, + outNbElement, outputBuffer ); *lookback = TA_MAX_Lookback( testParam->test->optInTimePeriod ); break; @@ -383,9 +383,9 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, testParam->close, testParam->test->optInTimePeriod, outBegIdx, - outNbElement, + outNbElement, out1Real, out2Real ); - *lookback = TA_MINMAX_Lookback( testParam->test->optInTimePeriod ); + *lookback = TA_MINMAX_Lookback( testParam->test->optInTimePeriod ); break; case TA_MINMAXINDEX_TEST: @@ -394,7 +394,7 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, testParam->close, testParam->test->optInTimePeriod, outBegIdx, - outNbElement, + outNbElement, out1Int, out2Int ); *lookback = TA_MINMAXINDEX_Lookback( testParam->test->optInTimePeriod ); *isOutputInteger = 1; @@ -406,7 +406,7 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, testParam->close, testParam->test->optInTimePeriod, outBegIdx, - outNbElement, + outNbElement, out1Int ); *lookback = TA_MININDEX_Lookback( testParam->test->optInTimePeriod ); *isOutputInteger = 1; @@ -418,7 +418,7 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, testParam->close, testParam->test->optInTimePeriod, outBegIdx, - outNbElement, + outNbElement, out1Int ); *lookback = TA_MAXINDEX_Lookback( testParam->test->optInTimePeriod ); *isOutputInteger = 1; @@ -461,7 +461,7 @@ static ErrorNumber do_test( const TA_History *history, if( test->doRangeTestFlag ) { - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_NONE, (void *)&testParam, 1, 0 ); if( errNb != TA_TEST_PASS ) @@ -475,7 +475,7 @@ static ErrorNumber do_test( const TA_History *history, retCode = TA_MIN( test->startIdx, test->endIdx, gBuffer[0].in, - test->optInTimePeriod, + test->optInTimePeriod, &outBegIdx, &outNbElement, gBuffer[0].out0 ); @@ -485,7 +485,7 @@ static ErrorNumber do_test( const TA_History *history, retCode = TA_MAX( test->startIdx, test->endIdx, gBuffer[0].in, - test->optInTimePeriod, + test->optInTimePeriod, &outBegIdx, &outNbElement, gBuffer[0].out0 ); @@ -493,7 +493,7 @@ static ErrorNumber do_test( const TA_History *history, else { /* For now, tests only MIN and MAX. Only range check tests implemented. */ - return TA_TEST_PASS; + return TA_TEST_PASS; } errNb = checkDataSame( gBuffer[0].in, history->open,history->nbBars ); @@ -513,7 +513,7 @@ static ErrorNumber do_test( const TA_History *history, retCode = TA_MIN( test->startIdx, test->endIdx, gBuffer[1].in, - test->optInTimePeriod, + test->optInTimePeriod, &outBegIdx, &outNbElement, gBuffer[1].in ); @@ -594,7 +594,7 @@ static TA_RetCode referenceMin( TA_Integer startIdx, outIdx = 0; today = startIdx; trailingIdx = startIdx-nbInitialElementNeeded; - + while( today <= endIdx ) { lowest = inReal[trailingIdx++]; @@ -679,7 +679,7 @@ static TA_RetCode referenceMax( TA_Integer startIdx, outIdx = 0; today = startIdx; trailingIdx = startIdx-nbInitialElementNeeded; - + while( today <= endIdx ) { highest = inReal[trailingIdx++]; @@ -718,13 +718,13 @@ static ErrorNumber testCompareToReference( const TA_Real *input, int nbElement ) /* Do a systematic tests, even for failure cases. */ for( testNb=0; testNb <= 1; testNb++ ) /* 0=TA_MIN, 1=TA_MAX */ - { + { for( period=2; period <= nbElement; period++ ) { for( startIdx=0; startIdx < nbElement; startIdx++ ) { for( endIdx=0; (endIdx < nbElement) && (startIdx <= endIdx); endIdx++ ) - { + { /* Set to NAN all the elements of the gBuffers. * Note: These buffer are used as an attempt to detect * out-of-bound writing in the output. @@ -736,10 +736,10 @@ static ErrorNumber testCompareToReference( const TA_Real *input, int nbElement ) /* Get the reference output. */ if( testNb == 0 ) - retCodeRef = referenceMin( startIdx, endIdx, input, period, + retCodeRef = referenceMin( startIdx, endIdx, input, period, &outBegIdxRef, &outNbElementRef, gBuffer[0].out0 ); else - retCodeRef = referenceMax( startIdx, endIdx, input, period, + retCodeRef = referenceMax( startIdx, endIdx, input, period, &outBegIdxRef, &outNbElementRef, gBuffer[0].out0 ); /* Verify that the input was preserved */ @@ -749,10 +749,10 @@ static ErrorNumber testCompareToReference( const TA_Real *input, int nbElement ) /* Get the TA-Lib implementation output. */ if( testNb == 0 ) - retCode = TA_MIN( startIdx, endIdx, input, period, + retCode = TA_MIN( startIdx, endIdx, input, period, &outBegIdx, &outNbElement, gBuffer[1].out0 ); else - retCode = TA_MAX( startIdx, endIdx, input, period, + retCode = TA_MAX( startIdx, endIdx, input, period, &outBegIdx, &outNbElement, gBuffer[1].out0 ); /* Verify that the input was preserved */ @@ -792,10 +792,10 @@ static ErrorNumber testCompareToReference( const TA_Real *input, int nbElement ) * The output should still be the same. */ if( testNb == 0 ) - retCode = TA_MIN( startIdx, endIdx, gBuffer[0].in, period, + retCode = TA_MIN( startIdx, endIdx, gBuffer[0].in, period, &outBegIdx, &outNbElement, gBuffer[0].in ); else - retCode = TA_MAX( startIdx, endIdx, gBuffer[0].in, period, + retCode = TA_MAX( startIdx, endIdx, gBuffer[0].in, period, &outBegIdx, &outNbElement, gBuffer[0].in ); /* The reference and TA-LIB should have the same output. */ @@ -826,7 +826,7 @@ static ErrorNumber testCompareToReference( const TA_Real *input, int nbElement ) } } } - } + } } return TA_TEST_PASS; diff --git a/src/tools/ta_regtest/ta_test_func/test_mom.c b/src/tools/ta_regtest/ta_test_func/test_mom.c index 247556883..d6b9e37c5 100644 --- a/src/tools/ta_regtest/ta_test_func/test_mom.c +++ b/src/tools/ta_regtest/ta_test_func/test_mom.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -60,20 +60,20 @@ * ROCR100 = (price/prevPrice)*100 [Rate of change ratio 100 Scale] * * Here are the equivalent function in other software: - * TA-Lib | Tradestation | Metastock + * TA-Lib | Tradestation | Metastock * ================================================= * MOM | Momentum | ROC (Point) * ROC | ROC | ROC (Percent) - * ROCP | PercentChange | - + * ROCP | PercentChange | - * ROCR | - | - * ROCR100 | - | MO * * The MOM function is the only one who is not normalized, and thus * should be avoided for comparing different time serie of prices. - * + * * ROC and ROCP are centered at zero and can have positive and negative * value. Here are some equivalence: - * ROC = ROCP/100 + * ROC = ROCP/100 * = ((price-prevPrice)/prevPrice)/100 * = ((price/prevPrice)-1)*100 * @@ -115,7 +115,7 @@ typedef struct TA_Integer endIdx; TA_Integer optInTimePeriod; - + TA_RetCode expectedRetCode; TA_Integer oneOfTheExpectedOutRealIndex0; @@ -285,7 +285,7 @@ ErrorNumber test_func_mom_roc( TA_History *history ) } /* All test succeed. */ - return TA_TEST_PASS; + return TA_TEST_PASS; } /**** Local functions definitions. ****/ @@ -305,10 +305,10 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, (void)outputNb; (void)outputBufferInt; - + *isOutputInteger = 0; - testParam = (TA_RangeTestParam *)opaqueData; + testParam = (TA_RangeTestParam *)opaqueData; switch( testParam->test->theFunction ) { case TA_MOM_TEST: @@ -316,7 +316,7 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, startIdx, endIdx, testParam->close, - testParam->test->optInTimePeriod, + testParam->test->optInTimePeriod, outBegIdx, outNbElement, outputBuffer ); @@ -328,7 +328,7 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, startIdx, endIdx, testParam->close, - testParam->test->optInTimePeriod, + testParam->test->optInTimePeriod, outBegIdx, outNbElement, outputBuffer ); @@ -339,7 +339,7 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, startIdx, endIdx, testParam->close, - testParam->test->optInTimePeriod, + testParam->test->optInTimePeriod, outBegIdx, outNbElement, outputBuffer ); @@ -350,7 +350,7 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, startIdx, endIdx, testParam->close, - testParam->test->optInTimePeriod, + testParam->test->optInTimePeriod, outBegIdx, outNbElement, outputBuffer ); @@ -361,7 +361,7 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, startIdx, endIdx, testParam->close, - testParam->test->optInTimePeriod, + testParam->test->optInTimePeriod, outBegIdx, outNbElement, outputBuffer ); @@ -400,7 +400,7 @@ static ErrorNumber do_test( const TA_History *history, test->startIdx, test->endIdx, gBuffer[0].in, - test->optInTimePeriod, + test->optInTimePeriod, &outBegIdx, &outNbElement, gBuffer[0].out0 ); @@ -411,7 +411,7 @@ static ErrorNumber do_test( const TA_History *history, test->startIdx, test->endIdx, gBuffer[0].in, - test->optInTimePeriod, + test->optInTimePeriod, &outBegIdx, &outNbElement, gBuffer[0].out0 ); @@ -421,7 +421,7 @@ static ErrorNumber do_test( const TA_History *history, test->startIdx, test->endIdx, gBuffer[0].in, - test->optInTimePeriod, + test->optInTimePeriod, &outBegIdx, &outNbElement, gBuffer[0].out0 ); @@ -431,7 +431,7 @@ static ErrorNumber do_test( const TA_History *history, test->startIdx, test->endIdx, gBuffer[0].in, - test->optInTimePeriod, + test->optInTimePeriod, &outBegIdx, &outNbElement, gBuffer[0].out0 ); @@ -442,7 +442,7 @@ static ErrorNumber do_test( const TA_History *history, test->startIdx, test->endIdx, gBuffer[0].in, - test->optInTimePeriod, + test->optInTimePeriod, &outBegIdx, &outNbElement, gBuffer[0].out0 ); @@ -471,7 +471,7 @@ static ErrorNumber do_test( const TA_History *history, test->startIdx, test->endIdx, gBuffer[1].in, - test->optInTimePeriod, + test->optInTimePeriod, &outBegIdx, &outNbElement, gBuffer[1].in ); @@ -481,7 +481,7 @@ static ErrorNumber do_test( const TA_History *history, test->startIdx, test->endIdx, gBuffer[1].in, - test->optInTimePeriod, + test->optInTimePeriod, &outBegIdx, &outNbElement, gBuffer[1].in ); @@ -491,7 +491,7 @@ static ErrorNumber do_test( const TA_History *history, test->startIdx, test->endIdx, gBuffer[1].in, - test->optInTimePeriod, + test->optInTimePeriod, &outBegIdx, &outNbElement, gBuffer[1].in ); @@ -501,7 +501,7 @@ static ErrorNumber do_test( const TA_History *history, test->startIdx, test->endIdx, gBuffer[1].in, - test->optInTimePeriod, + test->optInTimePeriod, &outBegIdx, &outNbElement, gBuffer[1].in ); @@ -511,7 +511,7 @@ static ErrorNumber do_test( const TA_History *history, test->startIdx, test->endIdx, gBuffer[1].in, - test->optInTimePeriod, + test->optInTimePeriod, &outBegIdx, &outNbElement, gBuffer[1].in ); @@ -541,7 +541,7 @@ static ErrorNumber do_test( const TA_History *history, if( test->doRangeTestFlag ) { errNb = doRangeTest( - rangeTestFunction, + rangeTestFunction, TA_FUNC_UNST_NONE, (void *)&testParam, 1, 0 ); if( errNb != TA_TEST_PASS ) diff --git a/src/tools/ta_regtest/ta_test_func/test_per_ema.c b/src/tools/ta_regtest/ta_test_func/test_per_ema.c index 504e7c9f8..0dd5004e0 100644 --- a/src/tools/ta_regtest/ta_test_func/test_per_ema.c +++ b/src/tools/ta_regtest/ta_test_func/test_per_ema.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -84,7 +84,7 @@ typedef struct TA_Integer startIdx; TA_Integer endIdx; TA_Integer optInTimePeriod; - + TA_RetCode expectedRetCode; TA_Integer oneOfTheExpectedOutRealIndex; @@ -158,7 +158,7 @@ ErrorNumber test_func_per_ema( TA_History *history ) TA_SetUnstablePeriod( TA_FUNC_UNST_ALL, 0 ); /* All test succeed. */ - return TA_TEST_PASS; + return TA_TEST_PASS; } /**** Local functions definitions. ****/ @@ -180,8 +180,8 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, (void)outputBufferInt; *isOutputInteger = 0; - - testParam = (TA_RangeTestParam *)opaqueData; + + testParam = (TA_RangeTestParam *)opaqueData; switch( testParam->test->theFunction ) { @@ -197,7 +197,7 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, break; default: retCode = TA_INTERNAL_ERROR(131); - } + } return retCode; } @@ -217,7 +217,7 @@ static ErrorNumber do_test_per_ema( const TA_History *history, /* Build the input. */ setInputBuffer( 0, history->close, history->nbBars ); setInputBuffer( 1, history->close, history->nbBars ); - + /* Set the unstable period requested for that test. */ retCode = TA_SetUnstablePeriod( TA_FUNC_UNST_EMA, test->unstablePeriod ); if( retCode != TA_SUCCESS ) @@ -242,12 +242,12 @@ static ErrorNumber do_test_per_ema( const TA_History *history, if( errNb != TA_TEST_PASS ) return errNb; - errNb = checkExpectedValue( gBuffer[0].out0, + errNb = checkExpectedValue( gBuffer[0].out0, retCode, test->expectedRetCode, outBegIdx, test->expectedBegIdx, outNbElement, test->expectedNbElement, test->oneOfTheExpectedOutReal, - test->oneOfTheExpectedOutRealIndex ); + test->oneOfTheExpectedOutRealIndex ); if( errNb != TA_TEST_PASS ) return errNb; @@ -278,12 +278,12 @@ static ErrorNumber do_test_per_ema( const TA_History *history, if( errNb != TA_TEST_PASS ) return errNb; - errNb = checkExpectedValue( gBuffer[1].in, + errNb = checkExpectedValue( gBuffer[1].in, retCode, test->expectedRetCode, outBegIdx, test->expectedBegIdx, outNbElement, test->expectedNbElement, test->oneOfTheExpectedOutReal, - test->oneOfTheExpectedOutRealIndex ); + test->oneOfTheExpectedOutRealIndex ); if( errNb != TA_TEST_PASS ) return errNb; @@ -295,7 +295,7 @@ static ErrorNumber do_test_per_ema( const TA_History *history, if( test->doRangeTestFlag ) { - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_EMA, (void *)&testParam, 1, 0 ); if( errNb != TA_TEST_PASS ) diff --git a/src/tools/ta_regtest/ta_test_func/test_per_hl.c b/src/tools/ta_regtest/ta_test_func/test_per_hl.c index 3d9288621..f3236de95 100644 --- a/src/tools/ta_regtest/ta_test_func/test_per_hl.c +++ b/src/tools/ta_regtest/ta_test_func/test_per_hl.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -48,7 +48,7 @@ /* Description: * - * Test functions which have the following characterisic: + * Test functions which have the following characterisic: * - two inputs are needed (high and low are used here). * - has zero or one parameter being a period. */ @@ -89,7 +89,7 @@ typedef struct TA_Integer startIdx; TA_Integer endIdx; TA_Integer optInTimePeriod; - + TA_RetCode expectedRetCode; TA_Integer oneOfTheExpectedOutRealIndex0; @@ -103,7 +103,7 @@ typedef struct { const TA_Test *test; const TA_Real *high; - const TA_Real *low; + const TA_Real *low; } TA_RangeTestParam; /**** Local functions declarations. ****/ @@ -132,7 +132,7 @@ static TA_Test tableTest[] = { 0, TA_CORREL_TEST, 0, 251, 20, TA_SUCCESS, 1, 0.9471812, 19, 252-19 }, { 0, TA_CORREL_TEST, 0, 251, 20, TA_SUCCESS, 252-20, 0.8866901, 19, 252-19 }, /* Last Value */ - + /*******************/ /* AROON UP TEST */ /*******************/ @@ -241,7 +241,7 @@ ErrorNumber test_func_per_hl( TA_History *history ) TA_SetUnstablePeriod( TA_FUNC_UNST_ALL, 0 ); /* All test succeed. */ - return TA_TEST_PASS; + return TA_TEST_PASS; } /**** Local functions definitions. ****/ @@ -262,10 +262,10 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, (void)outputNb; (void)outputBufferInt; - + *isOutputInteger = 0; - testParam = (TA_RangeTestParam *)opaqueData; + testParam = (TA_RangeTestParam *)opaqueData; /* Allocate a buffer for the output who is going * to be ignored (make it slightly larger to play @@ -281,7 +281,7 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, testParam->low, testParam->test->optInTimePeriod, outBegIdx, - outNbElement, + outNbElement, &dummyBuffer[20], outputBuffer ); @@ -376,7 +376,7 @@ static ErrorNumber do_test( const TA_History *history, ); break; - case TA_AROON_DOWN_TEST: + case TA_AROON_DOWN_TEST: retCode = TA_AROON( test->startIdx, test->endIdx, gBuffer[0].in, @@ -441,12 +441,12 @@ static ErrorNumber do_test( const TA_History *history, outBegIdx = outNbElement = 0; - /* Make another call where one of the input and one of the output + /* Make another call where one of the input and one of the output * are the same buffer. */ switch( test->theFunction ) { - case TA_AROON_UP_TEST: + case TA_AROON_UP_TEST: retCode = TA_AROON( test->startIdx, test->endIdx, gBuffer[0].in, @@ -459,7 +459,7 @@ static ErrorNumber do_test( const TA_History *history, ); break; - case TA_AROON_DOWN_TEST: + case TA_AROON_DOWN_TEST: retCode = TA_AROON( test->startIdx, test->endIdx, gBuffer[0].in, @@ -539,7 +539,7 @@ static ErrorNumber do_test( const TA_History *history, */ switch( test->theFunction ) { - case TA_AROON_UP_TEST: + case TA_AROON_UP_TEST: retCode = TA_AROON( test->startIdx, test->endIdx, gBuffer[0].in, @@ -552,7 +552,7 @@ static ErrorNumber do_test( const TA_History *history, ); break; - case TA_AROON_DOWN_TEST: + case TA_AROON_DOWN_TEST: retCode = TA_AROON( test->startIdx, test->endIdx, gBuffer[0].in, @@ -628,7 +628,7 @@ static ErrorNumber do_test( const TA_History *history, if( test->doRangeTestFlag ) { - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_NONE, (void *)&testParam, 1, 0 ); if( errNb != TA_TEST_PASS ) diff --git a/src/tools/ta_regtest/ta_test_func/test_per_hlc.c b/src/tools/ta_regtest/ta_test_func/test_per_hlc.c index 7d2f9d510..3b17a6083 100644 --- a/src/tools/ta_regtest/ta_test_func/test_per_hlc.c +++ b/src/tools/ta_regtest/ta_test_func/test_per_hlc.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -43,20 +43,20 @@ * MMDDYY BY Description * ------------------------------------------------------------------- * 112400 MF First version. - * 061904 MF Add test to detect cumulative errors in CCI algorithm + * 061904 MF Add test to detect cumulative errors in CCI algorithm * when some values were close to zero (epsilon). * 021106 MF Add tests for ULTOSC. * 042206 MF Add tests for NATR * 120507 MF Add tests for ACCBANDS - * + * */ /* Description: * - * Test functions which have the following characteristic: + * Test functions which have the following characteristic: * - the input arrays are high, low and close. * - the only parameter is a period. - * + * */ /**** Headers ****/ @@ -98,7 +98,7 @@ typedef struct TA_Integer optInTimePeriod1; TA_Integer optInTimePeriod2; TA_Integer optInTimePeriod3; - + TA_RetCode expectedRetCode; TA_Integer oneOfTheExpectedOutRealIndex0; @@ -168,7 +168,7 @@ static TA_Test tableTest[] = /* The following two should always be identical. */ { 0, TA_CCI_TEST, 186,187, 2, 0, 0, TA_SUCCESS, 1, 0.0, 186, 2 }, { 0, TA_CCI_TEST, 187,187, 2, 0, 0, TA_SUCCESS, 0, 0.0, 187, 1 }, - + /* Test period 2, 5 and 11 */ { 0, TA_CCI_TEST, 0, 251, 2, 0, 0, TA_SUCCESS, 0, 66.666, 1, 252-1 }, { 1, TA_CCI_TEST, 0, 251, 5, 0, 0, TA_SUCCESS, 0, 18.857, 4, 252-4 }, @@ -233,7 +233,7 @@ ErrorNumber test_func_per_hlc( TA_History *history ) TA_SetUnstablePeriod( TA_FUNC_UNST_ALL, 0 ); /* All test succeed. */ - return TA_TEST_PASS; + return TA_TEST_PASS; } /**** Local functions definitions. ****/ @@ -252,12 +252,12 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, TA_RangeTestParam *testParam; TA_Real *dummyBuffer1, *dummyBuffer2; TA_Real *out1, *out2, *out3; - + (void)outputBufferInt; - + *isOutputInteger = 0; - testParam = (TA_RangeTestParam *)opaqueData; + testParam = (TA_RangeTestParam *)opaqueData; if( testParam->test->theFunction != TA_ACCBANDS_TEST ) { @@ -277,7 +277,7 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, TA_Free( dummyBuffer1 ); return TA_ALLOC_ERR; } - + switch( outputNb ) { case 0: @@ -491,12 +491,12 @@ static ErrorNumber do_test( const TA_History *history, setInputBuffer( 0, history->high, history->nbBars ); setInputBuffer( 1, history->low, history->nbBars ); setInputBuffer( 2, history->close, history->nbBars ); - + /* Make a simple first call. */ retCode = do_call( test, gBuffer[0].in, gBuffer[1].in, - gBuffer[2].in, + gBuffer[2].in, &outBegIdx, &outNbElement, gBuffer[0].out0 ); @@ -522,7 +522,7 @@ static ErrorNumber do_test( const TA_History *history, retCode = do_call( test, gBuffer[0].in, gBuffer[1].in, - gBuffer[2].in, + gBuffer[2].in, &outBegIdx, &outNbElement, gBuffer[0].in ); @@ -553,7 +553,7 @@ static ErrorNumber do_test( const TA_History *history, retCode = do_call( test, gBuffer[0].in, gBuffer[1].in, - gBuffer[2].in, + gBuffer[2].in, &outBegIdx, &outNbElement, gBuffer[1].in ); @@ -584,7 +584,7 @@ static ErrorNumber do_test( const TA_History *history, retCode = do_call( test, gBuffer[0].in, gBuffer[1].in, - gBuffer[2].in, + gBuffer[2].in, &outBegIdx, &outNbElement, gBuffer[2].in ); @@ -623,20 +623,20 @@ static ErrorNumber do_test( const TA_History *history, { case TA_NATR_TEST: /* Special case: Unstable period to test */ - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_NATR, (void *)&testParam, 1, 0 ); break; case TA_ACCBANDS_TEST: /* Special case: 3 outputs to test */ - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_NONE, (void *)&testParam, 3, 0 ); break; default: - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_NONE, (void *)&testParam, 1, 0 ); break; diff --git a/src/tools/ta_regtest/ta_test_func/test_per_hlcv.c b/src/tools/ta_regtest/ta_test_func/test_per_hlcv.c index ebe498fbf..1348ac53d 100644 --- a/src/tools/ta_regtest/ta_test_func/test_per_hlcv.c +++ b/src/tools/ta_regtest/ta_test_func/test_per_hlcv.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -51,12 +51,12 @@ /* Description: * * Test functions which have the following - * characterisic: + * characterisic: * - the inputs are high,low, close and volume. * - have one output of type real. * - might have an optional parameter. - * - * + * + * */ /**** Headers ****/ @@ -93,7 +93,7 @@ typedef struct TA_Integer startIdx; TA_Integer endIdx; TA_Integer optInTimePeriod; - + TA_RetCode expectedRetCode; TA_Integer oneOfTheExpectedOutRealIndex0; @@ -199,7 +199,7 @@ ErrorNumber test_func_per_hlcv( TA_History *history ) TA_SetUnstablePeriod( TA_FUNC_UNST_ALL, 0 ); /* All test succeed. */ - return TA_TEST_PASS; + return TA_TEST_PASS; } /**** Local functions definitions. ****/ @@ -219,10 +219,10 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, (void)outputNb; (void)outputBufferInt; - + *isOutputInteger = 0; - testParam = (TA_RangeTestParam *)opaqueData; + testParam = (TA_RangeTestParam *)opaqueData; switch( testParam->test->theFunction ) { @@ -308,7 +308,7 @@ static ErrorNumber do_test( const TA_History *history, /* Clear the unstable periods from previous tests. */ retCode = TA_SetUnstablePeriod( TA_FUNC_UNST_MFI, 0 ); if( retCode != TA_SUCCESS ) - return TA_TEST_TFRR_SETUNSTABLE_PERIOD_FAIL; + return TA_TEST_TFRR_SETUNSTABLE_PERIOD_FAIL; /* Make a simple first call. */ switch( test->theFunction ) @@ -418,7 +418,7 @@ static ErrorNumber do_test( const TA_History *history, history->volume, 3, 10, &outBegIdx, - &outNbElement, + &outNbElement, gBuffer[0].in ); break; case TA_ADOSC_5_2_TEST: @@ -624,14 +624,14 @@ static ErrorNumber do_test( const TA_History *history, switch( test->theFunction ) { case TA_MFI_TEST: - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_MFI, (void *)&testParam, 1, 0 ); if( errNb != TA_TEST_PASS ) return errNb; break; case TA_AD_TEST: - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_NONE, (void *)&testParam, 1, TA_DO_NOT_COMPARE ); @@ -640,7 +640,7 @@ static ErrorNumber do_test( const TA_History *history, break; case TA_ADOSC_3_10_TEST: case TA_ADOSC_5_2_TEST: - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_EMA, (void *)&testParam, 1, TA_DO_NOT_COMPARE ); @@ -702,7 +702,7 @@ static ErrorNumber do_test( const TA_History *history, { printf( "Failed AD logic for fix #1359452\n" ); return TA_TEST_FAIL_BUG1359452_5; - } + } } return TA_TEST_PASS; diff --git a/src/tools/ta_regtest/ta_test_func/test_per_ohlc.c b/src/tools/ta_regtest/ta_test_func/test_per_ohlc.c index c1d41e9e4..41eefcea0 100644 --- a/src/tools/ta_regtest/ta_test_func/test_per_ohlc.c +++ b/src/tools/ta_regtest/ta_test_func/test_per_ohlc.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -43,17 +43,17 @@ * MMDDYY BY Description * ------------------------------------------------------------------- * 112405 MF First version. - * + * */ /* Description: * * Test functions which have the following - * characterisic: - * - have one output + * characterisic: + * - have one output * - zero or one parameter being a period. * - the input is open, high, low and close. - * + * */ /**** Headers ****/ @@ -88,7 +88,7 @@ typedef struct TA_Integer startIdx; TA_Integer endIdx; TA_Integer optInTimePeriod; - + TA_RetCode expectedRetCode; TA_Integer oneOfTheExpectedOutRealIndex0; @@ -119,7 +119,7 @@ static TA_Test tableTest[] = /* AVGPRICE TEST */ /*******************/ { 0, TA_AVGPRICE_TEST, 0, 251, 0, TA_SUCCESS, 0, 92.0, 0, 252 }, - { 1, TA_AVGPRICE_TEST, 0, 251, 0, TA_SUCCESS, 1, 93.17, 0, 252 }, + { 1, TA_AVGPRICE_TEST, 0, 251, 0, TA_SUCCESS, 1, 93.17, 0, 252 }, /*************/ /* BOP TEST */ @@ -163,7 +163,7 @@ ErrorNumber test_func_per_ohlc( TA_History *history ) TA_SetUnstablePeriod( TA_FUNC_UNST_ALL, 0 ); /* All test succeed. */ - return TA_TEST_PASS; + return TA_TEST_PASS; } /**** Local functions definitions. ****/ @@ -183,10 +183,10 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, (void)outputNb; (void)outputBufferInt; - + *isOutputInteger = 0; - testParam = (TA_RangeTestParam *)opaqueData; + testParam = (TA_RangeTestParam *)opaqueData; switch( testParam->test->theFunction ) { @@ -196,7 +196,7 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, testParam->open, testParam->high, testParam->low, - testParam->close, + testParam->close, outBegIdx, outNbElement, outputBuffer ); @@ -238,7 +238,7 @@ static ErrorNumber do_test( const TA_History *history, setInputBuffer( 1, history->high, history->nbBars ); setInputBuffer( 2, history->low, history->nbBars ); setInputBuffer( 3, history->close, history->nbBars ); - + /* Make a simple first call. */ switch( test->theFunction ) { @@ -248,7 +248,7 @@ static ErrorNumber do_test( const TA_History *history, gBuffer[0].in, gBuffer[1].in, gBuffer[2].in, - gBuffer[3].in, + gBuffer[3].in, &outBegIdx, &outNbElement, gBuffer[0].out0 ); @@ -515,7 +515,7 @@ static ErrorNumber do_test( const TA_History *history, if( test->doRangeTestFlag ) { - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_NONE, (void *)&testParam, 1, 0 ); if( errNb != TA_TEST_PASS ) diff --git a/src/tools/ta_regtest/ta_test_func/test_po.c b/src/tools/ta_regtest/ta_test_func/test_po.c index 41195a8fd..d38c7e03d 100644 --- a/src/tools/ta_regtest/ta_test_func/test_po.c +++ b/src/tools/ta_regtest/ta_test_func/test_po.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -236,7 +236,7 @@ ErrorNumber test_func_po( TA_History *history ) } /* All test succeed. */ - return TA_TEST_PASS; + return TA_TEST_PASS; } /**** Local functions definitions. ****/ @@ -249,17 +249,17 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, TA_Integer *lookback, void *opaqueData, unsigned int outputNb, - unsigned int *isOutputInteger ) + unsigned int *isOutputInteger ) { TA_RetCode retCode; TA_RangeTestParam *testParam; (void)outputNb; (void)outputBufferInt; - + *isOutputInteger = 0; - testParam = (TA_RangeTestParam *)opaqueData; + testParam = (TA_RangeTestParam *)opaqueData; if( testParam->test->doPercentage ) { @@ -275,7 +275,7 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, *lookback = TA_PPO_Lookback( testParam->test->optInFastPeriod, testParam->test->optInSlowPeriod, - (TA_MAType)testParam->test->optInMethod_2 ); + (TA_MAType)testParam->test->optInMethod_2 ); } else { @@ -317,7 +317,7 @@ static ErrorNumber do_test( const TA_History *history, /* Build the input. */ setInputBuffer( 0, history->close, history->nbBars ); setInputBuffer( 1, history->close, history->nbBars ); - + TA_SetUnstablePeriod( TA_FUNC_UNST_EMA, 0 ); /* Make a simple first call. */ @@ -350,12 +350,12 @@ static ErrorNumber do_test( const TA_History *history, if( errNb != TA_TEST_PASS ) return errNb; - errNb = checkExpectedValue( gBuffer[0].out0, + errNb = checkExpectedValue( gBuffer[0].out0, retCode, test->expectedRetCode, outBegIdx, test->expectedBegIdx, outNbElement, test->expectedNbElement, test->oneOfTheExpectedOutReal, - test->oneOfTheExpectedOutRealIndex ); + test->oneOfTheExpectedOutRealIndex ); if( errNb != TA_TEST_PASS ) return errNb; @@ -399,12 +399,12 @@ static ErrorNumber do_test( const TA_History *history, if( errNb != TA_TEST_PASS ) return errNb; - errNb = checkExpectedValue( gBuffer[1].in, + errNb = checkExpectedValue( gBuffer[1].in, retCode, test->expectedRetCode, outBegIdx, test->expectedBegIdx, outNbElement, test->expectedNbElement, test->oneOfTheExpectedOutReal, - test->oneOfTheExpectedOutRealIndex ); + test->oneOfTheExpectedOutRealIndex ); if( errNb != TA_TEST_PASS ) return errNb; @@ -419,7 +419,7 @@ static ErrorNumber do_test( const TA_History *history, if( test->optInMethod_2 == TA_MAType_EMA ) { - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_EMA, (void *)&testParam, 1, 0 ); if( errNb != TA_TEST_PASS ) @@ -427,7 +427,7 @@ static ErrorNumber do_test( const TA_History *history, } else { - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_NONE, (void *)&testParam, 1, 0 ); if( errNb != TA_TEST_PASS ) diff --git a/src/tools/ta_regtest/ta_test_func/test_rsi.c b/src/tools/ta_regtest/ta_test_func/test_rsi.c index ce3314a72..6c71587a5 100644 --- a/src/tools/ta_regtest/ta_test_func/test_rsi.c +++ b/src/tools/ta_regtest/ta_test_func/test_rsi.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -219,7 +219,7 @@ ErrorNumber test_func_rsi( TA_History *history ) TA_SetUnstablePeriod( TA_FUNC_UNST_ALL, 0 ); /* All test succeed. */ - return TA_TEST_PASS; + return TA_TEST_PASS; } /**** Local functions definitions. ****/ @@ -239,10 +239,10 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, (void)outputNb; (void)outputBufferInt; - + *isOutputInteger = 0; - testParam = (TA_RangeTestParam *)opaqueData; + testParam = (TA_RangeTestParam *)opaqueData; switch( testParam->test->theFunction ) @@ -287,7 +287,7 @@ static ErrorNumber do_test( const TA_History *history, const TA_FuncHandle *funcHandle; const TA_FuncInfo *funcInfo; TA_ParamHolder *params; - + retCode = TA_SUCCESS; /* Set to NAN all the elements of the gBuffers. */ @@ -298,7 +298,7 @@ static ErrorNumber do_test( const TA_History *history, /* Build the input. */ setInputBuffer( 0, history->close, history->nbBars ); setInputBuffer( 1, history->close, history->nbBars ); - + /* Set the unstable period requested for that test. */ switch( test->theFunction ) { @@ -413,7 +413,7 @@ static ErrorNumber do_test( const TA_History *history, printf( "Fail: TA_GetFuncInfo with retCode = %d\n", retCode ); return TA_ABS_TST_FAIL_GETFUNCINFO; } - + retCode = TA_ParamHolderAlloc( funcHandle, ¶ms ); if( retCode != TA_SUCCESS ) { @@ -453,7 +453,7 @@ static ErrorNumber do_test( const TA_History *history, printf( "Fail: TA_CallFunc with retCode = %d\n", retCode ); return TA_ABS_TST_FAIL_CALLFUNC; } - + retCode = TA_ParamHolderFree( params ); if( retCode != TA_SUCCESS ) { @@ -487,12 +487,12 @@ static ErrorNumber do_test( const TA_History *history, switch( test->theFunction ) { case TA_RSI_TEST: - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_RSI, (void *)&testParam, 1, 0 ); break; case TA_CMO_TEST: - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_CMO, (void *)&testParam, 1, 0 ); break; diff --git a/src/tools/ta_regtest/ta_test_func/test_sar.c b/src/tools/ta_regtest/ta_test_func/test_sar.c index 415b74a42..6d60dc090 100644 --- a/src/tools/ta_regtest/ta_test_func/test_sar.c +++ b/src/tools/ta_regtest/ta_test_func/test_sar.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -124,8 +124,8 @@ static TA_Test tableTest[] = /**************************************/ { 1, 0, (WILDER_NB_BAR-1), 0.02, 0.20, TA_SUCCESS, 0, 50.00, 1, (WILDER_NB_BAR-1) }, /* First Value */ { 1, 0, (WILDER_NB_BAR-1), 0.02, 0.20, TA_SUCCESS, 1, 50.047, 1, (WILDER_NB_BAR-1) }, - { 1, 0, (WILDER_NB_BAR-1), 0.02, 0.20, TA_SUCCESS, 4, 50.182, 1, (WILDER_NB_BAR-1) }, - { 1, 0, (WILDER_NB_BAR-1), 0.02, 0.20, TA_SUCCESS, 35, 52.93, 1, (WILDER_NB_BAR-1) }, + { 1, 0, (WILDER_NB_BAR-1), 0.02, 0.20, TA_SUCCESS, 4, 50.182, 1, (WILDER_NB_BAR-1) }, + { 1, 0, (WILDER_NB_BAR-1), 0.02, 0.20, TA_SUCCESS, 35, 52.93, 1, (WILDER_NB_BAR-1) }, { 1, 0, (WILDER_NB_BAR-1), 0.02, 0.20, TA_SUCCESS, 36, 50.00, 1, (WILDER_NB_BAR-1) } /* Last value */ }; @@ -164,7 +164,7 @@ ErrorNumber test_func_sar( TA_History *history ) TA_SetUnstablePeriod( TA_FUNC_UNST_ALL, 0 ); /* All test succeed. */ - return TA_TEST_PASS; + return TA_TEST_PASS; } /**** Local functions definitions. ****/ diff --git a/src/tools/ta_regtest/ta_test_func/test_stddev.c b/src/tools/ta_regtest/ta_test_func/test_stddev.c index b443a3bfb..083855b26 100644 --- a/src/tools/ta_regtest/ta_test_func/test_stddev.c +++ b/src/tools/ta_regtest/ta_test_func/test_stddev.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -105,11 +105,11 @@ static TA_Test tableTest[] = /* STDDEV TEST */ /*************************/ { 1, 0, 251, 5, 1.0, TA_SUCCESS, 0, 1.2856, 4, 252-4 }, /* First Value */ - { 0, 0, 251, 5, 1.0, TA_SUCCESS, 1, 0.4462, 4, 252-4 }, + { 0, 0, 251, 5, 1.0, TA_SUCCESS, 1, 0.4462, 4, 252-4 }, { 0, 0, 251, 5, 1.0, TA_SUCCESS, 252-5, 0.7144, 4, 252-4 }, /* Last Value */ { 1, 0, 251, 5, 1.5, TA_SUCCESS, 0, 1.9285, 4, 252-4 }, /* First Value */ - { 0, 0, 251, 5, 1.5, TA_SUCCESS, 1, 0.66937, 4, 252-4 }, + { 0, 0, 251, 5, 1.5, TA_SUCCESS, 1, 0.66937, 4, 252-4 }, { 0, 0, 251, 5, 1.5, TA_SUCCESS, 252-5, 1.075, 4, 252-4 } /* Last Value */ }; @@ -140,7 +140,7 @@ ErrorNumber test_func_stddev( TA_History *history ) } /* All test succeed. */ - return TA_TEST_PASS; + return TA_TEST_PASS; } /**** Local functions definitions. ****/ @@ -162,15 +162,15 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, (void)outputBufferInt; *isOutputInteger = 0; - - testParam = (TA_RangeTestParam *)opaqueData; + + testParam = (TA_RangeTestParam *)opaqueData; retCode = TA_STDDEV( startIdx, endIdx, testParam->close, testParam->test->optInTimePeriod, - testParam->test->optInNbDeviation_1, + testParam->test->optInNbDeviation_1, outBegIdx, outNbElement, outputBuffer ); @@ -197,14 +197,14 @@ static ErrorNumber do_test( const TA_History *history, /* Build the input. */ setInputBuffer( 0, history->close, history->nbBars ); setInputBuffer( 1, history->close, history->nbBars ); - + /* Make a simple first call. */ retCode = TA_STDDEV( test->startIdx, test->endIdx, gBuffer[0].in, test->optInTimePeriod, - test->optInNbDeviation_1, + test->optInNbDeviation_1, &outBegIdx, &outNbElement, gBuffer[0].out0 ); @@ -225,7 +225,7 @@ static ErrorNumber do_test( const TA_History *history, test->endIdx, gBuffer[1].in, test->optInTimePeriod, - test->optInNbDeviation_1, + test->optInNbDeviation_1, &outBegIdx, &outNbElement, gBuffer[1].in ); @@ -253,7 +253,7 @@ static ErrorNumber do_test( const TA_History *history, if( test->doRangeTestFlag ) { errNb = doRangeTest( - rangeTestFunction, + rangeTestFunction, TA_FUNC_UNST_NONE, (void *)&testParam, 1, 0 ); if( errNb != TA_TEST_PASS ) diff --git a/src/tools/ta_regtest/ta_test_func/test_stoch.c b/src/tools/ta_regtest/ta_test_func/test_stoch.c index e6183639d..c228c7d27 100644 --- a/src/tools/ta_regtest/ta_test_func/test_stoch.c +++ b/src/tools/ta_regtest/ta_test_func/test_stoch.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -140,52 +140,52 @@ static TA_Test tableTest[] = /* STOCH TEST */ /**************/ { TEST_STOCH, 1, 0, 9, 9, 5, 3, TA_MAType_SMA, 4, TA_MAType_SMA, TA_SUCCESS, 9, 1, - 0, 38.139, + 0, 38.139, 0, 36.725 }, /* Test one value */ { TEST_STOCH, 0, 0, 0, 251, 5, 3, TA_MAType_SMA, 3, TA_MAType_SMA, TA_SUCCESS, 8, 252-8, - 0, 24.0128, + 0, 24.0128, 0, 36.254, }, /* First Value */ { TEST_STOCH, 0, 0, 0, 251, 5, 3, TA_MAType_SMA, 4, TA_MAType_SMA, TA_SUCCESS, 9, 252-9, - 252-10, 30.194, + 252-10, 30.194, 252-10, 46.641, }, /* Last Value */ { TEST_STOCH, 0, 0, 0, 251, 5, 3, TA_MAType_SMA, 3, TA_MAType_SMA, TA_SUCCESS, 8, 252-8, - 252-9, 30.194, + 252-9, 30.194, 252-9, 43.69, }, /* Last Value */ /*****************/ /* STOCHRSI TEST */ /*****************/ { TEST_STOCHRSI, 0, 0, 27, 27, 14, 14, -1, 1, TA_MAType_SMA, TA_SUCCESS, 27, 1, - 0, 94.156709, + 0, 94.156709, 0, 94.156709 }, /* Test one Value */ { TEST_STOCHRSI, 1, 0, 0, 251, 14, 14, -1, 1, TA_MAType_SMA, TA_SUCCESS, 27, 252-27, - 0, 94.156709, + 0, 94.156709, 0, 94.156709 }, /* First Value */ { TEST_STOCHRSI, 0, 0, 0, 251, 14, 14, -1, 1, TA_MAType_SMA, TA_SUCCESS, 27, 252-27, - 251-27, 0.0, + 251-27, 0.0, 251-27, 0.0 }, /* Last Value */ { TEST_STOCHRSI, 0, 0, 0, 251, 14, 45, -1, 1, TA_MAType_SMA, TA_SUCCESS, 58, 252-58, - 0, 79.729186, + 0, 79.729186, 0, 79.729186 }, /* First Value */ { TEST_STOCHRSI, 0, 0, 0, 251, 14, 45, -1, 1, TA_MAType_SMA, TA_SUCCESS, 58, 252-58, - 251-58, 48.1550743, + 251-58, 48.1550743, 251-58, 48.1550743 }, /* Last Value */ { TEST_STOCHRSI, 1, 0, 0, 251, 11, 13, -1, 16, TA_MAType_SMA, TA_SUCCESS, 38, 252-38, - 0, 5.25947, + 0, 5.25947, 0, 57.1711}, /* First Value */ { TEST_STOCHRSI, 0, 0, 0, 251, 11, 13, -1, 16, TA_MAType_SMA, TA_SUCCESS, 38, 252-38, - 251-38, 0.0, + 251-38, 0.0, 251-38, 15.7303 }, /* Last Value */ /* More test needed!!! */ @@ -224,7 +224,7 @@ ErrorNumber test_func_stoch( TA_History *history ) TA_SetUnstablePeriod( TA_FUNC_UNST_ALL, 0 ); /* All test succeed. */ - return TA_TEST_PASS; + return TA_TEST_PASS; } /**** Local functions definitions. ****/ @@ -248,14 +248,14 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, *isOutputInteger = 0; retCode = TA_NOT_SUPPORTED; - - testParam = (TA_RangeTestParam *)opaqueData; + + testParam = (TA_RangeTestParam *)opaqueData; dummyOutput = TA_Malloc( (endIdx-startIdx+1) * sizeof(TA_Real) ); - + switch( testParam->test->testId ) - { + { case TEST_STOCH: if( outputNb == 0 ) { @@ -287,7 +287,7 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, testParam->test->optInPeriod_2, (TA_MAType)testParam->test->optInMAType_2, outBegIdx, outNbElement, - dummyOutput, + dummyOutput, outputBuffer ); } @@ -324,7 +324,7 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, testParam->test->optInPeriod_1, (TA_MAType)testParam->test->optInMAType_1, outBegIdx, outNbElement, - dummyOutput, + dummyOutput, outputBuffer ); } @@ -332,7 +332,7 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, testParam->test->optInPeriod_1, (TA_MAType)testParam->test->optInMAType_1 ); break; - + case TEST_STOCHRSI: if( outputNb == 0 ) { @@ -358,7 +358,7 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, testParam->test->optInPeriod_2, (TA_MAType)testParam->test->optInMAType_2, outBegIdx, outNbElement, - dummyOutput, + dummyOutput, outputBuffer ); } @@ -392,7 +392,7 @@ static ErrorNumber do_test( const TA_History *history, setInputBuffer( 0, history->high, history->nbBars ); setInputBuffer( 1, history->low, history->nbBars ); setInputBuffer( 2, history->close, history->nbBars ); - + /* Re-initialize all the unstable period to zero. */ TA_SetUnstablePeriod( TA_FUNC_UNST_ALL, 0 ); @@ -424,7 +424,7 @@ static ErrorNumber do_test( const TA_History *history, test->optInPeriod_2, (TA_MAType)test->optInMAType_2, &outBegIdx, &outNbElement, - gBuffer[0].out0, + gBuffer[0].out0, gBuffer[0].out1 ); break; case TEST_STOCHF: @@ -437,7 +437,7 @@ static ErrorNumber do_test( const TA_History *history, test->optInPeriod_1, (TA_MAType)test->optInMAType_1, &outBegIdx, &outNbElement, - gBuffer[0].out0, + gBuffer[0].out0, gBuffer[0].out1 ); break; case TEST_STOCHRSI: @@ -449,10 +449,10 @@ static ErrorNumber do_test( const TA_History *history, test->optInPeriod_2, (TA_MAType)test->optInMAType_2, &outBegIdx, &outNbElement, - gBuffer[0].out0, + gBuffer[0].out0, gBuffer[0].out1 ); break; - } + } errNb = checkDataSame( gBuffer[0].in, history->high,history->nbBars ); if( errNb != TA_TEST_PASS ) @@ -487,7 +487,7 @@ static ErrorNumber do_test( const TA_History *history, test->optInPeriod_2, test->optInMAType_2, &outBegIdx, &outNbElement, - gBuffer[1].out0, + gBuffer[1].out0, gBuffer[1].out1 ); errNb = checkDataSame( gBuffer[0].in, history->high,history->nbBars ); @@ -503,7 +503,7 @@ static ErrorNumber do_test( const TA_History *history, CHECK_EXPECTED_VALUE( gBuffer[1].out0, 0 ); CHECK_EXPECTED_VALUE( gBuffer[1].out1, 1 ); - /* The non-optimized reference shall be identical to the optimized + /* The non-optimized reference shall be identical to the optimized * TA-Lib implementation. * * checkSameContent verify that all value different than NAN in @@ -535,7 +535,7 @@ static ErrorNumber do_test( const TA_History *history, test->optInPeriod_2, (TA_MAType)test->optInMAType_2, &outBegIdx, &outNbElement, - gBuffer[0].in, + gBuffer[0].in, gBuffer[1].in ); break; case TEST_STOCHF: @@ -548,7 +548,7 @@ static ErrorNumber do_test( const TA_History *history, test->optInPeriod_1, (TA_MAType)test->optInMAType_1, &outBegIdx, &outNbElement, - gBuffer[0].in, + gBuffer[0].in, gBuffer[1].in ); break; case TEST_STOCHRSI: @@ -560,10 +560,10 @@ static ErrorNumber do_test( const TA_History *history, test->optInPeriod_2, (TA_MAType)test->optInMAType_2, &outBegIdx, &outNbElement, - gBuffer[0].in, + gBuffer[0].in, gBuffer[1].in ); break; - + } /* The previous call should have the same output as this call. @@ -600,12 +600,12 @@ static ErrorNumber do_test( const TA_History *history, { case TEST_STOCH: case TEST_STOCHF: - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_NONE, (void *)&testParam, 2, 0 ); break; case TEST_STOCHRSI: - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_RSI, (void *)&testParam, 2, 0 ); break; @@ -678,7 +678,7 @@ static TA_RetCode referenceStoch( TA_Integer startIdx, */ outIdx = 0; - /* Calculate just enough K for ending up with the caller + /* Calculate just enough K for ending up with the caller * requested range. (The range of k must consider all * the lookback involve with the smoothing). */ @@ -692,8 +692,8 @@ static TA_RetCode referenceStoch( TA_Integer startIdx, * we just save ourself one memory allocation. */ bufferIsAllocated = 0; - if( (outSlowK_0 == inHigh) || - (outSlowK_0 == inLow) || + if( (outSlowK_0 == inHigh) || + (outSlowK_0 == inLow) || (outSlowK_0 == inClose) ) { tempBuffer = outSlowK_0; @@ -737,7 +737,7 @@ static TA_RetCode referenceStoch( TA_Integer startIdx, /* Un-smoothed K calculation completed. This K calculation is not returned * to the caller. It is always smoothed and then return. - * Some documentation will refer to the smoothed version as being + * Some documentation will refer to the smoothed version as being * "K-Slow", but often this end up to be shorten to "K". */ retCode = TA_MA( 0, outIdx-1, @@ -749,11 +749,11 @@ static TA_RetCode referenceStoch( TA_Integer startIdx, if( (retCode != TA_SUCCESS) || (*outNbElement == 0) ) { if( bufferIsAllocated ) - TA_Free( tempBuffer ); + TA_Free( tempBuffer ); /* Something wrong happen? No further data? */ *outBegIdx = 0; *outNbElement = 0; - return retCode; + return retCode; } /* Calculate the %D which is simply a moving average of @@ -764,7 +764,7 @@ static TA_RetCode referenceStoch( TA_Integer startIdx, (TA_MAType)optInMAType_2, outBegIdx, outNbElement, outSlowD_1 ); - /* Copy tempBuffer into the caller buffer. + /* Copy tempBuffer into the caller buffer. * (Calculation could not be done directly in the * caller buffer because more input data then the * requested range was needed for doing %D). @@ -773,7 +773,7 @@ static TA_RetCode referenceStoch( TA_Integer startIdx, /* Don't need K anymore, free it if it was allocated here. */ if( bufferIsAllocated ) - TA_Free( tempBuffer ); + TA_Free( tempBuffer ); if( retCode != TA_SUCCESS ) { diff --git a/src/tools/ta_regtest/ta_test_func/test_trange.c b/src/tools/ta_regtest/ta_test_func/test_trange.c index 4cc6157fc..c5a707fd0 100644 --- a/src/tools/ta_regtest/ta_test_func/test_trange.c +++ b/src/tools/ta_regtest/ta_test_func/test_trange.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -152,7 +152,7 @@ ErrorNumber test_func_trange( TA_History *history ) if( retValue != 0 ) { printf( "%s Failed Test #%d (Code=%d)\n", - tableTest[i].doAverage? "TA_ATR":"TA_TRANGE", + tableTest[i].doAverage? "TA_ATR":"TA_TRANGE", i, retValue ); return retValue; } @@ -160,7 +160,7 @@ ErrorNumber test_func_trange( TA_History *history ) /* All test succeed. */ - return TA_TEST_PASS; + return TA_TEST_PASS; } /**** Local functions definitions. ****/ @@ -180,10 +180,10 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, (void)outputNb; (void)outputBufferInt; - + *isOutputInteger = 0; - testParam = (TA_RangeTestParam *)opaqueData; + testParam = (TA_RangeTestParam *)opaqueData; if( testParam->test->doAverage ) @@ -194,7 +194,7 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, testParam->high, testParam->low, testParam->close, - testParam->test->optInTimePeriod, + testParam->test->optInTimePeriod, outBegIdx, outNbElement, outputBuffer ); @@ -207,7 +207,7 @@ static TA_RetCode rangeTestFunction( TA_Integer startIdx, endIdx, testParam->high, testParam->low, - testParam->close, + testParam->close, outBegIdx, outNbElement, outputBuffer ); @@ -243,7 +243,7 @@ static ErrorNumber do_test( const TA_History *history, gBuffer[0].in, gBuffer[1].in, gBuffer[2].in, - test->optInTimePeriod, + test->optInTimePeriod, &outBegIdx, &outNbElement, gBuffer[0].out0 ); @@ -254,7 +254,7 @@ static ErrorNumber do_test( const TA_History *history, test->endIdx, gBuffer[0].in, gBuffer[1].in, - gBuffer[2].in, + gBuffer[2].in, &outBegIdx, &outNbElement, gBuffer[0].out0 ); @@ -270,12 +270,12 @@ static ErrorNumber do_test( const TA_History *history, if( errNb != TA_TEST_PASS ) return errNb; - errNb = checkExpectedValue( gBuffer[0].out0, + errNb = checkExpectedValue( gBuffer[0].out0, retCode, test->expectedRetCode, outBegIdx, test->expectedBegIdx, outNbElement, test->expectedNbElement, test->oneOfTheExpectedOutReal, - test->oneOfTheExpectedOutRealIndex ); + test->oneOfTheExpectedOutRealIndex ); if( errNb != TA_TEST_PASS ) return errNb; @@ -292,7 +292,7 @@ static ErrorNumber do_test( const TA_History *history, gBuffer[0].in, gBuffer[1].in, gBuffer[2].in, - test->optInTimePeriod, + test->optInTimePeriod, &outBegIdx, &outNbElement, gBuffer[0].in ); @@ -303,7 +303,7 @@ static ErrorNumber do_test( const TA_History *history, test->endIdx, gBuffer[0].in, gBuffer[1].in, - gBuffer[2].in, + gBuffer[2].in, &outBegIdx, &outNbElement, gBuffer[0].in ); @@ -319,12 +319,12 @@ static ErrorNumber do_test( const TA_History *history, if( errNb != TA_TEST_PASS ) return errNb; - errNb = checkExpectedValue( gBuffer[0].in, + errNb = checkExpectedValue( gBuffer[0].in, retCode, test->expectedRetCode, outBegIdx, test->expectedBegIdx, outNbElement, test->expectedNbElement, test->oneOfTheExpectedOutReal, - test->oneOfTheExpectedOutRealIndex ); + test->oneOfTheExpectedOutRealIndex ); if( errNb != TA_TEST_PASS ) return errNb; @@ -338,7 +338,7 @@ static ErrorNumber do_test( const TA_History *history, if( test->doRangeTestFlag ) { - errNb = doRangeTest( rangeTestFunction, + errNb = doRangeTest( rangeTestFunction, TA_FUNC_UNST_ATR, (void *)&testParam, 1, 0 ); if( errNb != TA_TEST_PASS ) diff --git a/src/tools/ta_regtest/test_abstract.c b/src/tools/ta_regtest/test_abstract.c index 58c65f5b6..b8d304974 100644 --- a/src/tools/ta_regtest/test_abstract.c +++ b/src/tools/ta_regtest/test_abstract.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -54,7 +54,7 @@ * Regression testing of the functionality provided * by the ta_abstract module. * - * Also perform call to all functions for the purpose + * Also perform call to all functions for the purpose * of profiling (doExtensiveProfiling option). */ @@ -91,7 +91,7 @@ extern int insufficientClockPrecision; /* None */ /**** Local declarations. ****/ -typedef enum +typedef enum { PROFILING_10000, PROFILING_8000, @@ -137,19 +137,19 @@ ErrorNumber test_abstract( void ) const char *xmlArray; printf( "Testing Abstract interface\n" ); - + retValue = allocLib(); if( retValue != TA_TEST_PASS ) - return retValue; + return retValue; /* Verify TA_GetLookback. */ retCode = TA_GetFuncHandle( "STOCH", &handle ); if( retCode != TA_SUCCESS ) { printf( "Can't get the function handle [%d]\n", retCode ); - return TA_ABS_TST_FAIL_GETFUNCHANDLE; + return TA_ABS_TST_FAIL_GETFUNCHANDLE; } - + retCode = TA_ParamHolderAlloc( handle, ¶mHolder ); if( retCode != TA_SUCCESS ) { @@ -163,7 +163,7 @@ ErrorNumber test_abstract( void ) printf( "testLookback() failed [%d]\n", retValue ); TA_ParamHolderFree( paramHolder ); return retValue; - } + } retCode = TA_ParamHolderFree( paramHolder ); if( retCode != TA_SUCCESS ) @@ -191,7 +191,7 @@ ErrorNumber test_abstract( void ) retValue = freeLib(); if( retValue != TA_TEST_PASS ) return retValue; - + /* Verify that the TA_FunctionDescription is null terminated * and as at least 500 characters (less is guaranteed bad...) */ @@ -202,7 +202,7 @@ ErrorNumber test_abstract( void ) break; } - if( i < 500) + if( i < 500) { printf( "TA_FunctionDescriptionXML failed. Size too small.\n" ); return TA_ABS_TST_FAIL_FUNCTION_DESC_SMALL; @@ -292,18 +292,18 @@ static ErrorNumber testLookback( TA_ParamHolder *paramHolder ) printf( "TA_GetLookback failed [%d != 7]\n", lookback ); return TA_ABS_TST_FAIL_GETLOOKBACK_2; } - + return TA_TEST_PASS; } -/* Some processings are a bit different for functions under +/* Some processings are a bit different for functions under * the Math Operator and Math Transform category. */ static int isMath( const TA_FuncInfo *funcInfo ) { int notMath; - notMath = (strlen(funcInfo->group) < 4) || - !((tolower(funcInfo->group[0]) == 'm') && + notMath = (strlen(funcInfo->group) < 4) || + !((tolower(funcInfo->group[0]) == 'm') && (tolower(funcInfo->group[1]) == 'a') && (tolower(funcInfo->group[2]) == 't') && (tolower(funcInfo->group[3]) == 'h')); @@ -316,8 +316,8 @@ static int isMath( const TA_FuncInfo *funcInfo ) static int isCandlePattern( const TA_FuncInfo *funcInfo ) { int notCandlePattern; - notCandlePattern = (strlen(funcInfo->group) < 3) || - !((tolower(funcInfo->name[0]) == 'c') && + notCandlePattern = (strlen(funcInfo->group) < 3) || + !((tolower(funcInfo->name[0]) == 'c') && (tolower(funcInfo->name[1]) == 'd') && (tolower(funcInfo->name[2]) == 'l')); @@ -345,7 +345,7 @@ static void testDefault( const TA_FuncInfo *funcInfo, void *opaqueData ) } /* Do not test value outside the ]0..1[ domain for the "Math" groups. */ if( !isMath(funcInfo) ) - { + { CALL( inputNegData ); CALL( inputZeroData ); CALL( inputRandFltEpsilon ); @@ -395,9 +395,9 @@ static ErrorNumber callWithDefaults( const char *funcName, const double *input, if( retCode != TA_SUCCESS ) { printf( "Can't get the function handle [%d]\n", retCode ); - return TA_ABS_TST_FAIL_GETFUNCHANDLE; + return TA_ABS_TST_FAIL_GETFUNCHANDLE; } - + retCode = TA_ParamHolderAlloc( handle, ¶mHolder ); if( retCode != TA_SUCCESS ) { @@ -435,7 +435,7 @@ static ErrorNumber callWithDefaults( const char *funcName, const double *input, switch(outputInfo->type) { case TA_Output_Real: - TA_SetOutputParamRealPtr(paramHolder,i,&output[i][0]); + TA_SetOutputParamRealPtr(paramHolder,i,&output[i][0]); for( j=0; j < 2000; j++ ) output[i][j] = TA_REAL_MIN; break; @@ -454,7 +454,7 @@ static ErrorNumber callWithDefaults( const char *funcName, const double *input, printf( "TA_CallFunc() failed zero data test [%d]\n", retCode ); TA_ParamHolderFree( paramHolder ); return TA_ABS_TST_FAIL_CALLFUNC_1; - } + } /* Verify consistency with Lookback */ retCode = TA_GetLookback( paramHolder, &lookback ); @@ -464,20 +464,20 @@ static ErrorNumber callWithDefaults( const char *funcName, const double *input, TA_ParamHolderFree( paramHolder ); return TA_ABS_TST_FAIL_CALLFUNC_2; } - + if( outBegIdx != lookback ) { printf( "TA_GetLookback() != outBegIdx [%d != %d]\n", lookback, outBegIdx ); TA_ParamHolderFree( paramHolder ); return TA_ABS_TST_FAIL_CALLFUNC_3; - } + } - /* TODO Add back nan/inf tests. + /* TODO Add back nan/inf tests. for( i=0; i < funcInfo->nbOutput; i++ ) { switch(outputInfo->type) { - case TA_Output_Real: + case TA_Output_Real: for( j=0; j < outNbElement; j++ ) { if( trio_isnan(output[i][j]) || @@ -488,7 +488,7 @@ static ErrorNumber callWithDefaults( const char *funcName, const double *input, } } break; - case TA_Output_Integer: + case TA_Output_Integer: break; } }*/ @@ -546,7 +546,7 @@ static ErrorNumber test_default_calls(void) { /* Make 100% sure input range is ]0..1[ */ tempDouble = (double)rand() / ((double)(RAND_MAX)+(double)(1)); - while( (tempDouble <= 0.0) || (tempDouble >= 1.0) ) + while( (tempDouble <= 0.0) || (tempDouble >= 1.0) ) { tempDouble = (double)rand() / ((double)(RAND_MAX)+(double)(1)); } @@ -579,7 +579,7 @@ static ErrorNumber test_default_calls(void) { printf( "[PROFILING END]\n" ); } - + return errNumber; } @@ -593,7 +593,7 @@ static ErrorNumber callAndProfile( const char *funcName, ProfilingType type ) const TA_OutputParameterInfo *outputInfo; TA_RetCode retCode; - int h, i, j, k; + int h, i, j, k; int outBegIdx, outNbElement; /* Variables to control iteration and corresponding input size */ @@ -669,9 +669,9 @@ static ErrorNumber callAndProfile( const char *funcName, ProfilingType type ) if( retCode != TA_SUCCESS ) { printf( "Can't get the function handle [%d]\n", retCode ); - return TA_ABS_TST_FAIL_GETFUNCHANDLE; + return TA_ABS_TST_FAIL_GETFUNCHANDLE; } - + retCode = TA_ParamHolderAlloc( handle, ¶mHolder ); if( retCode != TA_SUCCESS ) { @@ -687,7 +687,7 @@ static ErrorNumber callAndProfile( const char *funcName, ProfilingType type ) switch(outputInfo->type) { case TA_Output_Real: - TA_SetOutputParamRealPtr(paramHolder,i,&output[i][0]); + TA_SetOutputParamRealPtr(paramHolder,i,&output[i][0]); for( j=0; j < 2000; j++ ) output[i][j] = TA_REAL_MIN; break; @@ -724,7 +724,7 @@ static ErrorNumber callAndProfile( const char *funcName, ProfilingType type ) break; case TA_Input_Integer: printf( "\nError: Integer input not yet supported for profiling.\n" ); - return TA_ABS_TST_FAIL_CALLFUNC_1; + return TA_ABS_TST_FAIL_CALLFUNC_1; } } @@ -758,7 +758,7 @@ static ErrorNumber callAndProfile( const char *funcName, ProfilingType type ) return TA_ABS_TST_FAIL_CALLFUNC_1; } else - { + { if( clockDelta > worstProfiledCall ) worstProfiledCall = clockDelta; timeInProfiledCall += clockDelta; diff --git a/src/tools/ta_regtest/test_internals.c b/src/tools/ta_regtest/test_internals.c index 893f946e9..30d162026 100644 --- a/src/tools/ta_regtest/test_internals.c +++ b/src/tools/ta_regtest/test_internals.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -50,7 +50,7 @@ */ /* Description: - * Regression testing of some internal utility like: + * Regression testing of some internal utility like: * - collections: List/Stack/Circular buffer. * - Memory allocation mechanism. * etc... @@ -110,7 +110,7 @@ ErrorNumber test_internals( void ) static ErrorNumber testCircularBuffer( void ) { TA_RetCode retCode; - int i; + int i; int buffer[20]; ErrorNumber retValue; diff --git a/src/tools/ta_regtest/test_util.c b/src/tools/ta_regtest/test_util.c index b3eb91b01..098077b3e 100644 --- a/src/tools/ta_regtest/test_util.c +++ b/src/tools/ta_regtest/test_util.c @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -151,7 +151,7 @@ static const char *ta_g_wheel = "-\\|/"; void showFeedback() { if( ta_g_wheel[ta_g_val] == '\0' ) - ta_g_val = 0; + ta_g_val = 0; putchar('\b'); putchar(ta_g_wheel[ta_g_val]); fflush(stdout); @@ -214,7 +214,7 @@ void initGlobalBuffer( void ) gBuffer[0].out0 = &buf[0][1][TA_BUF_PREFIX]; gBuffer[0].out1 = &buf[0][2][TA_BUF_PREFIX]; gBuffer[0].out2 = &buf[0][3][TA_BUF_PREFIX]; - + gBuffer[1].in = &buf[1][0][TA_BUF_PREFIX]; gBuffer[1].out0 = &buf[1][1][TA_BUF_PREFIX]; gBuffer[1].out1 = &buf[1][2][TA_BUF_PREFIX]; @@ -229,7 +229,7 @@ void initGlobalBuffer( void ) gBuffer[3].out0 = &buf[3][1][TA_BUF_PREFIX]; gBuffer[3].out1 = &buf[3][2][TA_BUF_PREFIX]; gBuffer[3].out2 = &buf[3][3][TA_BUF_PREFIX]; - + gBuffer[4].in = &buf[4][0][TA_BUF_PREFIX]; gBuffer[4].out0 = &buf[4][1][TA_BUF_PREFIX]; gBuffer[4].out1 = &buf[4][2][TA_BUF_PREFIX]; @@ -386,7 +386,7 @@ ErrorNumber checkSameContent( TA_Real *buffer1, if( (theBuffer1[i] != RESV_PATTERN_SUFFIX) && (theBuffer1[i] != RESV_PATTERN_PREFIX) ) { - + if(!TA_REAL_EQ( theBuffer1[i], theBuffer2[i], 0.000001)) { printf( "Fail: Large difference found between two value expected identical (%f,%f,%d)\n", @@ -437,7 +437,7 @@ ErrorNumber checkExpectedValue( const TA_Real *data, unsigned int outNbElement, unsigned int expectedNbElement, TA_Real oneOfTheExpectedOutReal, unsigned int oneOfTheExpectedOutRealIndex ) -{ +{ if( retCode != expectedRetCode ) { printf( "Fail: RetCode %d different than expected %d\n", retCode, expectedRetCode ); @@ -449,8 +449,8 @@ ErrorNumber checkExpectedValue( const TA_Real *data, /* An error did occured, but it * was expected. No need to go * further. - */ - return TA_TEST_PASS; + */ + return TA_TEST_PASS; } if( outNbElement > MAX_NB_TEST_ELEMENT ) @@ -490,7 +490,7 @@ ErrorNumber checkExpectedValue( const TA_Real *data, data[oneOfTheExpectedOutRealIndex] ); return TA_TESTUTIL_TFRR_BAD_CALCULATION; } - + if( expectedBegIdx != outBegIdx ) { printf( "Fail: outBegIdx expected %d but got %d\n", expectedBegIdx, outBegIdx ); @@ -575,7 +575,7 @@ static ErrorNumber doRangeTestForOneOutput( RangeTestFunction testFunction, TA_Free( refBuffer ); return TA_TESTUTIL_DRT_ALLOC_ERR; } - + if( unstId != TA_FUNC_UNST_NONE ) { /* Caller wish to test for a range of unstable @@ -586,7 +586,7 @@ static ErrorNumber doRangeTestForOneOutput( RangeTestFunction testFunction, TA_SetUnstablePeriod( unstId, 0 ); } - outputIsInteger = 0; + outputIsInteger = 0; retCode = CallTestFunction( testFunction, 0, MAX_RANGE_END, refBuffer, refBufferInt, &refOutBeg, &refOutNbElement, &refLookback, opaqueData, outputNb, &outputIsInteger ); @@ -609,7 +609,7 @@ static ErrorNumber doRangeTestForOneOutput( RangeTestFunction testFunction, TA_Free( refBufferInt ); return TA_TESTUTIL_DRT_LOOKBACK_INCORRECT; } - + temp = MAX_RANGE_SIZE-refLookback; if( temp != refOutNbElement ) { @@ -643,7 +643,7 @@ static ErrorNumber doRangeTestForOneOutput( RangeTestFunction testFunction, } } else - { + { for( unstablePeriod=0; unstablePeriod <= MAX_RANGE_SIZE; unstablePeriod++ ) { TA_SetUnstablePeriod( unstId, unstablePeriod ); @@ -676,7 +676,7 @@ static ErrorNumber doRangeTestForOneOutput( RangeTestFunction testFunction, } /* Because the tests with an unstable period are very intensive - * and kinda repetitive, skip the test of some fixSize (limit + * and kinda repetitive, skip the test of some fixSize (limit * case are always tested though). */ if( (fixSize > 5) && (fixSize < 240) ) @@ -756,8 +756,8 @@ static ErrorNumber doRangeTestFixSize( RangeTestFunction testFunction, &outputBuffer[1], &outputBufferInt[1], &outputBegIdx, &outputNbElement, &lookback, opaqueData, outputNb, &outputIsInteger ); - - if( retCode != TA_SUCCESS ) + + if( retCode != TA_SUCCESS ) { /* No call shall never fail here. When the range * is "out-of-range" the function shall still return @@ -778,9 +778,9 @@ static ErrorNumber doRangeTestFixSize( RangeTestFunction testFunction, /* Trap cases where there is no output. */ if( (startIdx > lookback) || (endIdx > lookback) ) { - /* Whenever startIdx is greater than lookback, some data + /* Whenever startIdx is greater than lookback, some data * shall be return. Same idea with endIdx. - * + * * Note: * some output will never start at the startIdx, particularly * when a TA function have multiple output. Usually, the first output @@ -793,7 +793,7 @@ static ErrorNumber doRangeTestFixSize( RangeTestFunction testFunction, * exist for the %D output. */ printf( "Fail: doRangeTestFixSize data missing (%d,%d,%d)\n", startIdx, endIdx, lookback ); - + TA_Free( outputBuffer ); TA_Free( outputBufferInt ); return TA_TESTUTIL_DRT_MISSING_DATA; @@ -840,7 +840,7 @@ static ErrorNumber doRangeTestFixSize( RangeTestFunction testFunction, { if( outputBufferInt[1+i] != refBufferInt[relativeIdx+i] ) { - printf( "Fail: doRangeTestFixSize diff data for idx=%d (%d,%d)\n", i, + printf( "Fail: doRangeTestFixSize diff data for idx=%d (%d,%d)\n", i, outputBufferInt[1+i], refBufferInt[relativeIdx+i] ); printf( "Fail: doRangeTestFixSize (%d,%d,%d,%d,%d)\n", startIdx, endIdx, outputBegIdx, outputNbElement, fixSize ); printf( "Fail: doRangeTestFixSize refOutBeg,refOutNbElement (%d,%d)\n", refOutBeg, refOutNbElement ); @@ -874,7 +874,7 @@ static ErrorNumber doRangeTestFixSize( RangeTestFunction testFunction, temp = outputNbElement-20; if( (i > 20) && (i < temp) ) { - /* Randomly skips from 0 to 200 verification. + /* Randomly skips from 0 to 200 verification. * Never make it skip the last 20 values. */ i += (rand() % 200); @@ -965,10 +965,10 @@ static ErrorNumber doRangeTestFixSize( RangeTestFunction testFunction, } } - /* Skip some startIdx at random. Limit case are still + /* Skip some startIdx at random. Limit case are still * tested though. */ - if( (startIdx > 30) && ((startIdx+100) <= (MAX_RANGE_SIZE-fixSize)) ) + if( (startIdx > 30) && ((startIdx+100) <= (MAX_RANGE_SIZE-fixSize)) ) { /* Randomly skips from 40 to 100 tests. */ temp = (rand() % 100)+40; @@ -1033,7 +1033,7 @@ static int dataWithinReasonableRange( TA_Real val1, TA_Real val2, * When dealing with an unstable period, the * first 100 values are ignored. * - * Following 100, the tolerance is + * Following 100, the tolerance is * progressively reduced as follow: * * 1 == 0.5/1 == 50 % @@ -1047,7 +1047,7 @@ static int dataWithinReasonableRange( TA_Real val1, TA_Real val2, * can expect the output to not vary more * than 0.005 % * - * The logic is sligthly different if the + * The logic is sligthly different if the * output are rounded integer, but it is * the same idea. * @@ -1059,12 +1059,12 @@ static int dataWithinReasonableRange( TA_Real val1, TA_Real val2, * Value 100 -> A tolerance of 1/100 is used. * * Value 1000 -> A tolerance of 1/1000 is used. - * + * * Value 360 -> Useful when the output are * degrees. In that case, a fix * tolerance of 1 degree is used. * - * Value TA_DO_NOT_COMPARE -> + * Value TA_DO_NOT_COMPARE -> * Indicate that NO COMPARISON take * place. This is useful for functions * that cannot be compare when changing @@ -1188,7 +1188,7 @@ static int dataWithinReasonableRange( TA_Real val1, TA_Real val2, { printf( "\nFail: Value diffferent by more than 10 percent over 1 degree (%d)\n", tempInt ); return 0; - } + } } else if( integerTolerance ) { @@ -1237,7 +1237,7 @@ static int dataWithinReasonableRange( TA_Real val1, TA_Real val2, { printf( "\nFail: Value not equal (difference is %d)\n", tempInt ); return 0; /* Value considered different */ - } + } } else { @@ -1245,7 +1245,7 @@ static int dataWithinReasonableRange( TA_Real val1, TA_Real val2, difference = (val1-val2)/val1; else difference = (val2-val1)/val2; - + temp = outputPosition+TA_GetUnstablePeriod(unstId)+1; if( temp <= periodToIgnore ) { @@ -1257,7 +1257,7 @@ static int dataWithinReasonableRange( TA_Real val1, TA_Real val2, temp -= periodToIgnore; tolerance = 0.5/temp; } - + if( difference > tolerance ) { printf( "\nFail: Value out of tolerance range (%g,%g)\n", difference, tolerance ); @@ -1306,7 +1306,7 @@ static TA_RetCode CallTestFunction( RangeTestFunction testFunction, lookback, opaqueData, outputNb, - isOutputInteger ); + isOutputInteger ); /* Profile only functions producing at least 20 values. */ if( *outNbElement < 20 ) @@ -1324,15 +1324,15 @@ static TA_RetCode CallTestFunction( RangeTestFunction testFunction, if( clockDelta <= 0 ) { - insufficientClockPrecision = 1; + insufficientClockPrecision = 1; } else - { + { if( clockDelta > worstProfiledCall ) worstProfiledCall = clockDelta; timeInProfiledCall += clockDelta; nbProfiledCall++; } - + return retCode; } diff --git a/swig/src/interface/ta_func.swg b/swig/src/interface/ta_func.swg index 8600de132..7a6ecbc78 100644 --- a/swig/src/interface/ta_func.swg +++ b/swig/src/interface/ta_func.swg @@ -1,4 +1,4 @@ -/* TA-LIB Copyright (c) 1999-2008, Mario Fortier +/* TA-LIB Copyright (c) 1999-2024, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or @@ -37,20 +37,20 @@ * If you are not re-building an interface with SWIG (which is most * likely the case), just ignore this file. */ - + /* * TA_ACCBANDS - Acceleration Bands - * + * * Input = High, Low, Close * Output = double, double, double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_ACCBANDS( int START_IDX, int END_IDX, @@ -69,10 +69,10 @@ int TA_ACCBANDS_Lookback( int optInTimePeriod ); /* From 2 to 100000 /* * TA_ACOS - Vector Trigonometric ACos - * + * * Input = double * Output = double - * + * */ TA_RetCode TA_ACOS( int START_IDX, int END_IDX, @@ -86,10 +86,10 @@ int TA_ACOS_Lookback( void ); /* * TA_AD - Chaikin A/D Line - * + * * Input = High, Low, Close, Volume * Output = double - * + * */ TA_RetCode TA_AD( int START_IDX, int END_IDX, @@ -106,10 +106,10 @@ int TA_AD_Lookback( void ); /* * TA_ADD - Vector Arithmetic Add - * + * * Input = double, double * Output = double - * + * */ TA_RetCode TA_ADD( int START_IDX, int END_IDX, @@ -124,19 +124,19 @@ int TA_ADD_Lookback( void ); /* * TA_ADOSC - Chaikin A/D Oscillator - * + * * Input = High, Low, Close, Volume * Output = double - * + * * Optional Parameters * ------------------- * optInFastPeriod:(From 2 to 100000) * Number of period for the fast MA - * + * * optInSlowPeriod:(From 2 to 100000) * Number of period for the slow MA - * - * + * + * */ TA_RetCode TA_ADOSC( int START_IDX, int END_IDX, @@ -156,16 +156,16 @@ int TA_ADOSC_Lookback( int optInFastPeriod, /* From 2 to 100000 */ /* * TA_ADX - Average Directional Movement Index - * + * * Input = High, Low, Close * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_ADX( int START_IDX, int END_IDX, @@ -182,16 +182,16 @@ int TA_ADX_Lookback( int optInTimePeriod ); /* From 2 to 100000 */ /* * TA_ADXR - Average Directional Movement Index Rating - * + * * Input = High, Low, Close * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_ADXR( int START_IDX, int END_IDX, @@ -208,22 +208,22 @@ int TA_ADXR_Lookback( int optInTimePeriod ); /* From 2 to 100000 */ /* * TA_APO - Absolute Price Oscillator - * + * * Input = double * Output = double - * + * * Optional Parameters * ------------------- * optInFastPeriod:(From 2 to 100000) * Number of period for the fast MA - * + * * optInSlowPeriod:(From 2 to 100000) * Number of period for the slow MA - * + * * optInMAType: * Type of Moving Average - * - * + * + * */ TA_RetCode TA_APO( int START_IDX, int END_IDX, @@ -237,20 +237,20 @@ TA_RetCode TA_APO( int START_IDX, int TA_APO_Lookback( int optInFastPeriod, /* From 2 to 100000 */ int optInSlowPeriod, /* From 2 to 100000 */ - TA_MAType optInMAType ); + TA_MAType optInMAType ); /* * TA_AROON - Aroon - * + * * Input = High, Low * Output = double, double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_AROON( int START_IDX, int END_IDX, @@ -267,16 +267,16 @@ int TA_AROON_Lookback( int optInTimePeriod ); /* From 2 to 100000 */ /* * TA_AROONOSC - Aroon Oscillator - * + * * Input = High, Low * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_AROONOSC( int START_IDX, int END_IDX, @@ -292,10 +292,10 @@ int TA_AROONOSC_Lookback( int optInTimePeriod ); /* From 2 to 100000 /* * TA_ASIN - Vector Trigonometric ASin - * + * * Input = double * Output = double - * + * */ TA_RetCode TA_ASIN( int START_IDX, int END_IDX, @@ -309,10 +309,10 @@ int TA_ASIN_Lookback( void ); /* * TA_ATAN - Vector Trigonometric ATan - * + * * Input = double * Output = double - * + * */ TA_RetCode TA_ATAN( int START_IDX, int END_IDX, @@ -326,16 +326,16 @@ int TA_ATAN_Lookback( void ); /* * TA_ATR - Average True Range - * + * * Input = High, Low, Close * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 1 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_ATR( int START_IDX, int END_IDX, @@ -352,10 +352,10 @@ int TA_ATR_Lookback( int optInTimePeriod ); /* From 1 to 100000 */ /* * TA_AVGPRICE - Average Price - * + * * Input = Open, High, Low, Close * Output = double - * + * */ TA_RetCode TA_AVGPRICE( int START_IDX, int END_IDX, @@ -372,16 +372,16 @@ int TA_AVGPRICE_Lookback( void ); /* * TA_AVGDEV - Average Deviation - * + * * Input = double * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_AVGDEV( int START_IDX, int END_IDX, @@ -396,25 +396,25 @@ int TA_AVGDEV_Lookback( int optInTimePeriod ); /* From 2 to 100000 */ /* * TA_BBANDS - Bollinger Bands - * + * * Input = double * Output = double, double, double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * + * * optInNbDevUp:(From TA_REAL_MIN to TA_REAL_MAX) * Deviation multiplier for upper band - * + * * optInNbDevDn:(From TA_REAL_MIN to TA_REAL_MAX) * Deviation multiplier for lower band - * + * * optInMAType: * Type of Moving Average - * - * + * + * */ TA_RetCode TA_BBANDS( int START_IDX, int END_IDX, @@ -432,20 +432,20 @@ TA_RetCode TA_BBANDS( int START_IDX, int TA_BBANDS_Lookback( int optInTimePeriod, /* From 2 to 100000 */ double optInNbDevUp, /* From TA_REAL_MIN to TA_REAL_MAX */ double optInNbDevDn, /* From TA_REAL_MIN to TA_REAL_MAX */ - TA_MAType optInMAType ); + TA_MAType optInMAType ); /* * TA_BETA - Beta - * + * * Input = double, double * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 1 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_BETA( int START_IDX, int END_IDX, @@ -461,10 +461,10 @@ int TA_BETA_Lookback( int optInTimePeriod ); /* From 1 to 100000 */ /* * TA_BOP - Balance Of Power - * + * * Input = Open, High, Low, Close * Output = double - * + * */ TA_RetCode TA_BOP( int START_IDX, int END_IDX, @@ -481,16 +481,16 @@ int TA_BOP_Lookback( void ); /* * TA_CCI - Commodity Channel Index - * + * * Input = High, Low, Close * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_CCI( int START_IDX, int END_IDX, @@ -507,10 +507,10 @@ int TA_CCI_Lookback( int optInTimePeriod ); /* From 2 to 100000 */ /* * TA_CDL2CROWS - Two Crows - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDL2CROWS( int START_IDX, int END_IDX, @@ -527,10 +527,10 @@ int TA_CDL2CROWS_Lookback( void ); /* * TA_CDL3BLACKCROWS - Three Black Crows - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDL3BLACKCROWS( int START_IDX, int END_IDX, @@ -547,10 +547,10 @@ int TA_CDL3BLACKCROWS_Lookback( void ); /* * TA_CDL3INSIDE - Three Inside Up/Down - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDL3INSIDE( int START_IDX, int END_IDX, @@ -566,11 +566,11 @@ int TA_CDL3INSIDE_Lookback( void ); /* - * TA_CDL3LINESTRIKE - Three-Line Strike - * + * TA_CDL3LINESTRIKE - Three-Line Strike + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDL3LINESTRIKE( int START_IDX, int END_IDX, @@ -587,10 +587,10 @@ int TA_CDL3LINESTRIKE_Lookback( void ); /* * TA_CDL3OUTSIDE - Three Outside Up/Down - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDL3OUTSIDE( int START_IDX, int END_IDX, @@ -607,10 +607,10 @@ int TA_CDL3OUTSIDE_Lookback( void ); /* * TA_CDL3STARSINSOUTH - Three Stars In The South - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDL3STARSINSOUTH( int START_IDX, int END_IDX, @@ -627,10 +627,10 @@ int TA_CDL3STARSINSOUTH_Lookback( void ); /* * TA_CDL3WHITESOLDIERS - Three Advancing White Soldiers - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDL3WHITESOLDIERS( int START_IDX, int END_IDX, @@ -647,16 +647,16 @@ int TA_CDL3WHITESOLDIERS_Lookback( void ); /* * TA_CDLABANDONEDBABY - Abandoned Baby - * + * * Input = Open, High, Low, Close * Output = int - * + * * Optional Parameters * ------------------- * optInPenetration:(From 0 to TA_REAL_MAX) * Percentage of penetration of a candle within another candle - * - * + * + * */ TA_RetCode TA_CDLABANDONEDBABY( int START_IDX, int END_IDX, @@ -674,10 +674,10 @@ int TA_CDLABANDONEDBABY_Lookback( double optInPenetration ); /* From 0 t /* * TA_CDLADVANCEBLOCK - Advance Block - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLADVANCEBLOCK( int START_IDX, int END_IDX, @@ -694,10 +694,10 @@ int TA_CDLADVANCEBLOCK_Lookback( void ); /* * TA_CDLBELTHOLD - Belt-hold - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLBELTHOLD( int START_IDX, int END_IDX, @@ -714,10 +714,10 @@ int TA_CDLBELTHOLD_Lookback( void ); /* * TA_CDLBREAKAWAY - Breakaway - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLBREAKAWAY( int START_IDX, int END_IDX, @@ -734,10 +734,10 @@ int TA_CDLBREAKAWAY_Lookback( void ); /* * TA_CDLCLOSINGMARUBOZU - Closing Marubozu - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLCLOSINGMARUBOZU( int START_IDX, int END_IDX, @@ -754,10 +754,10 @@ int TA_CDLCLOSINGMARUBOZU_Lookback( void ); /* * TA_CDLCONCEALBABYSWALL - Concealing Baby Swallow - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLCONCEALBABYSWALL( int START_IDX, int END_IDX, @@ -774,10 +774,10 @@ int TA_CDLCONCEALBABYSWALL_Lookback( void ); /* * TA_CDLCOUNTERATTACK - Counterattack - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLCOUNTERATTACK( int START_IDX, int END_IDX, @@ -794,16 +794,16 @@ int TA_CDLCOUNTERATTACK_Lookback( void ); /* * TA_CDLDARKCLOUDCOVER - Dark Cloud Cover - * + * * Input = Open, High, Low, Close * Output = int - * + * * Optional Parameters * ------------------- * optInPenetration:(From 0 to TA_REAL_MAX) * Percentage of penetration of a candle within another candle - * - * + * + * */ TA_RetCode TA_CDLDARKCLOUDCOVER( int START_IDX, int END_IDX, @@ -821,10 +821,10 @@ int TA_CDLDARKCLOUDCOVER_Lookback( double optInPenetration ); /* From 0 /* * TA_CDLDOJI - Doji - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLDOJI( int START_IDX, int END_IDX, @@ -841,10 +841,10 @@ int TA_CDLDOJI_Lookback( void ); /* * TA_CDLDOJISTAR - Doji Star - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLDOJISTAR( int START_IDX, int END_IDX, @@ -861,10 +861,10 @@ int TA_CDLDOJISTAR_Lookback( void ); /* * TA_CDLDRAGONFLYDOJI - Dragonfly Doji - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLDRAGONFLYDOJI( int START_IDX, int END_IDX, @@ -881,10 +881,10 @@ int TA_CDLDRAGONFLYDOJI_Lookback( void ); /* * TA_CDLENGULFING - Engulfing Pattern - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLENGULFING( int START_IDX, int END_IDX, @@ -901,16 +901,16 @@ int TA_CDLENGULFING_Lookback( void ); /* * TA_CDLEVENINGDOJISTAR - Evening Doji Star - * + * * Input = Open, High, Low, Close * Output = int - * + * * Optional Parameters * ------------------- * optInPenetration:(From 0 to TA_REAL_MAX) * Percentage of penetration of a candle within another candle - * - * + * + * */ TA_RetCode TA_CDLEVENINGDOJISTAR( int START_IDX, int END_IDX, @@ -928,16 +928,16 @@ int TA_CDLEVENINGDOJISTAR_Lookback( double optInPenetration ); /* From 0 /* * TA_CDLEVENINGSTAR - Evening Star - * + * * Input = Open, High, Low, Close * Output = int - * + * * Optional Parameters * ------------------- * optInPenetration:(From 0 to TA_REAL_MAX) * Percentage of penetration of a candle within another candle - * - * + * + * */ TA_RetCode TA_CDLEVENINGSTAR( int START_IDX, int END_IDX, @@ -955,10 +955,10 @@ int TA_CDLEVENINGSTAR_Lookback( double optInPenetration ); /* From 0 to /* * TA_CDLGAPSIDESIDEWHITE - Up/Down-gap side-by-side white lines - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLGAPSIDESIDEWHITE( int START_IDX, int END_IDX, @@ -975,10 +975,10 @@ int TA_CDLGAPSIDESIDEWHITE_Lookback( void ); /* * TA_CDLGRAVESTONEDOJI - Gravestone Doji - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLGRAVESTONEDOJI( int START_IDX, int END_IDX, @@ -995,10 +995,10 @@ int TA_CDLGRAVESTONEDOJI_Lookback( void ); /* * TA_CDLHAMMER - Hammer - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLHAMMER( int START_IDX, int END_IDX, @@ -1015,10 +1015,10 @@ int TA_CDLHAMMER_Lookback( void ); /* * TA_CDLHANGINGMAN - Hanging Man - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLHANGINGMAN( int START_IDX, int END_IDX, @@ -1035,10 +1035,10 @@ int TA_CDLHANGINGMAN_Lookback( void ); /* * TA_CDLHARAMI - Harami Pattern - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLHARAMI( int START_IDX, int END_IDX, @@ -1055,10 +1055,10 @@ int TA_CDLHARAMI_Lookback( void ); /* * TA_CDLHARAMICROSS - Harami Cross Pattern - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLHARAMICROSS( int START_IDX, int END_IDX, @@ -1075,10 +1075,10 @@ int TA_CDLHARAMICROSS_Lookback( void ); /* * TA_CDLHIGHWAVE - High-Wave Candle - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLHIGHWAVE( int START_IDX, int END_IDX, @@ -1095,10 +1095,10 @@ int TA_CDLHIGHWAVE_Lookback( void ); /* * TA_CDLHIKKAKE - Hikkake Pattern - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLHIKKAKE( int START_IDX, int END_IDX, @@ -1115,10 +1115,10 @@ int TA_CDLHIKKAKE_Lookback( void ); /* * TA_CDLHIKKAKEMOD - Modified Hikkake Pattern - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLHIKKAKEMOD( int START_IDX, int END_IDX, @@ -1135,10 +1135,10 @@ int TA_CDLHIKKAKEMOD_Lookback( void ); /* * TA_CDLHOMINGPIGEON - Homing Pigeon - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLHOMINGPIGEON( int START_IDX, int END_IDX, @@ -1155,10 +1155,10 @@ int TA_CDLHOMINGPIGEON_Lookback( void ); /* * TA_CDLIDENTICAL3CROWS - Identical Three Crows - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLIDENTICAL3CROWS( int START_IDX, int END_IDX, @@ -1175,10 +1175,10 @@ int TA_CDLIDENTICAL3CROWS_Lookback( void ); /* * TA_CDLINNECK - In-Neck Pattern - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLINNECK( int START_IDX, int END_IDX, @@ -1195,10 +1195,10 @@ int TA_CDLINNECK_Lookback( void ); /* * TA_CDLINVERTEDHAMMER - Inverted Hammer - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLINVERTEDHAMMER( int START_IDX, int END_IDX, @@ -1215,10 +1215,10 @@ int TA_CDLINVERTEDHAMMER_Lookback( void ); /* * TA_CDLKICKING - Kicking - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLKICKING( int START_IDX, int END_IDX, @@ -1235,10 +1235,10 @@ int TA_CDLKICKING_Lookback( void ); /* * TA_CDLKICKINGBYLENGTH - Kicking - bull/bear determined by the longer marubozu - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLKICKINGBYLENGTH( int START_IDX, int END_IDX, @@ -1255,10 +1255,10 @@ int TA_CDLKICKINGBYLENGTH_Lookback( void ); /* * TA_CDLLADDERBOTTOM - Ladder Bottom - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLLADDERBOTTOM( int START_IDX, int END_IDX, @@ -1275,10 +1275,10 @@ int TA_CDLLADDERBOTTOM_Lookback( void ); /* * TA_CDLLONGLEGGEDDOJI - Long Legged Doji - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLLONGLEGGEDDOJI( int START_IDX, int END_IDX, @@ -1295,10 +1295,10 @@ int TA_CDLLONGLEGGEDDOJI_Lookback( void ); /* * TA_CDLLONGLINE - Long Line Candle - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLLONGLINE( int START_IDX, int END_IDX, @@ -1315,10 +1315,10 @@ int TA_CDLLONGLINE_Lookback( void ); /* * TA_CDLMARUBOZU - Marubozu - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLMARUBOZU( int START_IDX, int END_IDX, @@ -1335,10 +1335,10 @@ int TA_CDLMARUBOZU_Lookback( void ); /* * TA_CDLMATCHINGLOW - Matching Low - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLMATCHINGLOW( int START_IDX, int END_IDX, @@ -1355,16 +1355,16 @@ int TA_CDLMATCHINGLOW_Lookback( void ); /* * TA_CDLMATHOLD - Mat Hold - * + * * Input = Open, High, Low, Close * Output = int - * + * * Optional Parameters * ------------------- * optInPenetration:(From 0 to TA_REAL_MAX) * Percentage of penetration of a candle within another candle - * - * + * + * */ TA_RetCode TA_CDLMATHOLD( int START_IDX, int END_IDX, @@ -1382,16 +1382,16 @@ int TA_CDLMATHOLD_Lookback( double optInPenetration ); /* From 0 to TA_R /* * TA_CDLMORNINGDOJISTAR - Morning Doji Star - * + * * Input = Open, High, Low, Close * Output = int - * + * * Optional Parameters * ------------------- * optInPenetration:(From 0 to TA_REAL_MAX) * Percentage of penetration of a candle within another candle - * - * + * + * */ TA_RetCode TA_CDLMORNINGDOJISTAR( int START_IDX, int END_IDX, @@ -1409,16 +1409,16 @@ int TA_CDLMORNINGDOJISTAR_Lookback( double optInPenetration ); /* From 0 /* * TA_CDLMORNINGSTAR - Morning Star - * + * * Input = Open, High, Low, Close * Output = int - * + * * Optional Parameters * ------------------- * optInPenetration:(From 0 to TA_REAL_MAX) * Percentage of penetration of a candle within another candle - * - * + * + * */ TA_RetCode TA_CDLMORNINGSTAR( int START_IDX, int END_IDX, @@ -1436,10 +1436,10 @@ int TA_CDLMORNINGSTAR_Lookback( double optInPenetration ); /* From 0 to /* * TA_CDLONNECK - On-Neck Pattern - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLONNECK( int START_IDX, int END_IDX, @@ -1456,10 +1456,10 @@ int TA_CDLONNECK_Lookback( void ); /* * TA_CDLPIERCING - Piercing Pattern - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLPIERCING( int START_IDX, int END_IDX, @@ -1476,10 +1476,10 @@ int TA_CDLPIERCING_Lookback( void ); /* * TA_CDLRICKSHAWMAN - Rickshaw Man - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLRICKSHAWMAN( int START_IDX, int END_IDX, @@ -1496,10 +1496,10 @@ int TA_CDLRICKSHAWMAN_Lookback( void ); /* * TA_CDLRISEFALL3METHODS - Rising/Falling Three Methods - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLRISEFALL3METHODS( int START_IDX, int END_IDX, @@ -1516,10 +1516,10 @@ int TA_CDLRISEFALL3METHODS_Lookback( void ); /* * TA_CDLSEPARATINGLINES - Separating Lines - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLSEPARATINGLINES( int START_IDX, int END_IDX, @@ -1536,10 +1536,10 @@ int TA_CDLSEPARATINGLINES_Lookback( void ); /* * TA_CDLSHOOTINGSTAR - Shooting Star - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLSHOOTINGSTAR( int START_IDX, int END_IDX, @@ -1556,10 +1556,10 @@ int TA_CDLSHOOTINGSTAR_Lookback( void ); /* * TA_CDLSHORTLINE - Short Line Candle - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLSHORTLINE( int START_IDX, int END_IDX, @@ -1576,10 +1576,10 @@ int TA_CDLSHORTLINE_Lookback( void ); /* * TA_CDLSPINNINGTOP - Spinning Top - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLSPINNINGTOP( int START_IDX, int END_IDX, @@ -1596,10 +1596,10 @@ int TA_CDLSPINNINGTOP_Lookback( void ); /* * TA_CDLSTALLEDPATTERN - Stalled Pattern - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLSTALLEDPATTERN( int START_IDX, int END_IDX, @@ -1616,10 +1616,10 @@ int TA_CDLSTALLEDPATTERN_Lookback( void ); /* * TA_CDLSTICKSANDWICH - Stick Sandwich - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLSTICKSANDWICH( int START_IDX, int END_IDX, @@ -1636,10 +1636,10 @@ int TA_CDLSTICKSANDWICH_Lookback( void ); /* * TA_CDLTAKURI - Takuri (Dragonfly Doji with very long lower shadow) - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLTAKURI( int START_IDX, int END_IDX, @@ -1656,10 +1656,10 @@ int TA_CDLTAKURI_Lookback( void ); /* * TA_CDLTASUKIGAP - Tasuki Gap - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLTASUKIGAP( int START_IDX, int END_IDX, @@ -1676,10 +1676,10 @@ int TA_CDLTASUKIGAP_Lookback( void ); /* * TA_CDLTHRUSTING - Thrusting Pattern - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLTHRUSTING( int START_IDX, int END_IDX, @@ -1696,10 +1696,10 @@ int TA_CDLTHRUSTING_Lookback( void ); /* * TA_CDLTRISTAR - Tristar Pattern - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLTRISTAR( int START_IDX, int END_IDX, @@ -1716,10 +1716,10 @@ int TA_CDLTRISTAR_Lookback( void ); /* * TA_CDLUNIQUE3RIVER - Unique 3 River - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLUNIQUE3RIVER( int START_IDX, int END_IDX, @@ -1736,10 +1736,10 @@ int TA_CDLUNIQUE3RIVER_Lookback( void ); /* * TA_CDLUPSIDEGAP2CROWS - Upside Gap Two Crows - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLUPSIDEGAP2CROWS( int START_IDX, int END_IDX, @@ -1756,10 +1756,10 @@ int TA_CDLUPSIDEGAP2CROWS_Lookback( void ); /* * TA_CDLXSIDEGAP3METHODS - Upside/Downside Gap Three Methods - * + * * Input = Open, High, Low, Close * Output = int - * + * */ TA_RetCode TA_CDLXSIDEGAP3METHODS( int START_IDX, int END_IDX, @@ -1776,10 +1776,10 @@ int TA_CDLXSIDEGAP3METHODS_Lookback( void ); /* * TA_CEIL - Vector Ceil - * + * * Input = double * Output = double - * + * */ TA_RetCode TA_CEIL( int START_IDX, int END_IDX, @@ -1793,16 +1793,16 @@ int TA_CEIL_Lookback( void ); /* * TA_CMO - Chande Momentum Oscillator - * + * * Input = double * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_CMO( int START_IDX, int END_IDX, @@ -1817,16 +1817,16 @@ int TA_CMO_Lookback( int optInTimePeriod ); /* From 2 to 100000 */ /* * TA_CORREL - Pearson's Correlation Coefficient (r) - * + * * Input = double, double * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 1 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_CORREL( int START_IDX, int END_IDX, @@ -1842,10 +1842,10 @@ int TA_CORREL_Lookback( int optInTimePeriod ); /* From 1 to 100000 */ /* * TA_COS - Vector Trigonometric Cos - * + * * Input = double * Output = double - * + * */ TA_RetCode TA_COS( int START_IDX, int END_IDX, @@ -1859,10 +1859,10 @@ int TA_COS_Lookback( void ); /* * TA_COSH - Vector Trigonometric Cosh - * + * * Input = double * Output = double - * + * */ TA_RetCode TA_COSH( int START_IDX, int END_IDX, @@ -1876,16 +1876,16 @@ int TA_COSH_Lookback( void ); /* * TA_DEMA - Double Exponential Moving Average - * + * * Input = double * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_DEMA( int START_IDX, int END_IDX, @@ -1900,10 +1900,10 @@ int TA_DEMA_Lookback( int optInTimePeriod ); /* From 2 to 100000 */ /* * TA_DIV - Vector Arithmetic Div - * + * * Input = double, double * Output = double - * + * */ TA_RetCode TA_DIV( int START_IDX, int END_IDX, @@ -1918,16 +1918,16 @@ int TA_DIV_Lookback( void ); /* * TA_DX - Directional Movement Index - * + * * Input = High, Low, Close * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_DX( int START_IDX, int END_IDX, @@ -1944,16 +1944,16 @@ int TA_DX_Lookback( int optInTimePeriod ); /* From 2 to 100000 */ /* * TA_EMA - Exponential Moving Average - * + * * Input = double * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_EMA( int START_IDX, int END_IDX, @@ -1968,10 +1968,10 @@ int TA_EMA_Lookback( int optInTimePeriod ); /* From 2 to 100000 */ /* * TA_EXP - Vector Arithmetic Exp - * + * * Input = double * Output = double - * + * */ TA_RetCode TA_EXP( int START_IDX, int END_IDX, @@ -1985,10 +1985,10 @@ int TA_EXP_Lookback( void ); /* * TA_FLOOR - Vector Floor - * + * * Input = double * Output = double - * + * */ TA_RetCode TA_FLOOR( int START_IDX, int END_IDX, @@ -2002,10 +2002,10 @@ int TA_FLOOR_Lookback( void ); /* * TA_HT_DCPERIOD - Hilbert Transform - Dominant Cycle Period - * + * * Input = double * Output = double - * + * */ TA_RetCode TA_HT_DCPERIOD( int START_IDX, int END_IDX, @@ -2019,10 +2019,10 @@ int TA_HT_DCPERIOD_Lookback( void ); /* * TA_HT_DCPHASE - Hilbert Transform - Dominant Cycle Phase - * + * * Input = double * Output = double - * + * */ TA_RetCode TA_HT_DCPHASE( int START_IDX, int END_IDX, @@ -2036,10 +2036,10 @@ int TA_HT_DCPHASE_Lookback( void ); /* * TA_HT_PHASOR - Hilbert Transform - Phasor Components - * + * * Input = double * Output = double, double - * + * */ TA_RetCode TA_HT_PHASOR( int START_IDX, int END_IDX, @@ -2054,10 +2054,10 @@ int TA_HT_PHASOR_Lookback( void ); /* * TA_HT_SINE - Hilbert Transform - SineWave - * + * * Input = double * Output = double, double - * + * */ TA_RetCode TA_HT_SINE( int START_IDX, int END_IDX, @@ -2072,10 +2072,10 @@ int TA_HT_SINE_Lookback( void ); /* * TA_HT_TRENDLINE - Hilbert Transform - Instantaneous Trendline - * + * * Input = double * Output = double - * + * */ TA_RetCode TA_HT_TRENDLINE( int START_IDX, int END_IDX, @@ -2089,10 +2089,10 @@ int TA_HT_TRENDLINE_Lookback( void ); /* * TA_HT_TRENDMODE - Hilbert Transform - Trend vs Cycle Mode - * + * * Input = double * Output = int - * + * */ TA_RetCode TA_HT_TRENDMODE( int START_IDX, int END_IDX, @@ -2106,16 +2106,16 @@ int TA_HT_TRENDMODE_Lookback( void ); /* * TA_IMI - Intraday Momentum Index - * + * * Input = Open, Close * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_IMI( int START_IDX, int END_IDX, @@ -2131,16 +2131,16 @@ int TA_IMI_Lookback( int optInTimePeriod ); /* From 2 to 100000 */ /* * TA_KAMA - Kaufman Adaptive Moving Average - * + * * Input = double * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_KAMA( int START_IDX, int END_IDX, @@ -2155,16 +2155,16 @@ int TA_KAMA_Lookback( int optInTimePeriod ); /* From 2 to 100000 */ /* * TA_LINEARREG - Linear Regression - * + * * Input = double * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_LINEARREG( int START_IDX, int END_IDX, @@ -2179,16 +2179,16 @@ int TA_LINEARREG_Lookback( int optInTimePeriod ); /* From 2 to 100000 /* * TA_LINEARREG_ANGLE - Linear Regression Angle - * + * * Input = double * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_LINEARREG_ANGLE( int START_IDX, int END_IDX, @@ -2203,16 +2203,16 @@ int TA_LINEARREG_ANGLE_Lookback( int optInTimePeriod ); /* From 2 to /* * TA_LINEARREG_INTERCEPT - Linear Regression Intercept - * + * * Input = double * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_LINEARREG_INTERCEPT( int START_IDX, int END_IDX, @@ -2227,16 +2227,16 @@ int TA_LINEARREG_INTERCEPT_Lookback( int optInTimePeriod ); /* From 2 /* * TA_LINEARREG_SLOPE - Linear Regression Slope - * + * * Input = double * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_LINEARREG_SLOPE( int START_IDX, int END_IDX, @@ -2251,10 +2251,10 @@ int TA_LINEARREG_SLOPE_Lookback( int optInTimePeriod ); /* From 2 to /* * TA_LN - Vector Log Natural - * + * * Input = double * Output = double - * + * */ TA_RetCode TA_LN( int START_IDX, int END_IDX, @@ -2268,10 +2268,10 @@ int TA_LN_Lookback( void ); /* * TA_LOG10 - Vector Log10 - * + * * Input = double * Output = double - * + * */ TA_RetCode TA_LOG10( int START_IDX, int END_IDX, @@ -2285,19 +2285,19 @@ int TA_LOG10_Lookback( void ); /* * TA_MA - Moving average - * + * * Input = double * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 1 to 100000) * Number of period - * + * * optInMAType: * Type of Moving Average - * - * + * + * */ TA_RetCode TA_MA( int START_IDX, int END_IDX, @@ -2309,26 +2309,26 @@ TA_RetCode TA_MA( int START_IDX, double *OUT_ARRAY /* outReal */ ); int TA_MA_Lookback( int optInTimePeriod, /* From 1 to 100000 */ - TA_MAType optInMAType ); + TA_MAType optInMAType ); /* * TA_MACD - Moving Average Convergence/Divergence - * + * * Input = double * Output = double, double, double - * + * * Optional Parameters * ------------------- * optInFastPeriod:(From 2 to 100000) * Number of period for the fast MA - * + * * optInSlowPeriod:(From 2 to 100000) * Number of period for the slow MA - * + * * optInSignalPeriod:(From 1 to 100000) * Smoothing for the signal line (nb of period) - * - * + * + * */ TA_RetCode TA_MACD( int START_IDX, int END_IDX, @@ -2349,31 +2349,31 @@ int TA_MACD_Lookback( int optInFastPeriod, /* From 2 to 100000 */ /* * TA_MACDEXT - MACD with controllable MA type - * + * * Input = double * Output = double, double, double - * + * * Optional Parameters * ------------------- * optInFastPeriod:(From 2 to 100000) * Number of period for the fast MA - * + * * optInFastMAType: * Type of Moving Average for fast MA - * + * * optInSlowPeriod:(From 2 to 100000) * Number of period for the slow MA - * + * * optInSlowMAType: * Type of Moving Average for slow MA - * + * * optInSignalPeriod:(From 1 to 100000) * Smoothing for the signal line (nb of period) - * + * * optInSignalMAType: * Type of Moving Average for signal line - * - * + * + * */ TA_RetCode TA_MACDEXT( int START_IDX, int END_IDX, @@ -2395,20 +2395,20 @@ int TA_MACDEXT_Lookback( int optInFastPeriod, /* From 2 to 100000 */ int optInSlowPeriod, /* From 2 to 100000 */ TA_MAType optInSlowMAType, int optInSignalPeriod, /* From 1 to 100000 */ - TA_MAType optInSignalMAType ); + TA_MAType optInSignalMAType ); /* * TA_MACDFIX - Moving Average Convergence/Divergence Fix 12/26 - * + * * Input = double * Output = double, double, double - * + * * Optional Parameters * ------------------- * optInSignalPeriod:(From 1 to 100000) * Smoothing for the signal line (nb of period) - * - * + * + * */ TA_RetCode TA_MACDFIX( int START_IDX, int END_IDX, @@ -2425,19 +2425,19 @@ int TA_MACDFIX_Lookback( int optInSignalPeriod ); /* From 1 to 100000 /* * TA_MAMA - MESA Adaptive Moving Average - * + * * Input = double * Output = double, double - * + * * Optional Parameters * ------------------- * optInFastLimit:(From 0.01 to 0.99) * Upper limit use in the adaptive algorithm - * + * * optInSlowLimit:(From 0.01 to 0.99) * Lower limit use in the adaptive algorithm - * - * + * + * */ TA_RetCode TA_MAMA( int START_IDX, int END_IDX, @@ -2455,22 +2455,22 @@ int TA_MAMA_Lookback( double optInFastLimit, /* From 0.01 to 0.99 */ /* * TA_MAVP - Moving average with variable period - * + * * Input = double, double * Output = double - * + * * Optional Parameters * ------------------- * optInMinPeriod:(From 2 to 100000) * Value less than minimum will be changed to Minimum period - * + * * optInMaxPeriod:(From 2 to 100000) * Value higher than maximum will be changed to Maximum period - * + * * optInMAType: * Type of Moving Average - * - * + * + * */ TA_RetCode TA_MAVP( int START_IDX, int END_IDX, @@ -2485,20 +2485,20 @@ TA_RetCode TA_MAVP( int START_IDX, int TA_MAVP_Lookback( int optInMinPeriod, /* From 2 to 100000 */ int optInMaxPeriod, /* From 2 to 100000 */ - TA_MAType optInMAType ); + TA_MAType optInMAType ); /* * TA_MAX - Highest value over a specified period - * + * * Input = double * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_MAX( int START_IDX, int END_IDX, @@ -2513,16 +2513,16 @@ int TA_MAX_Lookback( int optInTimePeriod ); /* From 2 to 100000 */ /* * TA_MAXINDEX - Index of highest value over a specified period - * + * * Input = double * Output = int - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_MAXINDEX( int START_IDX, int END_IDX, @@ -2537,10 +2537,10 @@ int TA_MAXINDEX_Lookback( int optInTimePeriod ); /* From 2 to 100000 /* * TA_MEDPRICE - Median Price - * + * * Input = High, Low * Output = double - * + * */ TA_RetCode TA_MEDPRICE( int START_IDX, int END_IDX, @@ -2555,16 +2555,16 @@ int TA_MEDPRICE_Lookback( void ); /* * TA_MFI - Money Flow Index - * + * * Input = High, Low, Close, Volume * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_MFI( int START_IDX, int END_IDX, @@ -2582,16 +2582,16 @@ int TA_MFI_Lookback( int optInTimePeriod ); /* From 2 to 100000 */ /* * TA_MIDPOINT - MidPoint over period - * + * * Input = double * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_MIDPOINT( int START_IDX, int END_IDX, @@ -2606,16 +2606,16 @@ int TA_MIDPOINT_Lookback( int optInTimePeriod ); /* From 2 to 100000 /* * TA_MIDPRICE - Midpoint Price over period - * + * * Input = High, Low * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_MIDPRICE( int START_IDX, int END_IDX, @@ -2631,16 +2631,16 @@ int TA_MIDPRICE_Lookback( int optInTimePeriod ); /* From 2 to 100000 /* * TA_MIN - Lowest value over a specified period - * + * * Input = double * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_MIN( int START_IDX, int END_IDX, @@ -2655,16 +2655,16 @@ int TA_MIN_Lookback( int optInTimePeriod ); /* From 2 to 100000 */ /* * TA_MININDEX - Index of lowest value over a specified period - * + * * Input = double * Output = int - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_MININDEX( int START_IDX, int END_IDX, @@ -2679,16 +2679,16 @@ int TA_MININDEX_Lookback( int optInTimePeriod ); /* From 2 to 100000 /* * TA_MINMAX - Lowest and highest values over a specified period - * + * * Input = double * Output = double, double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_MINMAX( int START_IDX, int END_IDX, @@ -2704,16 +2704,16 @@ int TA_MINMAX_Lookback( int optInTimePeriod ); /* From 2 to 100000 */ /* * TA_MINMAXINDEX - Indexes of lowest and highest values over a specified period - * + * * Input = double * Output = int, int - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_MINMAXINDEX( int START_IDX, int END_IDX, @@ -2729,16 +2729,16 @@ int TA_MINMAXINDEX_Lookback( int optInTimePeriod ); /* From 2 to 1000 /* * TA_MINUS_DI - Minus Directional Indicator - * + * * Input = High, Low, Close * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 1 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_MINUS_DI( int START_IDX, int END_IDX, @@ -2755,16 +2755,16 @@ int TA_MINUS_DI_Lookback( int optInTimePeriod ); /* From 1 to 100000 /* * TA_MINUS_DM - Minus Directional Movement - * + * * Input = High, Low * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 1 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_MINUS_DM( int START_IDX, int END_IDX, @@ -2780,16 +2780,16 @@ int TA_MINUS_DM_Lookback( int optInTimePeriod ); /* From 1 to 100000 /* * TA_MOM - Momentum - * + * * Input = double * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 1 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_MOM( int START_IDX, int END_IDX, @@ -2804,10 +2804,10 @@ int TA_MOM_Lookback( int optInTimePeriod ); /* From 1 to 100000 */ /* * TA_MULT - Vector Arithmetic Mult - * + * * Input = double, double * Output = double - * + * */ TA_RetCode TA_MULT( int START_IDX, int END_IDX, @@ -2822,16 +2822,16 @@ int TA_MULT_Lookback( void ); /* * TA_NATR - Normalized Average True Range - * + * * Input = High, Low, Close * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 1 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_NATR( int START_IDX, int END_IDX, @@ -2848,10 +2848,10 @@ int TA_NATR_Lookback( int optInTimePeriod ); /* From 1 to 100000 */ /* * TA_OBV - On Balance Volume - * + * * Input = double, Volume * Output = double - * + * */ TA_RetCode TA_OBV( int START_IDX, int END_IDX, @@ -2866,16 +2866,16 @@ int TA_OBV_Lookback( void ); /* * TA_PLUS_DI - Plus Directional Indicator - * + * * Input = High, Low, Close * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 1 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_PLUS_DI( int START_IDX, int END_IDX, @@ -2892,16 +2892,16 @@ int TA_PLUS_DI_Lookback( int optInTimePeriod ); /* From 1 to 100000 * /* * TA_PLUS_DM - Plus Directional Movement - * + * * Input = High, Low * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 1 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_PLUS_DM( int START_IDX, int END_IDX, @@ -2917,22 +2917,22 @@ int TA_PLUS_DM_Lookback( int optInTimePeriod ); /* From 1 to 100000 * /* * TA_PPO - Percentage Price Oscillator - * + * * Input = double * Output = double - * + * * Optional Parameters * ------------------- * optInFastPeriod:(From 2 to 100000) * Number of period for the fast MA - * + * * optInSlowPeriod:(From 2 to 100000) * Number of period for the slow MA - * + * * optInMAType: * Type of Moving Average - * - * + * + * */ TA_RetCode TA_PPO( int START_IDX, int END_IDX, @@ -2946,20 +2946,20 @@ TA_RetCode TA_PPO( int START_IDX, int TA_PPO_Lookback( int optInFastPeriod, /* From 2 to 100000 */ int optInSlowPeriod, /* From 2 to 100000 */ - TA_MAType optInMAType ); + TA_MAType optInMAType ); /* * TA_ROC - Rate of change : ((price/prevPrice)-1)*100 - * + * * Input = double * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 1 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_ROC( int START_IDX, int END_IDX, @@ -2974,16 +2974,16 @@ int TA_ROC_Lookback( int optInTimePeriod ); /* From 1 to 100000 */ /* * TA_ROCP - Rate of change Percentage: (price-prevPrice)/prevPrice - * + * * Input = double * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 1 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_ROCP( int START_IDX, int END_IDX, @@ -2998,16 +2998,16 @@ int TA_ROCP_Lookback( int optInTimePeriod ); /* From 1 to 100000 */ /* * TA_ROCR - Rate of change ratio: (price/prevPrice) - * + * * Input = double * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 1 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_ROCR( int START_IDX, int END_IDX, @@ -3022,16 +3022,16 @@ int TA_ROCR_Lookback( int optInTimePeriod ); /* From 1 to 100000 */ /* * TA_ROCR100 - Rate of change ratio 100 scale: (price/prevPrice)*100 - * + * * Input = double * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 1 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_ROCR100( int START_IDX, int END_IDX, @@ -3046,16 +3046,16 @@ int TA_ROCR100_Lookback( int optInTimePeriod ); /* From 1 to 100000 * /* * TA_RSI - Relative Strength Index - * + * * Input = double * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_RSI( int START_IDX, int END_IDX, @@ -3070,19 +3070,19 @@ int TA_RSI_Lookback( int optInTimePeriod ); /* From 2 to 100000 */ /* * TA_SAR - Parabolic SAR - * + * * Input = High, Low * Output = double - * + * * Optional Parameters * ------------------- * optInAcceleration:(From 0 to TA_REAL_MAX) * Acceleration Factor used up to the Maximum value - * + * * optInMaximum:(From 0 to TA_REAL_MAX) * Acceleration Factor Maximum value - * - * + * + * */ TA_RetCode TA_SAR( int START_IDX, int END_IDX, @@ -3100,37 +3100,37 @@ int TA_SAR_Lookback( double optInAcceleration, /* From 0 to TA_REAL_MAX * /* * TA_SAREXT - Parabolic SAR - Extended - * + * * Input = High, Low * Output = double - * + * * Optional Parameters * ------------------- * optInStartValue:(From TA_REAL_MIN to TA_REAL_MAX) * Start value and direction. 0 for Auto, >0 for Long, <0 for Short - * + * * optInOffsetOnReverse:(From 0 to TA_REAL_MAX) * Percent offset added/removed to initial stop on short/long reversal - * + * * optInAccelerationInitLong:(From 0 to TA_REAL_MAX) * Acceleration Factor initial value for the Long direction - * + * * optInAccelerationLong:(From 0 to TA_REAL_MAX) * Acceleration Factor for the Long direction - * + * * optInAccelerationMaxLong:(From 0 to TA_REAL_MAX) * Acceleration Factor maximum value for the Long direction - * + * * optInAccelerationInitShort:(From 0 to TA_REAL_MAX) * Acceleration Factor initial value for the Short direction - * + * * optInAccelerationShort:(From 0 to TA_REAL_MAX) * Acceleration Factor for the Short direction - * + * * optInAccelerationMaxShort:(From 0 to TA_REAL_MAX) * Acceleration Factor maximum value for the Short direction - * - * + * + * */ TA_RetCode TA_SAREXT( int START_IDX, int END_IDX, @@ -3160,10 +3160,10 @@ int TA_SAREXT_Lookback( double optInStartValue, /* From TA_REAL_MIN to TA /* * TA_SIN - Vector Trigonometric Sin - * + * * Input = double * Output = double - * + * */ TA_RetCode TA_SIN( int START_IDX, int END_IDX, @@ -3177,10 +3177,10 @@ int TA_SIN_Lookback( void ); /* * TA_SINH - Vector Trigonometric Sinh - * + * * Input = double * Output = double - * + * */ TA_RetCode TA_SINH( int START_IDX, int END_IDX, @@ -3194,16 +3194,16 @@ int TA_SINH_Lookback( void ); /* * TA_SMA - Simple Moving Average - * + * * Input = double * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_SMA( int START_IDX, int END_IDX, @@ -3218,10 +3218,10 @@ int TA_SMA_Lookback( int optInTimePeriod ); /* From 2 to 100000 */ /* * TA_SQRT - Vector Square Root - * + * * Input = double * Output = double - * + * */ TA_RetCode TA_SQRT( int START_IDX, int END_IDX, @@ -3235,19 +3235,19 @@ int TA_SQRT_Lookback( void ); /* * TA_STDDEV - Standard Deviation - * + * * Input = double * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * + * * optInNbDev:(From TA_REAL_MIN to TA_REAL_MAX) * Nb of deviations - * - * + * + * */ TA_RetCode TA_STDDEV( int START_IDX, int END_IDX, @@ -3264,28 +3264,28 @@ int TA_STDDEV_Lookback( int optInTimePeriod, /* From 2 to 100000 */ /* * TA_STOCH - Stochastic - * + * * Input = High, Low, Close * Output = double, double - * + * * Optional Parameters * ------------------- * optInFastK_Period:(From 1 to 100000) * Time period for building the Fast-K line - * + * * optInSlowK_Period:(From 1 to 100000) * Smoothing for making the Slow-K line. Usually set to 3 - * + * * optInSlowK_MAType: * Type of Moving Average for Slow-K - * + * * optInSlowD_Period:(From 1 to 100000) * Smoothing for making the Slow-D line - * + * * optInSlowD_MAType: * Type of Moving Average for Slow-D - * - * + * + * */ TA_RetCode TA_STOCH( int START_IDX, int END_IDX, @@ -3306,26 +3306,26 @@ int TA_STOCH_Lookback( int optInFastK_Period, /* From 1 to 100000 */ int optInSlowK_Period, /* From 1 to 100000 */ TA_MAType optInSlowK_MAType, int optInSlowD_Period, /* From 1 to 100000 */ - TA_MAType optInSlowD_MAType ); + TA_MAType optInSlowD_MAType ); /* * TA_STOCHF - Stochastic Fast - * + * * Input = High, Low, Close * Output = double, double - * + * * Optional Parameters * ------------------- * optInFastK_Period:(From 1 to 100000) * Time period for building the Fast-K line - * + * * optInFastD_Period:(From 1 to 100000) * Smoothing for making the Fast-D line. Usually set to 3 - * + * * optInFastD_MAType: * Type of Moving Average for Fast-D - * - * + * + * */ TA_RetCode TA_STOCHF( int START_IDX, int END_IDX, @@ -3342,29 +3342,29 @@ TA_RetCode TA_STOCHF( int START_IDX, int TA_STOCHF_Lookback( int optInFastK_Period, /* From 1 to 100000 */ int optInFastD_Period, /* From 1 to 100000 */ - TA_MAType optInFastD_MAType ); + TA_MAType optInFastD_MAType ); /* * TA_STOCHRSI - Stochastic Relative Strength Index - * + * * Input = double * Output = double, double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * + * * optInFastK_Period:(From 1 to 100000) * Time period for building the Fast-K line - * + * * optInFastD_Period:(From 1 to 100000) * Smoothing for making the Fast-D line. Usually set to 3 - * + * * optInFastD_MAType: * Type of Moving Average for Fast-D - * - * + * + * */ TA_RetCode TA_STOCHRSI( int START_IDX, int END_IDX, @@ -3381,14 +3381,14 @@ TA_RetCode TA_STOCHRSI( int START_IDX, int TA_STOCHRSI_Lookback( int optInTimePeriod, /* From 2 to 100000 */ int optInFastK_Period, /* From 1 to 100000 */ int optInFastD_Period, /* From 1 to 100000 */ - TA_MAType optInFastD_MAType ); + TA_MAType optInFastD_MAType ); /* * TA_SUB - Vector Arithmetic Substraction - * + * * Input = double, double * Output = double - * + * */ TA_RetCode TA_SUB( int START_IDX, int END_IDX, @@ -3403,16 +3403,16 @@ int TA_SUB_Lookback( void ); /* * TA_SUM - Summation - * + * * Input = double * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_SUM( int START_IDX, int END_IDX, @@ -3427,19 +3427,19 @@ int TA_SUM_Lookback( int optInTimePeriod ); /* From 2 to 100000 */ /* * TA_T3 - Triple Exponential Moving Average (T3) - * + * * Input = double * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * + * * optInVFactor:(From 0 to 1) * Volume Factor - * - * + * + * */ TA_RetCode TA_T3( int START_IDX, int END_IDX, @@ -3456,10 +3456,10 @@ int TA_T3_Lookback( int optInTimePeriod, /* From 2 to 100000 */ /* * TA_TAN - Vector Trigonometric Tan - * + * * Input = double * Output = double - * + * */ TA_RetCode TA_TAN( int START_IDX, int END_IDX, @@ -3473,10 +3473,10 @@ int TA_TAN_Lookback( void ); /* * TA_TANH - Vector Trigonometric Tanh - * + * * Input = double * Output = double - * + * */ TA_RetCode TA_TANH( int START_IDX, int END_IDX, @@ -3490,16 +3490,16 @@ int TA_TANH_Lookback( void ); /* * TA_TEMA - Triple Exponential Moving Average - * + * * Input = double * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_TEMA( int START_IDX, int END_IDX, @@ -3514,10 +3514,10 @@ int TA_TEMA_Lookback( int optInTimePeriod ); /* From 2 to 100000 */ /* * TA_TRANGE - True Range - * + * * Input = High, Low, Close * Output = double - * + * */ TA_RetCode TA_TRANGE( int START_IDX, int END_IDX, @@ -3533,16 +3533,16 @@ int TA_TRANGE_Lookback( void ); /* * TA_TRIMA - Triangular Moving Average - * + * * Input = double * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_TRIMA( int START_IDX, int END_IDX, @@ -3557,16 +3557,16 @@ int TA_TRIMA_Lookback( int optInTimePeriod ); /* From 2 to 100000 */ /* * TA_TRIX - 1-day Rate-Of-Change (ROC) of a Triple Smooth EMA - * + * * Input = double * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 1 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_TRIX( int START_IDX, int END_IDX, @@ -3581,16 +3581,16 @@ int TA_TRIX_Lookback( int optInTimePeriod ); /* From 1 to 100000 */ /* * TA_TSF - Time Series Forecast - * + * * Input = double * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_TSF( int START_IDX, int END_IDX, @@ -3605,10 +3605,10 @@ int TA_TSF_Lookback( int optInTimePeriod ); /* From 2 to 100000 */ /* * TA_TYPPRICE - Typical Price - * + * * Input = High, Low, Close * Output = double - * + * */ TA_RetCode TA_TYPPRICE( int START_IDX, int END_IDX, @@ -3624,22 +3624,22 @@ int TA_TYPPRICE_Lookback( void ); /* * TA_ULTOSC - Ultimate Oscillator - * + * * Input = High, Low, Close * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod1:(From 1 to 100000) * Number of bars for 1st period. - * + * * optInTimePeriod2:(From 1 to 100000) * Number of bars fro 2nd period - * + * * optInTimePeriod3:(From 1 to 100000) * Number of bars for 3rd period - * - * + * + * */ TA_RetCode TA_ULTOSC( int START_IDX, int END_IDX, @@ -3660,19 +3660,19 @@ int TA_ULTOSC_Lookback( int optInTimePeriod1, /* From 1 to 100000 */ /* * TA_VAR - Variance - * + * * Input = double * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 1 to 100000) * Number of period - * + * * optInNbDev:(From TA_REAL_MIN to TA_REAL_MAX) * Nb of deviations - * - * + * + * */ TA_RetCode TA_VAR( int START_IDX, int END_IDX, @@ -3689,10 +3689,10 @@ int TA_VAR_Lookback( int optInTimePeriod, /* From 1 to 100000 */ /* * TA_WCLPRICE - Weighted Close Price - * + * * Input = High, Low, Close * Output = double - * + * */ TA_RetCode TA_WCLPRICE( int START_IDX, int END_IDX, @@ -3708,16 +3708,16 @@ int TA_WCLPRICE_Lookback( void ); /* * TA_WILLR - Williams' %R - * + * * Input = High, Low, Close * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_WILLR( int START_IDX, int END_IDX, @@ -3734,16 +3734,16 @@ int TA_WILLR_Lookback( int optInTimePeriod ); /* From 2 to 100000 */ /* * TA_WMA - Weighted Moving Average - * + * * Input = double * Output = double - * + * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period - * - * + * + * */ TA_RetCode TA_WMA( int START_IDX, int END_IDX, @@ -3783,7 +3783,7 @@ unsigned int TA_GetUnstablePeriod( TA_FuncUnstId id ); /* You can change slightly the behavior of the TA functions * by requesting compatibiliy with some existing software. * - * By default, the behavior is as close as the original + * By default, the behavior is as close as the original * author of the TA functions intend it to be. * * See ta_defs.h for the enumeration TA_Compatibility. @@ -3792,22 +3792,22 @@ TA_RetCode TA_SetCompatibility( TA_Compatibility value ); TA_Compatibility TA_GetCompatibility( void ); /* Candlesticks struct and functions - * Because candlestick patterns are subjective, it is necessary - * to allow the user to specify what should be the meaning of + * Because candlestick patterns are subjective, it is necessary + * to allow the user to specify what should be the meaning of * 'long body', 'short shadows', etc. */ -/* Call TA_SetCandleSettings to set that when comparing a candle - * basing on settingType it must be compared with the average +/* Call TA_SetCandleSettings to set that when comparing a candle + * basing on settingType it must be compared with the average * of the last avgPeriod candles' rangeType multiplied by factor. * This setting is valid until TA_RestoreCandleDefaultSettings is called */ -TA_RetCode TA_SetCandleSettings( TA_CandleSettingType settingType, - TA_RangeType rangeType, - int avgPeriod, +TA_RetCode TA_SetCandleSettings( TA_CandleSettingType settingType, + TA_RangeType rangeType, + int avgPeriod, double factor ); -/* Call TA_RestoreCandleDefaultSettings after using custom settings +/* Call TA_RestoreCandleDefaultSettings after using custom settings * to restore the default settings for the specified settingType */ TA_RetCode TA_RestoreCandleDefaultSettings( TA_CandleSettingType settingType );