OPEN-SOURCE SCRIPT
CSS Reversal - VA

This indicator identifies a price action reversal pattern known as CSS (Candle Stop Setup). Unlike standard 3-candle patterns, this logic is dynamic and "hunts" for the true peak or valley before confirming a shift in momentum.
Core Logic & Rules
The script follows a specific sequence of "Initiation, Waiting, and Triggering" to ensure it captures high-probability reversals:
1. Initiation (The Sweep): The process starts when a candle (the Pivot) sweeps the liquidity of the previous candle.
Bearish: Candle 2 makes a higher high than Candle 1.
Bullish: Candle 2 makes a lower low than Candle 1.
2. Identifying the Extreme: The script tracks the absolute highest high (for bearish) or lowest low (for bullish) during the setup. If a subsequent candle goes higher/lower without triggering a close, the "mark" moves to that new extreme candle.
3. The Waiting Room (Inside Bars): The setup remains active even if several candles follow that do not break out of the Pivot's range. The script can wait indefinitely (e.g., 3, 4, or 5+ candles) as long as the original extreme is not breached.
4. The Trigger (The Confirmation): A signal is only confirmed when a candle closes past the opposite side of the extreme candle's body.
Bearish Trigger: A candle closes below the Low of the highest candle.
Bullish Trigger: A candle closes above the High of the lowest candle.
5. Retrospective Marking: Once the trigger close occurs, the script automatically places a visual marker (arrow) on the actual extreme candle (the peak or valley), even if that candle occurred several bars ago.
Visual Indicators
Red Arrow (↓): Placed at the high of the highest candle in a confirmed bearish reversal.
Green Arrow (↑): Placed at the low of the lowest candle in a confirmed bullish reversal.
Use Cases
This script is designed for traders who look for Liquidity Sweeps and Market Structure Shifts. It filters out "fake" reversals where price merely wicks past a level without a solid closing confirmation, and it specifically accounts for "inside bar" periods where price consolidates before making its move.
Core Logic & Rules
The script follows a specific sequence of "Initiation, Waiting, and Triggering" to ensure it captures high-probability reversals:
1. Initiation (The Sweep): The process starts when a candle (the Pivot) sweeps the liquidity of the previous candle.
Bearish: Candle 2 makes a higher high than Candle 1.
Bullish: Candle 2 makes a lower low than Candle 1.
2. Identifying the Extreme: The script tracks the absolute highest high (for bearish) or lowest low (for bullish) during the setup. If a subsequent candle goes higher/lower without triggering a close, the "mark" moves to that new extreme candle.
3. The Waiting Room (Inside Bars): The setup remains active even if several candles follow that do not break out of the Pivot's range. The script can wait indefinitely (e.g., 3, 4, or 5+ candles) as long as the original extreme is not breached.
4. The Trigger (The Confirmation): A signal is only confirmed when a candle closes past the opposite side of the extreme candle's body.
Bearish Trigger: A candle closes below the Low of the highest candle.
Bullish Trigger: A candle closes above the High of the lowest candle.
5. Retrospective Marking: Once the trigger close occurs, the script automatically places a visual marker (arrow) on the actual extreme candle (the peak or valley), even if that candle occurred several bars ago.
Visual Indicators
Red Arrow (↓): Placed at the high of the highest candle in a confirmed bearish reversal.
Green Arrow (↑): Placed at the low of the lowest candle in a confirmed bullish reversal.
Use Cases
This script is designed for traders who look for Liquidity Sweeps and Market Structure Shifts. It filters out "fake" reversals where price merely wicks past a level without a solid closing confirmation, and it specifically accounts for "inside bar" periods where price consolidates before making its move.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.