From 107c45961775e7e7e21f6a11e3a1ab0718c1dbe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A2=D1=80=D1=83=D1=84=D0=B0=D0=BD=D0=BE=D0=B2=20=D0=90?= =?UTF-8?q?=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80?= Date: Mon, 8 Jan 2024 19:11:33 +0300 Subject: [PATCH] Fix a bug in CDLONNECK State func --- ta-lib-rt/c/src/ta_func/ta_CDLONNECK.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ta-lib-rt/c/src/ta_func/ta_CDLONNECK.c b/ta-lib-rt/c/src/ta_func/ta_CDLONNECK.c index daa82bc9..ccab91e1 100644 --- a/ta-lib-rt/c/src/ta_func/ta_CDLONNECK.c +++ b/ta-lib-rt/c/src/ta_func/ta_CDLONNECK.c @@ -372,9 +372,10 @@ int i1; STATE.gapBodyLong = MEM_SIZE - STATE.periodBodyLong; } + i1 = GET_LOCAL_IDX(-1); + if (!(NEED_MORE_DATA)) { - if( TA_CANDLECOLOR_STATE_IDX(i1) == -1 && // 1st: black TA_REALBODY_STATE_IDX(i1) > TA_CANDLEAVERAGE_STATE_IDX( BodyLong, STATE.BodyLongPeriodTotal, i1 ) && // long TA_CANDLECOLOR_STATE_CUR() == 1 && // 2nd: white