Market Gravity

Market Gravity

Market Gravity is an advanced liquidity and market-gravity indicator for MetaTrader 5. It identifies important liquidity pools, evaluates their strength and accessibility, and ranks the most significant upside and downside price levels.

The indicator helps traders understand where price may be attracted, rejected, swept, or accepted. It combines swing analysis, equal highs and lows, rejection structures, previous-day levels, previous-week levels, ATR-based zones, trend conditions, volume evidence, and liquidity ageing into one visual dashboard.

Main Features

  • Detects swing highs and swing lows as potential liquidity levels.
  • Identifies equal highs and equal lows.
  • Detects major isolated swings using ATR-based significance.
  • Recognizes repeated rejection structures.
  • Tracks previous-day high and low.
  • Tracks previous-week high and low.
  • Groups nearby liquidity levels into zones using ATR-based clustering.
  • Calculates a Liquidity Strength score from 0 to 100.
  • Calculates a dynamic Gravity score from 0 to 100.
  • Ranks the primary, secondary, and tertiary liquidity levels on both sides of price.
  • Classifies each liquidity pool as Forming, Active, Approaching, Sweeping, Rejected, Accepted, or Retired.
  • Displays bullish and bearish market-gravity pressure in a dashboard.
  • Shows price levels using color-coded horizontal lines and optional glow effects.
  • Marks lifecycle events such as liquidity sweeps, rejections, and acceptance.
  • Provides optional popup and push alerts.
  • Uses ATR, EMA, ADX, relative volume, distance, freshness, and market regime information to adjust the gravity calculation.
  • Supports customizable colors, dashboard position, level visibility, zone width, detection sensitivity, and alert thresholds.

How to Use

Market Gravity displays the strongest liquidity levels above and below the current market price.

  • Primary Up: The highest-ranked liquidity target above the current price.
  • Secondary Up: The second-ranked upside liquidity level.
  • Tertiary Up: The third-ranked upside liquidity level.
  • Primary Down: The highest-ranked liquidity target below the current price.
  • Secondary Down: The second-ranked downside liquidity level.
  • Tertiary Down: The third-ranked downside liquidity level.

The dashboard shows the current Net Gravity value together with the estimated bullish and bearish pressure. Positive Net Gravity indicates stronger upside liquidity pressure, while negative Net Gravity indicates stronger downside liquidity pressure.

Liquidity levels should be used as decision-support information rather than as standalone entry or exit signals. Always combine the indicator with your trading plan, risk-management rules, market context, and confirmation from price action.

Input Parameters

Liquidity Detection

  • InpPivotLeft : Number of candles to the left used for swing confirmation.
  • InpPivotRight : Number of candles to the right required to confirm a swing.
  • InpClusterATR : ATR-based tolerance used to group nearby liquidity levels.
  • InpSweepATR : ATR buffer used to determine whether a level has been swept.
  • InpMaxAgeBars : Maximum age of a liquidity pool before it is removed.
  • InpMaxStoredLevels : Maximum number of stored liquidity pools per side.

Liquidity Sources

  • InpUseSwing : Enables swing-high and swing-low detection.
  • InpUseEqual : Enables equal-high and equal-low detection.
  • InpEqualTolATR : ATR tolerance for identifying equal highs and lows.
  • InpUseMajorSwing : Enables detection of major isolated swings.
  • InpMajorSwingATR : Minimum ATR-based movement required to classify a swing as major.
  • InpUsePrevDay : Enables previous-day high and low levels.
  • InpUsePrevWeek : Enables previous-week high and low levels.
  • InpUseRejection : Enables repeated rejection-structure detection.
  • InpRejectionWickRatio : Minimum wick-to-range ratio required for a rejection structure.
  • InpRejectionSeparation : Minimum candle separation between repeated rejection structures.
  • InpRecentPivotMemory : Number of recent pivots retained for equal-level and rejection analysis.

Pool Engine

  • InpTouchSeparationBars : Minimum distance between independent touches of the same liquidity pool.
  • InpZonePaddingATR : ATR padding added around clustered liquidity levels.
  • InpIsolatedHalfWidthATR : Half-width of zones formed from isolated levels.
  • InpMaxZoneWidthATR : Maximum permitted liquidity-zone width in ATR units.

