OPEN-SOURCE SCRIPT

000 RSI Divergence with Trendline v2

Updated version of the strategy RSI Divergence with Trendline.

Calculates the RSI indicator using the specified settings
Detects pivot points (highs and lows) in the RSI with a 5-period lookback
Uses these pivots to identify four types of divergences:
Regular bullish divergence: Price makes lower lows but RSI makes higher lows
Hidden bullish divergence: Price makes higher lows but RSI makes lower lows
Regular bearish divergence: Price makes higher highs but RSI makes lower highs
Hidden bearish divergence: Price makes lower highs but RSI makes higher highs
Creates dynamic trendlines on the RSI indicator
Uses different colors to distinguish between divergence types:
Green: Regular bullish divergence
Blue: Hidden bullish divergence
Red: Regular bearish divergence
Orange: Hidden bearish divergence
Automatically deletes and redraws trendlines when new divergences are detected
Entry Signals
Long entries:
Triggered when RSI crosses above the bullish trendline
Sets take profit price at entry price + 5%
Sets stop loss price at entry price - 5%
Short entries:
Triggered when RSI crosses below the bearish trendline
Sets take profit price at entry price - 5%
Sets stop loss price at entry price + 5%
Exit Rules
Takes profit when price reaches the TP level
Exits with a loss when price hits the SL level
Additional exit conditions:
Exits long positions when hidden bearish divergence appears
Exits short positions when hidden bullish divergence appears
Plots the RSI indicator in purple
Shows overbought and oversold levels as horizontal lines
Displays active take profit and stop loss levels with circular markers:
Green circles for take profit levels
Red circles for stop loss levels
rsi_divergenceTrend Analysis

オープンソーススクリプト

TradingViewの精神に則り、このスクリプトの作者は、トレーダーが理解し検証できるようにオープンソースで公開しています。作者に敬意を表します!無料で使用することができますが、このコードを投稿で再利用するには、ハウスルールに準拠する必要があります。 お気に入りに登録してチャート上でご利用頂けます。

チャートでこのスクリプトを利用したいですか?

免責事項