The CloseFlip Algorithm detects rapid sentiment reversals by monitoring consecutive closes in one direction followed by a flip in the opposite direction. This pattern captures the moment when buyers or sellers exhaust themselves and momentum shifts.

Quick Facts:
The CloseFlip Algorithm detects rapid sentiment reversals by monitoring consecutive closes in one direction followed by a flip in the opposite direction. This pattern captures the moment when buyers or sellers exhaust themselves and momentum shifts.
When price closes in the same direction for N consecutive bars, market participants become stretched. A sudden flip in closing direction signals capitulation and potential reversal opportunity.
CONSECUTIVE CLOSE TRACKING The algorithm monitors closing direction:
FLIP DETECTION A "flip" occurs when:
MOMENTUM CONFIRMATION Optional filters ensure the flip is significant:
FLIP DETECTION:
VOLUME FILTER:
✅ EXHAUSTION REVERSALS after extended moves ✅ MEAN REVERSION at overbought/oversold levels ✅ SCALPING momentum shifts ✅ CONFIRMATION for other reversal signals
Subscribe to Technical Indicator or higher to access
Own the complete Pine Script source code forever. Modify, customize, and use it on your own TradingView account.
What you get with source code:
We use cookies to enhance your browsing experience, analyze site traffic, and personalize content. By clicking "Accept All", you consent to our use of cookies. Read our Privacy Policy for more information.