Pivot Rider Strategy

In this trading algorithm, three levels of confirmation for trade entry are used:
- The script waits for the formation of a certain number of candles after the potential pivot to confirm its significance.
- It checks the compliance of the trade direction with the current local trend, determined based on rising or falling highs or lows, in order to reduce the probability of opening positions against the market.
- It requires increased volume, since true pivots are often accompanied by high volumes.
In the strategy, two modes of exit from a position are implemented.
Main Components of the Trading Algorithm ⚙️
1. Pivot Points
Pivot points show places on the chart where the price either reverses or slows down.
Two types of pivots are used:
- Pivot High (PH) — local maximum
- Pivot Low (PL) — local minimum
Pivots are divided into left and right shoulders.
Left Shoulders (Left Length)
Determine how many bars before the potential pivot must confirm its formation.
- For Pivot High: all bars in the left shoulder must have lower highs.
- For Pivot Low: all bars in the left shoulder must have higher lows.
Default: leftLenH = 3, leftLenL = 3
Right Shoulders (Right Length)
Determine how many bars after the pivot confirm its formation.
- For Pivot High: all bars in the right shoulder must have lower highs.
- For Pivot Low: all bars in the right shoulder must have higher lows.
Default: rightLenH = 3, rightLenL = 6
Why Different Numbers of Bars for Highs and Lows? 🤔
Market psychology: downward moves are usually sharper → more confirmations for lows.
Significance confirmation: more right bars for lows increase probability of a real "bottom".
Stricter trade conditions reduce both the number of trades and the probability of false signals.
How Trading Signals Are Formed
Long Entry:
- The script finds a peak high (the highest candle among 3 left candles).
- Waits for confirmation — 3 right candles pass, all below the high.
- HH level is set — this becomes the reference price.
- Potential long entry: price closes ABOVE this HH level.
Short Entry:
- The script finds a peak low (the lowest candle among 3 left candles).
- Waits for confirmation — 6 right candles pass, all above the low.
- LL level is set — this becomes the reference price.
- Potential short entry: price closes BELOW this LL level.
Chart Display 🎨
- Confirmed HH: green lines
- Confirmed LL: red lines
- HL: brown
- LH: blue
📌 At trade entry, labels appear:
- “Long Pivot Ride” for long trades
- “Short Pivot Ride” for short trades
Practical Application
- Active markets: reduce shoulders (e.g., 2-2) → more signals
- Calm markets: increase shoulders (4-5) → only important levels
- Trending instruments: use asymmetric settings (default in strategy)
Default sources: Pivot High = High, Pivot Low = Low
The correct combination of left and right pivots filters noise and shows potential entry/exit points.
2. Trend Filter 📊
Signal filtering based on market structure.
Rising highs/lows → uptrend; falling highs/lows → downtrend.
Without trend filter, the script would open trades at every breakout, causing false signals in flat markets.
Background: green = uptrend, red = downtrend
3. Volume Filter 🔊
- Filters weak signals caused by minor price fluctuations.
- Calculates average volume (last 10 candles by default).
- Checks volume at breakout against threshold (default 1.5×).
- Ensures breakout has "energy," indicating real market movement.
4. Exit from Position 🚪
Main mode: stay in position until opposite conditions arise → then close and open new.
Exit on opposite pivot (ignore volume/trend): close immediately when opposite pivot forms.
Choice of exit mode depends on market conditions.
Pivot Rider Strategy Settings ⚙️
Pivot Settings:
- Pivot High Source: high
- Pivot Low Source: low
- Left Pivot High: 3
- Right Pivot High: 3
- Left Pivot Low: 3
- Right Pivot Low: 6
Trend Filter:
- Use Trend Filter: true
- Bars for Trend Analysis: 7
Volume Filter:
- Use Volume Filter: true
- Volume Lookback Period: 10
- Volume Multiplier Threshold: 1.5
Exit Settings:
Exit on Opposite Pivot: false
Trading Parameters:
- Initial Capital: $10,000
- Default Quantity: $100
- Commission: 0.1%
- Slippage: 2 ticks
Note: Funding is not accounted for. On different exchanges, it may vary and affect results.
Backtest Results 📑
Optimized for 4H timeframe, GALAUSDT. Can be used on other assets/timeframes, must be optimized.
Disclaimer ⚠️
- Backtest results may not repeat.
- Market unpredictable; use at your own risk.
- Author not responsible for losses, exchange malfunctions, or platform issues.
Recommended: do not trade <1H timeframe, low-liquidity assets, or risk >1% capital.
Do not perceive this strategy as the Holy Grail. This script is merely a trader’s tool for backtesting a specific trading algorithm on any assets and timeframes to make more informed trading decisions, as well as automating trading using the TradingView platform.
Tập lệnh chỉ hiển thị cho người được mời
Chỉ những người dùng được tác giả đồng ý mới có thể truy cập tập lệnh này. Bạn cần yêu cầu và xin phép sử dụng tập lệnh này. Quyền truy cập thường được cấp sau khi thanh toán. Để biết thêm chi tiết, hãy làm theo hướng dẫn của tác giả bên dưới hoặc liên hệ trực tiếp với Script_Algo.
TradingView KHÔNG khuyến khích trả tiền hoặc sử dụng tập lệnh trừ khi bạn hoàn toàn tin tưởng tác giả và hiểu cách hoạt động của tập lệnh. Bạn cũng có thể tìm thấy các giải pháp thay thế miễn phí, mã nguồn mở trong mục tập lệnh cộng đồng của chúng tôi.
Hướng dẫn của tác giả
Thông báo miễn trừ trách nhiệm
Tập lệnh chỉ hiển thị cho người được mời
Chỉ những người dùng được tác giả đồng ý mới có thể truy cập tập lệnh này. Bạn cần yêu cầu và xin phép sử dụng tập lệnh này. Quyền truy cập thường được cấp sau khi thanh toán. Để biết thêm chi tiết, hãy làm theo hướng dẫn của tác giả bên dưới hoặc liên hệ trực tiếp với Script_Algo.
TradingView KHÔNG khuyến khích trả tiền hoặc sử dụng tập lệnh trừ khi bạn hoàn toàn tin tưởng tác giả và hiểu cách hoạt động của tập lệnh. Bạn cũng có thể tìm thấy các giải pháp thay thế miễn phí, mã nguồn mở trong mục tập lệnh cộng đồng của chúng tôi.