# Fast RSI cross Slow RSI

#### natedaag

##### New member
Hi
This is my first ever attempt at coding a ThinkScript, but my indi is pretty basic. I'd like an arrow to appear on the chart when the RSI(6) crosses the RSI(14), and vice versa. It seems to work, but I think it uses the WILDERS average type, and I can't figure out how to change that. I'd rather it defaulted to exponential, but with the ability to change it.

Any help would be appreciated.

input rsi1_len = 6;
input rsi2_len = 14;

def rsi1 = RSI(length = rsi1_len);
def rsi2 = RSI(length = rsi2_len);

def bull_cross = rsi1 crosses above rsi2;
def bear_cross = rsi1 crosses below rsi2;

plot GU = bull_cross;
GU.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
GU.SetDefaultColor(Color.YELLOW);
GU.SetLineWeight(2);

plot GX = bear_cross;
GX.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
GX.SetDefaultColor(Color.PINK);
GX.SetLineWeight(2);

Solution
Hi
This is my first ever attempt at coding a ThinkScript, but my indi is pretty basic. I'd like an arrow to appear on the chart when the RSI(6) crosses the RSI(14), and vice versa. It seems to work, but I think it uses the WILDERS average type, and I can't figure out how to change that. I'd rather it defaulted to exponential, but with the ability to change it.

Any help would be appreciated.

input rsi1_len = 6;
input rsi2_len = 14;

def rsi1 = RSI(length = rsi1_len);
def rsi2 = RSI(length = rsi2_len);

def bull_cross = rsi1 crosses above rsi2;
def bear_cross = rsi1 crosses below rsi2;

plot GU = bull_cross;
GU.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
GU.SetDefaultColor(Color.YELLOW);
GU.SetLineWeight(2);

plot GX...
Hi
This is my first ever attempt at coding a ThinkScript, but my indi is pretty basic. I'd like an arrow to appear on the chart when the RSI(6) crosses the RSI(14), and vice versa. It seems to work, but I think it uses the WILDERS average type, and I can't figure out how to change that. I'd rather it defaulted to exponential, but with the ability to change it.

Any help would be appreciated.

input rsi1_len = 6;
input rsi2_len = 14;

def rsi1 = RSI(length = rsi1_len);
def rsi2 = RSI(length = rsi2_len);

def bull_cross = rsi1 crosses above rsi2;
def bear_cross = rsi1 crosses below rsi2;

plot GU = bull_cross;
GU.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
GU.SetDefaultColor(Color.YELLOW);
GU.SetLineWeight(2);

plot GX = bear_cross;
GX.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
GX.SetDefaultColor(Color.PINK);
GX.SetLineWeight(2);
Welcome and nice work!

You can create an input and reference in the RSI() as you did for length for averagetype.

Since there were other input variables between the length and averagetype, you need to reference the input name. If there were not, then you would not need that reference. It is always good practice to arrange your inputs in the RSI() Inspector in the order they are showing there. For example, length, overbought, oversold, .... etc.

Code:
``````input rsi1_len = 6;
input rsi2_len = 14;
input avgtype  = averageType.EXPONENTIAL;

def rsi1 = RSI(length = rsi1_len, averagetype=avgtype);
def rsi2 = RSI(length = rsi2_len, averagetype=avgtype);

def bull_cross = rsi1 crosses above rsi2;
def bear_cross = rsi1 crosses below rsi2;

plot GU = bull_cross;
GU.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
GU.SetDefaultColor(Color.YELLOW);
GU.SetLineWeight(2);

plot GX = bear_cross;
GX.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
GX.SetDefaultColor(Color.PINK);
GX.SetLineWeight(2);``````

Fast moving stocks Questions 3
Fast Stochastic Failures Questions 4
RSI-EMA-Bollinger Signal? Questions 0
major indices RSI Questions 0
Signals based on RSI, BB, and Moving Average Questions 1

87k+ Posts
307 Online

## The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• Exclusive members-only content
• 1 full year of unlimited support

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?