MARKET STRUCTURE GATE Trading Guide
Last updated: July 22, 2026
The Market Structure Gate is a quantitative technical analysis tool. Market Structure Gate A non-repainting market-state and entry-permission overlay: 1. Confirms external pivots only after swingLen closed bars.
What does the indicator show?
- Market Structure & Momentum: Visualizes prevailing trend directions and key reversal zones.
- BUY / SELL Signals: Highlights confirmed entry and exit opportunities based on quantitative rules.
- Dynamic Boundaries: Provides adaptive levels for managing trade risk and reward expectations.
Key Settings
- Swing Length (
swingLen): Controls the calculation period and sensitivity for market detection. - ATR Length (
atrLen): Controls the calculation period and sensitivity for market detection. - Trend EMA Length (
trendEmaLen): Controls the calculation period and sensitivity for market detection. - Break Buffer (x ATR) (
breakBufferAtr): Controls the calculation period and sensitivity for market detection. - Min Break Body (x ATR) (
minBodyAtr): Controls the calculation period and sensitivity for market detection. - Min Impulse (x ATR) (
minImpulseAtr): Controls the calculation period and sensitivity for market detection. - Min Pullback Depth (
minPullback): Controls the calculation period and sensitivity for market detection. - Max Pullback Depth (
maxPullback): Controls the calculation period and sensitivity for market detection. - Micro BOS Lookback (
microBreakBars): Controls the calculation period and sensitivity for market detection. - Max Setup Bars (
maxSetupBars): Controls the calculation period and sensitivity for market detection. - Require Premium / Discount Touch (
requirePdTouch): Controls the calculation period and sensitivity for market detection. - Min Entry Location (
minEntryLocation): Controls the calculation period and sensitivity for market detection. - Max EMA Extension (x ATR) (
maxExtensionAtr): Controls the calculation period and sensitivity for market detection. - Min Target Room (x ATR) (
minTargetRoomAtr): Controls the calculation period and sensitivity for market detection. - Min Risk / Reward (
minRiskReward): Controls the calculation period and sensitivity for market detection. - Stop Buffer (x ATR) (
stopBufferAtr): Controls the calculation period and sensitivity for market detection. - Require Liquidity Sweep (
requireSweep): Controls the calculation period and sensitivity for market detection. - Sweep Lookback (
sweepLookback): Controls the calculation period and sensitivity for market detection. - Require FVG Displacement (
requireFvg): Controls the calculation period and sensitivity for market detection. - Require Volume Impulse (
requireVolume): Controls the calculation period and sensitivity for market detection. - Volume EMA Length (
volumeLen): Controls the calculation period and sensitivity for market detection. - Min Volume Ratio (
minVolumeRatio): Controls the calculation period and sensitivity for market detection. - Entry Active Bars (
signalHoldBars): Controls the calculation period and sensitivity for market detection. - Show State Background (
showBackground): Controls the calculation period and sensitivity for market detection. - Show Pullback Zones (
showZones): Controls the calculation period and sensitivity for market detection. - Show Structure Levels (
showStructure): Controls the calculation period and sensitivity for market detection. - Show Signals (
showSignals): Controls the calculation period and sensitivity for market detection. - Show Status Panel (
showPanel): Controls the calculation period and sensitivity for market detection. - Show Trend EMA (
showEma): Controls the calculation period and sensitivity for market detection. - Market State (-2..2) (
marketState): Controls the calculation period and sensitivity for market detection. - Action State (-2..2) (
actionState): Controls the calculation period and sensitivity for market detection. - Long Allowed (
longAllowed): Controls the calculation period and sensitivity for market detection. - Short Allowed (
shortAllowed): Controls the calculation period and sensitivity for market detection. - Long Armed (
longArmed): Controls the calculation period and sensitivity for market detection. - Short Armed (
shortArmed): Controls the calculation period and sensitivity for market detection. - Long Entry Active (
longEntryActive): Controls the calculation period and sensitivity for market detection. - Short Entry Active (
shortEntryActive): Controls the calculation period and sensitivity for market detection. - Entry Quality (
entryQuality): Controls the calculation period and sensitivity for market detection. - Risk / Reward (
riskReward): Controls the calculation period and sensitivity for market detection. - Target Room (ATR) (
targetRoomAtr): Controls the calculation period and sensitivity for market detection. - Pullback Depth (
pullbackDepth): Controls the calculation period and sensitivity for market detection. - Entry Location (
entryLocation): Controls the calculation period and sensitivity for market detection. - Deny Reason Code (
denyReason): Controls the calculation period and sensitivity for market detection. - Trend EMA (
trendEma): Controls the calculation period and sensitivity for market detection. - ATR (
atr): Controls the calculation period and sensitivity for market detection. - Broken Structure Level (
brokenLevel): Controls the calculation period and sensitivity for market detection. - Suggested Stop (
stopLevel): Controls the calculation period and sensitivity for market detection. - Suggested Target (
targetLevel): Controls the calculation period and sensitivity for market detection. - Market State (-2 Down, 0 Range, 2 Up) (
marketState): Controls the calculation period and sensitivity for market detection. - Action State (
actionState): Controls the calculation period and sensitivity for market detection. - Long Context (
longBias): Controls the calculation period and sensitivity for market detection. - Short Context (
shortBias): Controls the calculation period and sensitivity for market detection. - Long Allowed Now (
longAllowed): Controls the calculation period and sensitivity for market detection. - Short Allowed Now (
shortAllowed): Controls the calculation period and sensitivity for market detection. - Long Setup Armed (
longArmed): Controls the calculation period and sensitivity for market detection. - Short Setup Armed (
shortArmed): Controls the calculation period and sensitivity for market detection. - Long Entry (Closed Bar) (
longEntry): Controls the calculation period and sensitivity for market detection. - Short Entry (Closed Bar) (
shortEntry): Controls the calculation period and sensitivity for market detection. - Long Entry Active (
longEntryActive): Controls the calculation period and sensitivity for market detection. - Short Entry Active (
shortEntryActive): Controls the calculation period and sensitivity for market detection. - Waiting for Pullback (
waitPullback): Controls the calculation period and sensitivity for market detection. - Waiting for Micro BOS (
waitConfirmation): Controls the calculation period and sensitivity for market detection. - Long Denied: No Chase (
noChaseLong): Controls the calculation period and sensitivity for market detection. - Short Denied: No Chase (
noChaseShort): Controls the calculation period and sensitivity for market detection. - Bullish CHoCH (
bullChoch): Controls the calculation period and sensitivity for market detection. - Bearish CHoCH (
bearChoch): Controls the calculation period and sensitivity for market detection. - Bullish BOS (
bullBos): Controls the calculation period and sensitivity for market detection. - Bearish BOS (
bearBos): Controls the calculation period and sensitivity for market detection. - Entry Quality (0-100) (
entryQuality): Controls the calculation period and sensitivity for market detection. - Risk / Reward (
riskReward): Controls the calculation period and sensitivity for market detection. - Target Room (ATR) (
targetRoomAtr): Controls the calculation period and sensitivity for market detection. - Pullback Depth (
pullbackDepth): Controls the calculation period and sensitivity for market detection. - Entry Location in Impulse (
entryLocation): Controls the calculation period and sensitivity for market detection. - Price in Premium (
isPremium): Controls the calculation period and sensitivity for market detection. - Price in Discount (
isDiscount): Controls the calculation period and sensitivity for market detection. - Deny Reason Code (
denyReason): Controls the calculation period and sensitivity for market detection. - Trend EMA (
trendEma): Controls the calculation period and sensitivity for market detection. - ATR (
atr): Controls the calculation period and sensitivity for market detection. - Broken Structure Level (
brokenLevel): Controls the calculation period and sensitivity for market detection. - Suggested Stop Level (
stopLevel): Controls the calculation period and sensitivity for market detection. - Suggested Target Level (
targetLevel): Controls the calculation period and sensitivity for market detection. - Uptrend (
up): Controls the calculation period and sensitivity for market detection. - Downtrend (
down): Controls the calculation period and sensitivity for market detection. - Transition (
transition): Controls the calculation period and sensitivity for market detection. - Range (
range): Controls the calculation period and sensitivity for market detection. - Bull Pullback Zone (
bullZoneFill): Controls the calculation period and sensitivity for market detection. - Bear Pullback Zone (
bearZoneFill): Controls the calculation period and sensitivity for market detection. - Trend EMA (
ema): Controls the calculation period and sensitivity for market detection. - Long Entry (
entryLong): Controls the calculation period and sensitivity for market detection. - Short Entry (
entryShort): Controls the calculation period and sensitivity for market detection. - No Chase (
noChase): Controls the calculation period and sensitivity for market detection. - Status Panel Background (
panelBg): Controls the calculation period and sensitivity for market detection.
How to use Strategy Parameters (Condition Source)
Within the Strategy Tester module, this indicator can be used both as a direct signal source and as a market-state filter.
1. Signal Events
longEntry- Long Entry (Closed Bar) event signal.shortEntry- Short Entry (Closed Bar) event signal.bullChoch- Bullish CHoCH event signal.bearChoch- Bearish CHoCH event signal.bullBos- Bullish BOS event signal.bearBos- Bearish BOS event signal.
2. Filters and Trade Levels
swingLen- Swing Length value used for structural qualification or thresholds.atrLen- ATR Length value used for structural qualification or thresholds.trendEmaLen- Trend EMA Length value used for structural qualification or thresholds.breakBufferAtr- Break Buffer (x ATR) value used for structural qualification or thresholds.minBodyAtr- Min Break Body (x ATR) value used for structural qualification or thresholds.minImpulseAtr- Min Impulse (x ATR) value used for structural qualification or thresholds.minPullback- Min Pullback Depth value used for structural qualification or thresholds.maxPullback- Max Pullback Depth value used for structural qualification or thresholds.microBreakBars- Micro BOS Lookback value used for structural qualification or thresholds.maxSetupBars- Max Setup Bars value used for structural qualification or thresholds.requirePdTouch- Require Premium / Discount Touch value used for structural qualification or thresholds.minEntryLocation- Min Entry Location value used for structural qualification or thresholds.maxExtensionAtr- Max EMA Extension (x ATR) value used for structural qualification or thresholds.minTargetRoomAtr- Min Target Room (x ATR) value used for structural qualification or thresholds.minRiskReward- Min Risk / Reward value used for structural qualification or thresholds.stopBufferAtr- Stop Buffer (x ATR) value used for structural qualification or thresholds.requireSweep- Require Liquidity Sweep value used for structural qualification or thresholds.sweepLookback- Sweep Lookback value used for structural qualification or thresholds.requireFvg- Require FVG Displacement value used for structural qualification or thresholds.requireVolume- Require Volume Impulse value used for structural qualification or thresholds.volumeLen- Volume EMA Length value used for structural qualification or thresholds.minVolumeRatio- Min Volume Ratio value used for structural qualification or thresholds.signalHoldBars- Entry Active Bars value used for structural qualification or thresholds.showBackground- Show State Background value used for structural qualification or thresholds.showZones- Show Pullback Zones value used for structural qualification or thresholds.showStructure- Show Structure Levels value used for structural qualification or thresholds.showSignals- Show Signals value used for structural qualification or thresholds.showPanel- Show Status Panel value used for structural qualification or thresholds.showEma- Show Trend EMA value used for structural qualification or thresholds.marketState- Market State (-2..2) value used for structural qualification or thresholds.actionState- Action State (-2..2) value used for structural qualification or thresholds.longAllowed- Long Allowed value used for structural qualification or thresholds.shortAllowed- Short Allowed value used for structural qualification or thresholds.longArmed- Long Armed value used for structural qualification or thresholds.shortArmed- Short Armed value used for structural qualification or thresholds.longEntryActive- Long Entry Active value used for structural qualification or thresholds.shortEntryActive- Short Entry Active value used for structural qualification or thresholds.entryQuality- Entry Quality value used for structural qualification or thresholds.riskReward- Risk / Reward value used for structural qualification or thresholds.targetRoomAtr- Target Room (ATR) value used for structural qualification or thresholds.pullbackDepth- Pullback Depth value used for structural qualification or thresholds.entryLocation- Entry Location value used for structural qualification or thresholds.denyReason- Deny Reason Code value used for structural qualification or thresholds.trendEma- Trend EMA value used for structural qualification or thresholds.atr- ATR value used for structural qualification or thresholds.brokenLevel- Broken Structure Level value used for structural qualification or thresholds.stopLevel- Suggested Stop value used for structural qualification or thresholds.targetLevel- Suggested Target value used for structural qualification or thresholds.marketState- Market State (-2 Down, 0 Range, 2 Up) value used for structural qualification or thresholds.actionState- Action State value used for structural qualification or thresholds.longBias- Long Context value used for structural qualification or thresholds.shortBias- Short Context value used for structural qualification or thresholds.longAllowed- Long Allowed Now value used for structural qualification or thresholds.shortAllowed- Short Allowed Now value used for structural qualification or thresholds.longArmed- Long Setup Armed value used for structural qualification or thresholds.shortArmed- Short Setup Armed value used for structural qualification or thresholds.longEntryActive- Long Entry Active value used for structural qualification or thresholds.shortEntryActive- Short Entry Active value used for structural qualification or thresholds.waitPullback- Waiting for Pullback value used for structural qualification or thresholds.waitConfirmation- Waiting for Micro BOS value used for structural qualification or thresholds.noChaseLong- Long Denied: No Chase value used for structural qualification or thresholds.noChaseShort- Short Denied: No Chase value used for structural qualification or thresholds.entryQuality- Entry Quality (0-100) value used for structural qualification or thresholds.riskReward- Risk / Reward value used for structural qualification or thresholds.targetRoomAtr- Target Room (ATR) value used for structural qualification or thresholds.pullbackDepth- Pullback Depth value used for structural qualification or thresholds.entryLocation- Entry Location in Impulse value used for structural qualification or thresholds.isPremium- Price in Premium value used for structural qualification or thresholds.isDiscount- Price in Discount value used for structural qualification or thresholds.denyReason- Deny Reason Code value used for structural qualification or thresholds.trendEma- Trend EMA value used for structural qualification or thresholds.atr- ATR value used for structural qualification or thresholds.brokenLevel- Broken Structure Level value used for structural qualification or thresholds.stopLevel- Suggested Stop Level value used for structural qualification or thresholds.targetLevel- Suggested Target Level value used for structural qualification or thresholds.
Strategy Example: Enter Long when buySignal is true and trendFilter == 1, ensuring trades align with dominant momentum.