Tradehook — Trading Automation Service
lowTechnical Indicator

CloseFlipAlgo

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.

TradingView Preview
See this algorithm in action on real charts
CloseFlipAlgo TradingView chart
Performance Metrics
Historical backtesting results
53.4%
Win Rate
1.28
Profit Factor
15.4%
Max Drawdown
$250
Avg Trade
Based on 442 trades

About This Algorithm

CLOSE POSITION FLIP STRATEGY

Quick Facts:

  • Category: Momentum Reversal
  • Markets: All liquid markets
  • Timeframes: 5min, 15min, 1H

Overview

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.


How It Works

CONSECUTIVE CLOSE TRACKING The algorithm monitors closing direction:

  • bullishClose = Close > Open
    • bearishClose = Close < Open
    • consecutiveBullish counter for consecutive up closes
    • consecutiveBearish counter for consecutive down closes

FLIP DETECTION A "flip" occurs when:

  • Bullish Flip: N consecutive bearish closes followed by bullish close
    • Bearish Flip: N consecutive bullish closes followed by bearish close
    • minConsecutive parameter controls the threshold

MOMENTUM CONFIRMATION Optional filters ensure the flip is significant:

  • Minimum flip bar size (ATR-based)
    • Volume spike on flip bar
    • VMAlgo confirmation

Key Parameters

FLIP DETECTION:

  • minConsecutive (3): Minimum consecutive closes before flip
    • maxConsecutive (7): Maximum lookback for sequence
    • minFlipBodyATR (0.5): Minimum flip bar body as ATR ratio

VOLUME FILTER:

  • useVolumeFilter (true): Require volume confirmation
    • volumeMultiplier (1.3): Minimum volume spike on flip

Best Use Cases

✅ EXHAUSTION REVERSALS after extended moves ✅ MEAN REVERSION at overbought/oversold levels ✅ SCALPING momentum shifts ✅ CONFIRMATION for other reversal signals

Customer Reviews

No reviews yet. Be the first to review this algorithm!
Technical Indicator
Requires Technical Indicator Plan

Subscribe to Technical Indicator or higher to access

Subscription Access

Get access to this indicator/strategy on TradingView through our invite-only system. Your TradingView account will be granted access.

One-Time Purchase

Own the complete Pine Script source code forever. Modify, customize, and use it on your own TradingView account.

$1,500
Subscribe to any tier to unlock one-time purchases

What you get with source code:

  • Complete Pine Script v5 source code
  • Lifetime ownership - no recurring fees
  • Full customization rights
  • Use on your own TradingView account
PlatformTradingView
Subscription AccessTradingView Invite
One-Time PurchaseSource Code
LicensePersonal Use

We Value Your Privacy

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.