거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Twitter에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
지표

Prop Firm News Window Countdown and Spread Monitor - MetaTrader 5용 지표

조회수:
22
평가:
(1)
게시됨:
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

News releases move spreads before price even breaks a level. If you're running an Expert Advisor through CPI, NFP, or a central bank rate decision, a wider Ask-Bid gap can stop out tight trades or violate a funded account's restricted news window. Checking the calendar manually on every chart doesn't scale.

I built PropFirm News Spread Monitor to track the live MQL5 economic calendar and real-time spread in one lightweight chart panel. Every 250 milliseconds on the timer (plus incoming ticks), the indicator evaluates whether the symbol sits inside your pre-news warning window, inside the post-news lockout window, or above your maximum allowed spread in points. It writes those readings directly to three iCustom buffers so any EA can read a single numeric state code before sending an order.

PropFirm News Spread Monitor HUD

iCustom Buffers and State Machine

Your EA only reads bar index 0 via CopyBuffer . The indicator exposes three DRAW_NONE data buffers and renders an optional top-right HUD (10 chart objects total, DPI-scaled for high-resolution displays). Buffer 0 ( ExtStateBuf ) outputs 0 ( STATE_INIT ), 1 ( STATE_NORMAL ), 2 ( STATE_PRE_NEWS ), 3 ( STATE_LOCKED_WINDOW ), or 4 ( STATE_SPREAD_ALERT ). Buffer 1 ( ExtSpreadBuf ) reports the live Bid-Ask spread in points via _Point with a SYMBOL_SPREAD fallback. Buffer 2 ( ExtSecondsToNewsBuf ) holds signed seconds to the active event (negative during post-news lockout, or EMPTY_VALUE when clear for 24 hours).

When the built-in MQL5 Economic Calendar returns zero events (such as inside Strategy Tester or on an offline weekend chart), the monitor switches to a daily UTC fallback window if InpEnableManualUtcFallback is enabled. Once a live calendar event enters the post-news lockout range, g_lockedNewsWinEnd seals the lockout end timestamp so the window stays locked until the timer expires.

EA Integration Snippet (MQL5)

int g_newsMonitorHandle = INVALID_HANDLE;

int OnInit()
  {
   g_newsMonitorHandle = iCustom(_Symbol, _Period, "PropFirm_News_Spread_Monitor");
   if(g_newsMonitorHandle == INVALID_HANDLE)
      return(INIT_FAILED);
   return(INIT_SUCCEEDED);
  }

bool IsNewsAndSpreadClear()
  {
   double stateBuf[1];
   if(CopyBuffer(g_newsMonitorHandle, 0, 0, 1, stateBuf) <= 0)
      return(false);
   return((int)MathRound(stateBuf[0]) == 1); // 1 == STATE_NORMAL
  }

Input Parameters

Parameter Default Description
InpPreNewsMinutes 15 Pre-news warning window in minutes before the event timestamp ( >= 1 ).
InpPostNewsMinutes 15 Post-news lockout window in minutes after the event timestamp ( >= 1 ).
InpMaxSpreadPoints 25.0 Maximum allowed Bid-Ask spread in points before raising STATE_SPREAD_ALERT ( >= 1.0 ).
InpHighImpactOnly true When true , tracks high-impact calendar events only; when false , includes moderate-impact events.
InpFilterChartCurrencies true Filters calendar events to match the active chart's base or profit currency.
InpEnableManualUtcFallback true Uses a daily UTC schedule window when the MQL5 calendar returns no events.
InpManualNewsUtcHour 13 Manual fallback event hour in UTC ( 0-23 ).
InpManualNewsUtcMinute 30 Manual fallback event minute in UTC ( 0-59 ).
InpManualNewsLabel Manual UTC Event Event title displayed on the HUD when manual UTC fallback is active.
InpPanelX 20 Top-right HUD panel horizontal offset in pixels.
InpPanelY 20 Top-right HUD panel vertical offset in pixels.

Technical Scope

This indicator handles single-chart live calendar countdowns, spread gating, and iCustom state output. It doesn't flatten open positions, delete pending orders, replay historical M1 tick curves, or inspect backtest HTML reports. For full account-level risk utilities and related documentation, see my MQL5 profile.

False Breakout Envelope False Breakout Envelope

False breaks at an ATR envelope, drawn as trades: price pushes through a band, closes back inside, and a box runs from the entry to the moving midline, with the stop as a thick line. Each label prints the win rate of earlier signals in the same RSI zone, and a corner card charts it for every zone.

Auto Fibonacci Retracement on the Latest Swing Auto Fibonacci Retracement on the Latest Swing

Detects swing highs and lows automatically and draws Fibonacci retracement levels on the latest completed swing leg. The levels move to the new leg as soon as a new swing is confirmed; the levels, their colors and the swing sensitivity are configurable.

Accelerator Oscillator (AC) Accelerator Oscillator (AC)

The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.

MACD Signals MACD Signals

Indicator edition for new platform.