Closed ydcool closed 4 years ago
I also read the RSI in c at https://sourceforge.net/p/ta-lib/code/HEAD/tree/trunk/ta-lib/c/src/ta_func/ta_RSI.c#l358
I'm not quite familar with c , just wonder that could the startIdx
be simplified as 0?
Hi Dominic, This code is a straight up port from the Java version of TA-Lib. So any peculiarities like that exist in the original version as well. Since I test the output of this version against the original TA-Lib, I'm inclined to leave it alone for now.
I see. I have read the java version and finally figured it out. The reason that your code got the correct result is the last for loop coverd the caculations, and those dead codes above have no side effects.
https://github.com/markcheno/go-talib/blob/cd53a9264d70bedcff891f59bf153275f524c100/talib.go#L2819-L2840
Hi Mark, just start reading this source codes, and got a little confused about the
today
variable in funcRsi
, it seems that at L2840 thetoday
will be 3 at least because there's an auto-increament operation at L2823 and min value ofinTimePeriod
is 2, so theelse
part at L2850 would never be reached. Is that right?