OPEN-SOURCE SCRIPT
Sell to Buy / Buy to Sell

Sell to Buy / Buy to Sell — Momentum Shift Detector
The Sell to Buy / Buy to Sell indicator detects simple but powerful two-bar momentum shift patterns directly on your chart, offering early insights into potential reversals or strong breakout continuation.
🔎 How it works:
Sell to Buy (StB):
Previous candle (bar -1) is bearish
Current candle (bar 0) is bullish
The bullish candle closes above the high of the previous bearish candle
Confirmed only after bar close
Buy to Sell (BtS):
Previous candle (bar -1) is bullish
Current candle (bar 0) is bearish
The bearish candle closes below the low of the previous bullish candle
Confirmed only after bar close
🎯 Key Features:
✅ Pure price action logic — no indicators, no oscillators
✅ Immediate visual markers:
Green "StB" label for bullish momentum shifts
Red "BtS" label for bearish momentum shifts
✅ Full alert system to notify you in real-time when either pattern occurs
⚙ Who is this for?
Scalpers looking for short-term momentum shifts
Swing traders identifying potential reversals or breakout confirmations
Price action traders who want clean and objective setup detection
The Sell to Buy / Buy to Sell indicator is designed to give you clear and simple signals whenever the market shows decisive strength after a short-term opposite move — potentially marking the start of a new impulse.
The Sell to Buy / Buy to Sell indicator detects simple but powerful two-bar momentum shift patterns directly on your chart, offering early insights into potential reversals or strong breakout continuation.
🔎 How it works:
Sell to Buy (StB):
Previous candle (bar -1) is bearish
Current candle (bar 0) is bullish
The bullish candle closes above the high of the previous bearish candle
Confirmed only after bar close
Buy to Sell (BtS):
Previous candle (bar -1) is bullish
Current candle (bar 0) is bearish
The bearish candle closes below the low of the previous bullish candle
Confirmed only after bar close
🎯 Key Features:
✅ Pure price action logic — no indicators, no oscillators
✅ Immediate visual markers:
Green "StB" label for bullish momentum shifts
Red "BtS" label for bearish momentum shifts
✅ Full alert system to notify you in real-time when either pattern occurs
⚙ Who is this for?
Scalpers looking for short-term momentum shifts
Swing traders identifying potential reversals or breakout confirmations
Price action traders who want clean and objective setup detection
The Sell to Buy / Buy to Sell indicator is designed to give you clear and simple signals whenever the market shows decisive strength after a short-term opposite move — potentially marking the start of a new impulse.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.