Elijah's FVG + BOS/CHoCH 1:3 Strategy by kuyaelijah

By kuyaelijah

Performance Metrics

Description

# FVG + BOS/CHoCH | Market Structure Trading Strategy## OverviewThis strategy combines **Fair Value Gaps (FVGs), Breaks of Structure (BOS), and Changes of Character (CHoCH)** to identify potential high-probability trading setups based on price action, market structure, and price imbalances.Designed primarily for intraday trading on the **1-minute ES (E-mini S&P 500) and MES (Micro E-mini S&P 500) futures charts**, the strategy waits for a confirmed market structure break, the formation of a qualifying Fair Value Gap, a minimum retracement into the FVG, and a confirming candle close before generating a trade.The strategy incorporates configurable entry filters, automated stop-loss and take-profit placement, adjustable risk-to-reward ratios, automatic breakeven management, trading session filters, real-time alerts, and a built-in performance dashboard.**All major trading parameters are customizable directly through the strategy settings**, allowing traders to experiment with different FVG sizes, mitigation percentages, market structure sensitivities, risk-to-reward ratios, and breakeven triggers.## How the Strategy Works### 1. Market Structure Confirmation (BOS / CHoCH)The strategy identifies confirmed swing highs and swing lows using a configurable pivot lookback.- **Bullish BOS:** Price closes above a confirmed swing high while the market structure trend is bullish.- **Bearish BOS:** Price closes below a confirmed swing low while the market structure trend is bearish.- **Bullish CHoCH:** Price breaks above a confirmed swing high, indicating a potential bullish directional shift.- **Bearish CHoCH:** Price breaks below a confirmed swing low, indicating a potential bearish directional shift.By default, qualifying Fair Value Gaps must form after the most recent confirmed BOS or CHoCH and align with the direction of that structure event.### 2. Fair Value Gap (FVG) IdentificationThe strategy identifies bullish and bearish three-candle Fair Value Gaps and filters them according to their size in ticks.Default settings:- Minimum FVG size: 5 ticks- Maximum FVG size: 10 ticks- Minimum FVG mitigation: 50%The minimum and maximum FVG tick sizes are fully adjustable, allowing traders to filter smaller or larger imbalances depending on market conditions.Each qualifying FVG is monitored until price retraces into the gap by the configured mitigation percentage.### 3. Long (BUY) Entry ConditionsA bullish trade is considered when:1. A bullish BOS or CHoCH has been confirmed.2. A qualifying bullish FVG forms after the structure event.3. Price retraces into the FVG by at least the configured mitigation percentage.4. A candle closes above the upper boundary of the bullish FVG.5. The confirming candle also closes above the active bullish structure level.6. All enabled entry filters and trading session requirements are satisfied.Once these conditions are met, the strategy generates a BUY signal with its corresponding entry, stop-loss, and take-profit levels.### 4. Short (SELL) Entry ConditionsA bearish trade is considered when:1. A bearish BOS or CHoCH has been confirmed.2. A qualifying bearish FVG forms after the structure event.3. Price retraces into the FVG by at least the configured mitigation percentage.4. A candle closes below the lower boundary of the bearish FVG.5. The confirming candle also closes below the active bearish structure level.6. All enabled entry filters and trading session requirements are satisfied.Once these conditions are met, the strategy generates a SELL signal with its corresponding entry, stop-loss, and take-profit levels.## Risk Management### 5. Stop Loss and Take ProfitThe strategy automatically calculates stop-loss and take-profit levels for each trade.**Stop-loss placement:**- Long positions: Low of the middle candle forming the FVG.- Short positions: High of the middle candle forming the FVG.**Take-profit placement:**The default risk-to-reward ratio is **1:3**, meaning the take-profit distance is three times the initial stop-loss distance.The risk-to-reward ratio is fully adjustable through the strategy settings, allowing users to test alternatives such as 1:1, 1:1.5, 1:2, 1:3, or higher.### 6. Automatic Stop Loss to BreakevenThe strategy includes an optional automatic breakeven feature designed to reduce risk after price moves favorably.By default, when price reaches **50% of the distance from entry to take profit**, the stop loss automatically moves to the entry price.For a 1:3 risk-to-reward trade, this occurs at approximately +1.5R.Traders can customize:- The percentage of the take-profit distance required to trigger breakeven.- Whether a wick reaching the trigger is sufficient or a candle must close beyond it.- The number of ticks beyond entry where the breakeven stop is placed.- Whether automatic breakeven management is enabled or disabled.Breakeven adjustments are evaluated at candle close, with the updated stop becoming active on the following bar.## Customizable Strategy SettingsThe strategy provides extensive customization through TradingView's built-in settings panel.| Setting | Default | Customizable ||---|---|---|| Market structure swing length | 5 | Yes || Minimum FVG size | 5 ticks | Yes || Maximum FVG size | 10 ticks | Yes || Minimum FVG mitigation | 50% | Yes || Risk-to-reward ratio | 1:3 | Yes || Automatic breakeven | Enabled | Yes || Breakeven trigger | 50% toward TP | Yes || Breakeven offset | 0 ticks | Yes || Trading session | 8:45–10:45 AM Chicago time | Yes || One trade per FVG | Enabled | Yes || BOS/CHoCH alignment | Enabled | Yes || FVG close confirmation | Enabled | Yes || Structure close confirmation | Enabled | Yes |These adjustable settings allow traders to backtest different configurations without modifying the underlying Pine Script code.## Chart Features and VisualizationsThe strategy includes several visual features to help traders understand market structure, entry conditions, and trade management.- Bullish and bearish FVG boxes with customizable colors.- FVG size displayed directly inside each gap in ticks.- BOS and CHoCH labels at confirmed structure breaks.- Active market structure levels.- BUY and SELL labels displaying entry, stop-loss, take-profit, and risk-to-reward information.- Shaded risk and reward zones.- Automatic stop-loss-to-breakeven visualization.- Optional breakeven trigger line.- Customizable trading session shading.- Historical trade drawings for visual backtesting.## Alerts and NotificationsThe strategy supports TradingView alerts for:- Bullish and bearish BOS confirmations.- Bullish and bearish CHoCH confirmations.- Long and short trade executions.- Stop-loss and take-profit order fills.- Automatic breakeven adjustments.- Optional FVG detection and invalidation notifications.Alerts can be configured through TradingView and delivered to supported devices, including mobile phones.## Performance DashboardA built-in performance dashboard displays key backtesting statistics directly on the chart.Available metrics include:- Total trades- Winning trades- Losing trades- Win rate- Profit factor- Net profit- Maximum drawdown- Average winning trade- Average losing trade- Expectancy per trade- Current market structure direction- Breakeven adjustments and exitsThese statistics are calculated using TradingView's Strategy Tester data.## Recommended UsageThis strategy is primarily designed for traders who use market structure and Fair Value Gaps to identify intraday continuation and reversal opportunities.It was developed with ES and MES futures in mind, particularly on the 1-minute timeframe, but its adjustable settings allow users to experiment with other instruments and timeframes.The default parameters provide a starting configuration rather than a universally optimal setup. Traders are encouraged to backtest and optimize settings according to their preferred instruments, trading sessions, and risk tolerance.## DisclaimerThis strategy is provided for educational, research, and backtesting purposes only. It does not guarantee profitable trades or future performance.Futures trading involves substantial financial risk. Historical backtesting results may differ from live execution due to slippage, commissions, liquidity, and market conditions.Users should independently evaluate the strategy and understand the risks before considering live trading.## Credits and AttributionThis strategy combines market structure logic from Elijah's Structure BOS/CHoCH with modified Fair Value Gap logic derived from LuxAlgo.The market structure component is identified as licensed under the Mozilla Public License 2.0 (MPL-2.0).The LuxAlgo-derived Fair Value Gap component is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0).Original attribution and applicable licensing terms must be retained when sharing or redistributing the combined script.

Browse all 5,900+ TradingView Pine Script strategies

View on TradingView