1. Home
  2. ThinkorSwim Indicators
  3. Relative Strength Index Hann (RSIH) for ThinkorSwim

Relative Strength Index Hann (RSIH) for ThinkorSwim

In a recent update (rel-10-29-2022), ThinkorSwim added the Relative Strength Index Hann (RSIH) indicator to its platform.

The Relative Strength Index Hann (RSIH), created by John Ehlers, is a technical analysis indicator based on the Relative Strength Index (RSI).

The RSIH helps to solve some of the limitations of the RSI. These include normalizing the output, incorporating Hann window to filter results, and ignoring oversold and overbought conditions when looking for a buy/sell trigger. 

Relative Strength Index Hann for ThinkorSwim

#
# TD Ameritrade IP Company, Inc. (c) 2022
#

declare lower;

input price = close;
input length = 14;

def NetChgAvg = reference FIR_Hann(price = price - price[1], length = length);
def TotChgAvg = reference FIR_Hann(price = AbsValue(price - price[1]), length = length);

plot RSIH = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;
plot ZeroLine = 0;

RSIH.SetDefaultColor(GetColor(4));
ZeroLine.SetDefaultColor(GetColor(7));

Below you will find the modified version of the RSIH indicator. The plot now changes color based on the condition below.

  • RSIH > 0 = Green
  • RSIH < 0 = Red
# RSIH
# 10/29/2022
# Melvin C.
# Added color change to plot
declare lower;
input price = close;
input length = 14;
def NetChgAvg = reference FIR_Hann(price = price - price[1], length = length);
def TotChgAvg = reference FIR_Hann(price = AbsValue(price - price[1]), length = length);
plot RSIH = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;
plot ZeroLine = 0;
RSIH.AssignValueColor(if RSIH > 0 then Color.GREEN else Color.RED);
ZeroLine.SetDefaultColor(GetColor(7));

Unlock the Power of ThinkorSwim

Get the latest news and updates on TD Ameritrade, ThinkorSwim indicators, thinkScript tutorials, and trading strategies delivered straight to your inbox every week.

We don’t spam! Unsubscribe at anytime.

Leave a Reply

Your email address will not be published. Required fields are marked *