EMA200 REGIME + BOS/CHoCH + 2x FVG Strategy by Bystry1991

By Bystry1991

Performance Metrics

Description

EMA200 Regime + BOS/CHoCH + 2x FVG StrategyOverviewEMA200 Regime + BOS/CHoCH + 2x FVG Strategy is a rule-based TradingView strategy designed primarily for 2-minute intraday trading.The strategy combines four core concepts:EMA200 directional regimeMarket Structure: BOS and CHoCHTwo-FVG confirmation logicLimit entry at 50% of the body of the signal candleThe main objective is to identify continuation or reversal setups that develop while price remains on the correct side of the EMA200.Unlike a simple EMA crossover strategy, the EMA200 is used mainly as a directional regime filter. A crossover activates either LONG or SHORT mode, but the strategy still requires market structure and Fair Value Gap confirmation before an entry can be created.This script is a full strategy() implementation and is intended for use with TradingView's Strategy Tester.1. EMA200 Regime LogicThe EMA200 determines the allowed trading direction.SHORT regimeA SHORT regime begins when price crosses the EMA200 from above to below.The regime remains active as long as price continues to close below the EMA200.A SHORT regime is cancelled when:Close > EMA200A wick above the EMA200 alone does not necessarily invalidate the regime when structure confirmation is based on candle close.During an active SHORT regime, the strategy searches for:bearish BOS or bearish CHoCHbearish 2x FVGa valid signal candlea retracement to the calculated limit-entry priceLONG regimeA LONG regime begins when price crosses the EMA200 from below to above.The regime remains active while price closes above the EMA200.The LONG regime is cancelled when:Close high[2]This means that the current candle's low is above the high from two candles earlier.The gap is located between:high[2] and lowBearish FVGA bearish FVG exists when:high EMA200For LONG:Close < EMA20012. GOLD PresetWhen the selected market is:GOLDthe default values are:Take Profit: 20 pointsStop Loss: 10 pointsBreak-Even Trigger: +15 pointsBreak-Even Offset: 0Example SHORT:Entry:3800Stop:3810Target:3780Break-even activates when price reaches:3785The stop is then moved to the entry price when the default BE Offset is zero.13. NASDAQ PresetWhen the selected market is:NASDAQthe default values are:Take Profit: 100 pointsStop Loss: 50 pointsBreak-Even Trigger: +50 pointsBreak-Even Offset: 0Example SHORT:Entry:25,000Stop:25,050Target:24,900Break-even trigger:24,950These values represent actual price points, not ticks.14. CUSTOM Market ModeThe CUSTOM preset allows manual configuration of:Take ProfitStop LossBreak-Even TriggerBreak-Even OffsetThis allows the strategy to be tested on other instruments or with different risk parameters.15. Break-Even LogicBreak-even is handled automatically.SHORTIf price reaches:Entry - BE Triggerthe stop is moved to:Entry + BE OffsetWith:BE Offset = 0the stop moves exactly to the entry price.LONGIf price reaches:Entry + BE Triggerthe stop is moved to:Entry - BE OffsetOnce break-even has been activated, the stop is not intentionally moved back to the original stop-loss level.16. TP1The strategy also calculates an intermediate TP1 level.Default:50% of the distance between Entry and final TargetExample NASDAQ:Main Target:100 pointsTP1:50 pointsExample GOLD:Main Target:20 pointsTP1:10 pointsBy default TP1 can be used as a visual reference.The optional:Enable Partial TP1setting allows part of the position to be closed at TP1.The percentage is controlled by:TP1 Quantity %17. Position VisualizationActive trades can be displayed using a risk/reward style box.The visual structure includes:Stop areaEntry lineTP1 lineBreak-even trigger lineMain targetTrade labelsThe STOP area is displayed above a SHORT entry and below a LONG entry.The TARGET area is displayed below a SHORT entry and above a LONG entry.The visualization is intended to resemble the logic of TradingView's Long/Short Position drawing tool.18. Trade DirectionThe strategy supports three directional modes:SHORT ONLYOnly bearish setups are traded.LONG ONLYOnly bullish setups are traded.BOTHBoth bullish and bearish setups are allowed.Default:BOTH19. Recommended TimeframeThe strategy is designed primarily around the:2-minute timeframeA visual warning can appear if another timeframe is selected.The script is not technically locked to 2 minutes, but changing the timeframe changes the meaning of parameters expressed in bars.For example:15 barsrepresents:30 minutes on 2M75 minutes on 5M225 minutes on 15MUsers should therefore retest all parameters when changing timeframe.20. Debug ModeDebug Mode can be enabled to inspect the internal setup process.It can show events such as:SHORT MODELONG MODESETUP READYLIMIT CREATEDThe debug table can also display the current state of:timeframeEMA regimeBOS/CHoCH confirmation2x FVG confirmationsetup readinesspending limitactive positionThis is particularly useful when reviewing historical setups that appear visually valid but did not produce a trade.21. BacktestingThis script uses:strategy()rather than:indicator()and is therefore designed for TradingView's Strategy Tester.It includes:fixed contract quantityconfigurable date rangestop losstake profitbreak-evenoptional partial TP1limit entriesStrategy Tester trade statisticsThe strategy also uses:calc_on_order_fills = truecalc_on_every_tick = trueuse_bar_magnifier = trueBar Magnifier can improve the realism of historical order execution when lower-timeframe data is available.However, historical backtests can never perfectly reproduce live execution.22. Futures Margin ConfigurationThe strategy includes:margin_long = 10and:margin_short = 10This represents a 10% simulated margin requirement in TradingView's broker emulator.This setting is included primarily so that futures contracts with a high notional value are not automatically rejected simply because the simulated account does not contain 100% of the contract's notional value.This is a backtesting configuration only.It does not represent a specific broker's real margin requirement.23. Non-Repainting PrinciplesThe strategy is designed to avoid using future information for its trading decisions.Important rules include:structure breaks are evaluated only using available informationpivots are used only after confirmationthe signal candle must close before its midpoint can be calculatedthe limit order is created only after the signal candle has closedhistorical entry prices are not moved backward to make the backtest look betterthe script does not intentionally use lookahead dataA confirmed pivot naturally requires candles to form after the actual swing point. This is standard pivot confirmation and should not be confused with repainting.24. Entry Sequence SummarySHORTPrice crosses below EMA200↓SHORT regime becomes active↓Bearish BOS or bearish CHoCH↓Bearish 2x FVG↓Conditions must be within allowed setup distance↓Next candle closes↓Entry = 50% of signal candle body↓SHORT limit order↓Price retraces to entry↓Position opened↓SL / BE / TP managementLONGPrice crosses above EMA200↓LONG regime becomes active↓Bullish BOS or bullish CHoCH↓Bullish 2x FVG↓Conditions must be within allowed setup distance↓Next candle closes↓Entry = 50% of signal candle body↓LONG limit order↓Price retraces to entry↓Position opened↓SL / BE / TP management25. Main InputsMarket SettingsMarketTrade DirectionContractsGOLD TP / SL / BENASDAQ TP / SL / BECUSTOM parametersEMA SettingsShow EMA200EMA LengthEMA ColorEMA WidthStructure SettingsEnable BOSEnable CHoCHSwing LengthStructure Break ConfirmationStructure labelsStructure linesFVG SettingsEnable FVGShow FVGMaximum bars between FVGsMinimum FVG filterFVG sizeFVG unitsFVG colors2x FVG markersSetup SettingsMax bars between BOS/CHoCH and 2x FVGPre-cross event lookbackEntry SettingsLIMIT Entry Validity BarsRisk ManagementTP1 positionPartial TP1TP1 quantitySame-bar historical BE behaviorVisual SettingsPosition boxTrade labelsEMA regime backgroundtimeframe warning26. Intended UseThis strategy is intended as a structured framework for researching a specific intraday trading model based on:trend regime + market structure + imbalance + retracement entryIt is particularly useful for studying whether BOS/CHoCH and multiple Fair Value Gaps provide meaningful confirmation after price establishes direction relative to the EMA200.The purpose of the script is not to predict every market move.It is designed to convert a discretionary chart-reading process into explicit and testable rules.Release Notesup

Browse all 5,900+ TradingView Pine Script strategies

View on TradingView