OPEN-SOURCE SCRIPT

RSI Trendlines with Breakouts

Cập nhật
A pivot-based breakout indicator that attempts to provide traders with a visual aid for finding breakouts on the RSI. Similar to how we use trendlines on our charts, using them on the Relative Strength Index can also give us a sense of direction in the markets.

This script uses its own pivot-based system that checks for real-time swing levels and triggers a new pivot event after every dip and nth bars. The breakout alerts that are given were not designed to be taken as signals since their purpose is to provide an extra bit of confluence. Because of this, I added no other conditions that try to make the alerts "perfect", but instead, print every breakout that is detected. Despite stating this, I did happen to add a condition that checks the difference in RSI and the breakout value, but that's as far as it'll go.

There are alerts built-in to the script, along with adjustable repainting options.

🔳 Settings
  • Lookback Range: Lookback period to trigger a new pivot point when conditions are met.
  • RSI Difference: The difference between the current RSI value and the breakout value. How much higher in value should the current RSI be compared to the breakout value in order to detect a breakout?
  • RSI Settings
  • Styling Options


🔳 Repaint Options
On: Allows repainting
Off - Bar Confirmation: Prevents repainting and generates alerts when the bar closes. (1 candle later)

🔳 How it Works
Before a trendline is drawn, the script retrieves the slope between the previous pivot point and the current. Then it adds or subtracts the slope x amount of times (based on the lookback range) from the current pivot value until the current x-axis is reached. By doing this we can get a trendline that will detect a breakout accurately.
ảnh chụp nhanh
The result
ảnh chụp nhanh

When using the RSI Difference condition, the script will print breakouts whenever the condition is true, because of this dotted lines were added to track where the alert was triggered.
ảnh chụp nhanh

🔳 Alerts
ảnh chụp nhanh
Phát hành các Ghi chú
Added
  • A condition to check for the difference between the current RSI value and the breakout value.
  • The script now prints a dotted line indicating where the breakout alert was triggered.
Phát hành các Ghi chú
Added
  • Minor Changes
Phát hành các Ghi chú
Refactor
  • Simple Trendlines library integration.
  • Horizontal lines are now a feature to display overbought and oversold zones.

Simple Trendlines
Phát hành các Ghi chú
Fix
  • Alert fixes
Phát hành các Ghi chú
Update
  • Maximum label and line display count are now set as default.
Phát hành các Ghi chú
Add
  • Multi-timeframe support (Historical data may not be accurate, barmerge is used to try and compensate for historical accuracy. Replay results will differ, realtime data however should be fine.)
Phát hành các Ghi chú
Refactor
  • Removed old pivot system in favor of Pine Script's built-in pivot system. Leading to run-time performance increase and more accurate results.
Phát hành các Ghi chú
Fix
  • Small logic error.
breakoutPivot PointsRelative Strength Index (RSI)trendTrend AnalysisTrend Line Break

Mã nguồn mở

Theo tinh thần TradingView thực sự, tác giả của tập lệnh này đã xuất bản dưới dạng nguồn mở để các nhà giao dịch có thể hiểu và xác minh. Chúc mừng tác giả! Bạn có thể sử dụng miễn phí. Tuy nhiên, bạn cần sử dụng lại mã này theo Quy tắc nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?

Thông báo miễn trừ trách nhiệm