RSI with Indicators

The default is set for short term trading on a daily basis - RSI(2)

The green upward arrow indicates a Buy Now, don't forget to set a close trailing stop

The red downward arrow indicates a Sell or shorten up your stop, Now.

#################################

# RSI with indicators

#

# Brian Cox

# 4/2/13

# file name: RSI_with_indacators.ts

#

# The default is set for short term trading on a daily basis - RSI(2)

#

# The green upward arrow indicates a Buy Now, don't forget to set a close trailing stop

# The red downward arrow indicates a Sell or shorten up your stop, Now.

#

##############################################

declare upper;

input length = 2; # default 2 day length

input over_bought = 75; # Suggested over-bought threshold

input over_sold = 25; # Suggested over-sold threshold

input price = close; # use the closing price in the calculations

def green = 9; # value for green

def red = 5; # value for red

def NetChgAvg = ExpAverage(price - price[1], length);

def TotChgAvg = ExpAverage(AbsValue(price - price[1]), length);

def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;

def RSI_EMA = 50 * (ChgRatio + 1);

plot Bullish = crosses (RSI_EMA, over_sold, CrossingDirection.BELOW);

plot Bearish = crosses (RSI_EMA, over_bought, CrossingDirection.ABOVE);

Bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

Bearish.SetDefaultColor(GetColor(red));

Bearish.SetLineWeight(4);

Bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Bullish.SetDefaultColor(GetColor(green));

Bullish.SetLineWeight(4);