1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | //Indicator: TASC DEC 2021 RSIH // TASC JAN 2022 // RSIH - RSI with Hann Windowing // (C) 2005-2021 John F. Ehlers // Parameters RSILength: 14 // Accumulate "Closes Up" and "Closes Down" CU = 0 CD = 0 for count = 1 to RSILength do if Close[count - 1] - Close[count] > 0 then CU = CU + (1 - cos(360*count / (RSILength + 1))) * (Close[count - 1] - Close[count]) endif if Close[count] - Close[count - 1] > 0 then CD = CD + (1 - cos(360*count / (RSILength + 1))) *(Close[count] - Close[count - 1]) endif next if CU + CD <> 0 then MyRSI = (CU - CD) / (CU + CD) endif return MyRSI as "RSIH" |