🔓 Get All Tools for FREE!
- ✅ Click here to open a trading account using our referral link and start trading.
- 📅 After 7 days of active trading under our referral link, you can get access to all tools in your account.
- ⚠️ Keep trading to keep access free — if you're inactive for 7 days, your access will be removed.
- 👉 Already have an account? You can change the IB (introducing broker) to our referral link ( https://one.exnesstrack.org/a/w7syl3vnjb ) and still qualify!
Pivot Breakout + Retest BUY/SELL Indicator [algo_aakash] | Advanced Pivot Point Strategy
Pivot Points are one of the most powerful support and resistance tools used by professional traders to identify potential breakout zones and reversal levels. In this TradingView Pine Script indicator, we combine Pivot Point breakout detection with retest confirmation to generate high-probability BUY and SELL signals directly on the chart.
Instead of entering immediately after a breakout, this strategy waits for a proper retest of the pivot level before generating a signal, helping traders avoid many false breakouts and improve entry accuracy.
Understanding the Pivot Breakout Retest Strategy
Traditional breakout strategies often suffer from fake breakouts where price quickly reverses after crossing a key level. This indicator solves that problem by using a Breakout + Retest confirmation system.
🔓 Get All Tools for FREE!
- ✅ Click here to open a trading account using our referral link and start trading.
- 📅 After 7 days of active trading under our referral link, you can get access to all tools in your account.
- ⚠️ Keep trading to keep access free — if you're inactive for 7 days, your access will be removed.
- 👉 Already have an account? You can change the IB (introducing broker) to our referral link ( https://one.exnesstrack.org/a/w7syl3vnjb ) and still qualify!
The strategy calculates classic pivot levels:
- Pivot Point
- R1 & R2 Resistance Levels
- S1 & S2 Support Levels
The indicator then tracks:
- Price breakout above or below pivot levels
- Retest of the broken level
- Confirmation candle close
- BUY or SELL signal generation
This creates a cleaner and more reliable trading setup.
How the Indicator Works
BUY Signal Logic
A BUY signal appears when:
- Price breaks above Pivot, R1, or R2
- Market retests the broken level
- Price closes back above the level within the retest window
SELL Signal Logic
A SELL signal appears when:
- Price breaks below Pivot, S1, or S2
- Market retests the broken level
- Price closes back below the level
This confirms bearish momentum continuation.
Indicator Features
✅ Automatic BUY & SELL Signals
✅ Pivot Breakout Detection
✅ Smart Retest Confirmation
✅ Dynamic Pivot Levels
✅ Support & Resistance Zones
✅ TradingView Alerts Included
✅ Works on Forex, Crypto & Stocks
✅ Multi-Timeframe Compatible
Pivot Levels Included
The indicator automatically plots:
- Main Pivot Point
- R1 Resistance
- R2 Resistance
- S1 Support
- S2 Support
These levels help traders identify:
- Trend continuation areas
- Reversal zones
- Breakout opportunities
- Key support/resistance regions
Best Timeframes
This strategy works especially well on:
- 5 Min → Scalping
- 15 Min → Intraday Trading
- 1 Hour → Swing Trading
- 4 Hour → Trend Trading
You can also switch pivot calculations between:
- Daily Pivots
- Weekly Pivots
- Monthly Pivots
Risk Management Tips
For better results:
- Use stop loss below retest candle lows/highs
- Trade in the direction of the higher timeframe trend
- Avoid low-volume sideways markets
- Combine with EMA or RSI confirmation
Conclusion
This Pivot Breakout + Retest strategy provides a powerful way to trade market structure using confirmed breakout entries instead of risky early breakouts. By combining classic pivot points with retest confirmation logic, traders can identify cleaner trend continuation opportunities with reduced false signals.
Whether you trade Forex, Crypto, or Stocks, this indicator offers a professional approach to breakout trading directly inside TradingView.
#PineScript #TradingView #PivotPoints #BreakoutStrategy #RetestStrategy #SupportResistance #AlgoTrading #ForexTrading #CryptoTrading #algo_aakash
//@version=5
indicator("Pivot Breakout + Retest BUY/SELL", overlay=true)
// =====================================================
// USER SETTINGS
// =====================================================
pivotTimeframe = input.string("D", "Pivot Timeframe", options=["D", "W", "M"])
retestBars = input.int(5, "Retest Window (Candles)", minval=1)
// =====================================================
// CLASSIC PIVOT POINT CALCULATION
// =====================================================
// Previous timeframe OHLC
prevHigh = request.security(syminfo.tickerid, pivotTimeframe, high[1])
prevLow = request.security(syminfo.tickerid, pivotTimeframe, low[1])
prevClose = request.security(syminfo.tickerid, pivotTimeframe, close[1])
// Classic Pivot Formula
pivot = (prevHigh + prevLow + prevClose) / 3
r1 = (2 * pivot) - prevLow
s1 = (2 * pivot) - prevHigh
r2 = pivot + (prevHigh - prevLow)
s2 = pivot - (prevHigh - prevLow)
// =====================================================
// PLOT PIVOT LEVELS
// =====================================================
plot(pivot, title="Pivot", color=color.yellow, linewidth=2)
plot(r1, title="R1", color=color.green, linewidth=2)
plot(r2, title="R2", color=color.lime, linewidth=2)
plot(s1, title="S1", color=color.red, linewidth=2)
plot(s2, title="S2", color=color.maroon, linewidth=2)
// =====================================================
// BREAKOUT + RETEST LOGIC
// =====================================================
// ---------- BUY SIDE ----------
breakPivotBuy = ta.crossover(close, pivot)
breakR1Buy = ta.crossover(close, r1)
breakR2Buy = ta.crossover(close, r2)
var int pivotBreakBarBuy = na
var int r1BreakBarBuy = na
var int r2BreakBarBuy = na
newSession = ta.change(time(pivotTimeframe))
if newSession
pivotBreakBarBuy := na
r1BreakBarBuy := na
r2BreakBarBuy := na
if breakPivotBuy[1]
pivotBreakBarBuy := bar_index
if breakR1Buy[1]
r1BreakBarBuy := bar_index
if breakR2Buy[1]
r2BreakBarBuy := bar_index
pivotBuyRetest =
not na(pivotBreakBarBuy) and
(bar_index - pivotBreakBarBuy <= retestBars) and
low <= pivot and
close > pivot
r1BuyRetest =
not na(r1BreakBarBuy) and
(bar_index - r1BreakBarBuy <= retestBars) and
low <= r1 and
close > r1
r2BuyRetest =
not na(r2BreakBarBuy) and
(bar_index - r2BreakBarBuy <= retestBars) and
low <= r2 and
close > r2
buySignal = pivotBuyRetest or r1BuyRetest or r2BuyRetest
if buySignal
pivotBreakBarBuy := na
r1BreakBarBuy := na
r2BreakBarBuy := na
// ---------- SELL SIDE ----------
breakPivotSell = ta.crossunder(close, pivot)
breakS1Sell = ta.crossunder(close, s1)
breakS2Sell = ta.crossunder(close, s2)
var int pivotBreakBarSell = na
var int s1BreakBarSell = na
var int s2BreakBarSell = na
if newSession
pivotBreakBarSell := na
s1BreakBarSell := na
s2BreakBarSell := na
if breakPivotSell[1]
pivotBreakBarSell := bar_index
if breakS1Sell[1]
s1BreakBarSell := bar_index
if breakS2Sell[1]
s2BreakBarSell := bar_index
pivotSellRetest =
not na(pivotBreakBarSell) and
(bar_index - pivotBreakBarSell <= retestBars) and
high >= pivot and
close < pivot
s1SellRetest =
not na(s1BreakBarSell) and
(bar_index - s1BreakBarSell <= retestBars) and
high >= s1 and
close < s1
s2SellRetest =
not na(s2BreakBarSell) and
(bar_index - s2BreakBarSell <= retestBars) and
high >= s2 and
close < s2
sellSignal = pivotSellRetest or s1SellRetest or s2SellRetest
if sellSignal
pivotBreakBarSell := na
s1BreakBarSell := na
s2BreakBarSell := na
// BUY & SELL LABELS
plotshape(buySignal, title="BUY Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY", textcolor=color.white, size=size.small)
plotshape(sellSignal, title="SELL Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL", textcolor=color.white, size=size.small)
// ALERT CONDITIONS
alertcondition(buySignal, title="BUY Alert", message="Pivot Retest BUY Signal")
alertcondition(sellSignal, title="SELL Alert", message="Pivot Retest SELL Signal")
0 Comments