ARSI - Adaptive Relative Strength Index for ThinkorSwim

rad14733

Well-known member
VIP
I finished coding this indicator due to a conversion request from a member which reminded me that I had started working on it a while back but got distracted from it... The ARSI is an upper indicator that works like a moving average but based on RSI... It works well for scalping which is what drew my original interest... While the standard RSI uses a length of 14 it is recommended to use a shorter length for this indicator and 3 is a good length for scalping on lower timeframes...

I will be adding more details as well as more images as time allows...

Ruby:
# ARSI
#hint: Adaptive Relative Strength Index Indicator for Thinkscript
# Created by rad14733 for usethinkscript.com
# Based (loosely) on Tradingview ARSI @ https://www.tradingview.com/script/tSpy2kw2-Adaptive-RSI/ and other research
# Plots a colored line on the upper chart based on trend direction.
# v1.0 : 2021-03-28 : Initial Release

input length = 14;
input price = close;
input averageType = AverageType.WILDERS;

def rsi = 2 * AbsValue(rsi(length, price, averageType) / 100 - 0.5);

def arsiData = rsi * price + (1 - rsi) * (if isNaN(arsiData[1]) then 0 else arsiData[1]);

plot arsi = arsiData;
arsi.DefineColor("UpTrend", Color.GREEN);
arsi.DefineColor("DownTrend", Color.RED);
arsi.SetLineWeight(2);
arsi.SetPaintingStrategy(PaintingStrategy.LINE);
arsi.SetStyle(Curve.FIRM);
arsi.AssignValueColor(if arsi > arsi[1] then arsi.Color("UpTrend") else arsi.Color("DownTrend"));

# END - ARSI

CL1ciE4.png
 
Last edited:

Similar threads

Top