Re: News-based scalping: how do you trade NFP/CPI releases?
Posted: Mon Sep 07, 2026 9:47 pm
Integrating with the Execution Engine
Now, we modify the entry logic from the previous script to enforce the regime alignment before firing the continuation trade. We also add a directional lock so we don't accidentally take a short continuation setup in a bullish 4-hour regime.
Now, we modify the entry logic from the previous script to enforce the regime alignment before firing the continuation trade. We also add a directional lock so we don't accidentally take a short continuation setup in a bullish 4-hour regime.
Code: Select all
// =========================================================================
// UPDATED EXECUTION ENGINE (With MTF Filter)
// =========================================================================
// Entry Engine
if state == MarketState.PostNewsWindow and struct.isLocked and strategy.position_size == 0
// Evaluate Long Setup
bool inDiscountZoneLong = close > struct.fib618 and low <= struct.fib50
bool isTrendAlignedLong = htfTrend == Regime.Bullish
if inDiscountZoneLong and isSpreadTight and isTrendAlignedLong and lotSize > 0
strategy.entry("Macro_Cont_Long", strategy.long, qty=lotSize)
strategy.exit("Macro_Risk", "Macro_Cont_Long", stop=close - stopDist, limit=struct.impHigh)
tradeStartTime := currMins
// (Optional) Evaluate Short Setup using the same logic inverted
// bool inPremiumZoneShort = close < struct.fib618 and high >= struct.fib50
// bool isTrendAlignedShort = htfTrend == Regime.Bearish
// if inPremiumZoneShort and isSpreadTight and isTrendAlignedShort...