Gravity Model

  • InpATRLength : ATR calculation period.
  • InpFastEMALength : Fast EMA period used for trend analysis.
  • InpSlowEMALength : Slow EMA period used for trend analysis.
  • InpRelVolumeLength : Lookback period used to calculate relative volume.
  • InpApproachingATR : Distance in ATR units used to classify an approaching liquidity level.
  • InpRankWeight1 : Weight assigned to the primary level.
  • InpRankWeight2 : Weight assigned to the secondary level.
  • InpRankWeight3 : Weight assigned to the tertiary level.
  • InpAccessibilityK : Controls how distance affects liquidity accessibility.
  • InpHalfLifeSwing : Freshness half-life for ordinary swing liquidity.
  • InpHalfLifeCluster : Freshness half-life for clustered liquidity.
  • InpHalfLifePrevDay : Freshness half-life for previous-day liquidity.
  • InpHalfLifePrevWeek : Freshness half-life for previous-week liquidity.

Liquidity Lifecycle

  • InpActiveStrengthThresh : Minimum Liquidity Strength required for an active pool.
  • InpRejectionWindowBars : Number of candles used to confirm rejection after a sweep.
  • InpAcceptanceCloseCount : Number of closes beyond a liquidity zone required for acceptance.
  • InpResolvedHoldBars : Number of candles a resolved level remains visible before retirement.

Display

  • InpLevelsPerSide : Number of ranked levels displayed above and below price.
  • InpLineHistoryBars : Maximum historical length of level lines.
  • InpShowGlow : Enables or disables glow lines.
  • InpShowTable : Enables or disables the dashboard.
  • InpShowLifecycleEvents : Displays sweep, rejection, and acceptance markers.
  • InpTablePosition : Sets the dashboard corner.

Alerts

  • InpEnableAlerts : Enables or disables alerts.
  • InpPrimaryGravityAlert : Gravity score required for a high-primary-gravity alert.
  • InpNetGravityAlert : Net Gravity value required for a strong directional alert.
  • InpAlertPopup : Enables terminal popup alerts.
  • InpAlertPush : Enables MetaTrader push notifications.

Colors

  • InpBullColor : Color used for bullish or accepted upside liquidity.
  • InpBearColor : Color used for bearish or accepted downside liquidity.
  • InpNeutralColor : Color used for neutral dashboard information.
  • InpGlowBullColor : Glow color for bullish levels.
  • InpGlowBearColor : Glow color for bearish levels.

Important Notice

Market Gravity is an analytical indicator and does not guarantee profitable results. Liquidity levels can be invalidated by news events, volatility expansion, spread changes, and unexpected market conditions. Test the indicator on historical and demo accounts before using it in live trading, and apply appropriate risk management.

The description above is based on the indicator’s implemented liquidity detection, pool-management, gravity-ranking, lifecycle, dashboard, drawing, and alert features. 


More from author
Psyche 16 Gold EA
Jeannot Desire Ofori
Psyche 16 Gold EA — One Shot Strategy for XAUUSD M15 Psyche 16 Gold EA is an automated Expert Advisor for MetaTrader 5, designed exclusively for XAUUSD on the M15 timeframe. It is built around Smart Money Concepts — a framework of market analysis focused on institutional order flow, including order blocks, breaks of structure, and fair value gaps. The system does not use martingale, grid, averaging, or any position-recovery technique. Every trade is independent, with a defined stop loss and tak
FREE
Chart Wizard
Jeannot Desire Ofori
5 (1)
This all-in-one indicator displays real-time market structure (internal & swing BOS / CHoCH), order blocks, premium & discount zones, equal highs & lows, and much more...allowing traders to automatically mark up their charts with widely used price action methodologies. Following the release of our Fair Value Gap script, we received numerous requests from our community to release more features in the same category. "Smart Money Concepts" (SMC) is a fairly new yet widely used term amongst price
FREE
The Day Trader
Jeannot Desire Ofori
Day Trader EA — XAUUSD Range Breakout System Day Trader EA is a fully automated Gold (XAUUSD) trading robot built around two range-breakout setups: the Day's Range and the 52-Week Range. Entries are momentum-candle breakouts, filtered by an internal directional bias engine so the EA only takes trades in the direction the market is already favoring. Built for small accounts and prop firm rules The EA was designed with strict risk limits in mind, not just win rate. Risk controls include: Fixed ris
Filter:
No reviews
Reply to review