OPEN-SOURCE SCRIPT
Reverse RSI

//version=6
indicator("Reverse RSI", overlay=false)
rsi_length = input.int(14, title="RSI Length", minval=1)
ob_level = input.int(75, title="Overbought Level")
os_level = input.int(25, title="Oversold Level")
invRSI(target, length) =>
target_rs = target / (100 - target)
up = math.max(close-close[1], 0)
down = math.max(close[1]-close, 0)
prev_avg_up = ta.rma(up, length)
prev_avg_down = ta.rma(down, length)
price_up = target_rs * (prev_avg_down * (length - 1)) - (prev_avg_up * (length - 1)) + close
price_down = (prev_avg_down * (length - 1) - (prev_avg_up * (length - 1)) / target_rs) + close
current_rsi = ta.rsi(close, length)
price = target > current_rsi ? price_up : price_down
price
price_ob = invRSI(ob_level, rsi_length)
price_mid = invRSI(50, rsi_length)
price_os = invRSI(os_level, rsi_length)
upside = (price_ob-close)/close*100
downside = (close-price_os)/close*100
net = upside-downside
plot(upside, title="Upside Line", color=color.green)
plot(downside, title="Downside Line", color=color.red)
plot(net, title="Net Line", color=net>0?color.new(color.green, 30):color.new(color.red, 30), style=plot.style_columns)
hline(0, "Zero Line")
indicator("Reverse RSI", overlay=false)
rsi_length = input.int(14, title="RSI Length", minval=1)
ob_level = input.int(75, title="Overbought Level")
os_level = input.int(25, title="Oversold Level")
invRSI(target, length) =>
target_rs = target / (100 - target)
up = math.max(close-close[1], 0)
down = math.max(close[1]-close, 0)
prev_avg_up = ta.rma(up, length)
prev_avg_down = ta.rma(down, length)
price_up = target_rs * (prev_avg_down * (length - 1)) - (prev_avg_up * (length - 1)) + close
price_down = (prev_avg_down * (length - 1) - (prev_avg_up * (length - 1)) / target_rs) + close
current_rsi = ta.rsi(close, length)
price = target > current_rsi ? price_up : price_down
price
price_ob = invRSI(ob_level, rsi_length)
price_mid = invRSI(50, rsi_length)
price_os = invRSI(os_level, rsi_length)
upside = (price_ob-close)/close*100
downside = (close-price_os)/close*100
net = upside-downside
plot(upside, title="Upside Line", color=color.green)
plot(downside, title="Downside Line", color=color.red)
plot(net, title="Net Line", color=net>0?color.new(color.green, 30):color.new(color.red, 30), style=plot.style_columns)
hline(0, "Zero Line")
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.