โšก MarketPulse MT5 API Reference

Ultra-fast, zero-hassle economic calendar & trade filter for MetaTrader 5 Expert Advisors.

๐Ÿ“ฆ 1-Click Drop-In Files for MetaTrader 5

Download and place these into your MT5 terminal folder (MQL5/Include/ and MQL5/Experts/):

๐Ÿงช Live API Sandbox & Code Generator

Click Run Query or change inputs to see live data...

1. Ultra-Fast Boolean Check: 1 or 0 Easiest Check

GET https://www.news.eamvm.in/api.php?check=EURUSD or https://www.news.eamvm.in/api.php?action=can_trade&symbol=EURUSD

Returns exactly 1 if safe to trade, or 0 if a high-impact news event is near. Perfect for 2-line EA news pause logic without parsing anything.

MQL5 Implementation:

// Insert into your EA's OnTick() function:
char postData[], result[]; string resultHeaders;
int res = WebRequest("GET", "https://www.news.eamvm.in/api.php?check=" + _Symbol,
                     "Accept: text/plain\r\n", 2000, postData, result, resultHeaders);

if(res == 200 && CharArrayToString(result) == "0")
{
   Comment("โธ TRADING PAUSED: High-impact news event active on ", _Symbol);
   return; // Skip new trade entry
}

2. 1-Line Text Protocol: High-Speed News Filter Recommended for EAs

GET https://www.news.eamvm.in/api.php?symbol=EURUSD&window=60&buffer=15&format=text

ParameterTypeDefaultDescription
symbolstring(Required)Any instrument: EURUSD, XAUUSD, US30, EURUSD.pro, etc.
windowinteger60Minutes before upcoming news to pause trading.
bufferinteger15Minutes after news release before resuming trading.
impactstringhighMinimum impact level to pause (high or medium).
formatstringtextReturns a single pipe-separated line for 1-call MQL5 StringSplit.

Response Structure:

SYMBOL|CAN_TRADE|NEXT_IMPACT|MINUTES_LEFT|NEXT_TITLE|DAILY_RISK|WEEKLY_RISK
Example: EURUSD|1|high|45|Core Retail Sales m/m|low|high

MQL5 3-Line Parsing:

char postData[], result[]; string resultHeaders;
int res = WebRequest("GET", "https://www.news.eamvm.in/api.php?symbol=" + _Symbol + "&format=text",
                     "Accept: text/plain\r\n", 2000, postData, result, resultHeaders);
if(res == 200)
{
   string p[];
   StringSplit(CharArrayToString(result), '|', p);
   bool canTrade = (p[1] == "1");
   int  minsLeft = (int)StringToInteger(p[3]);
   string title  = p[4];
   
   if(!canTrade)
   {
      Comment("PAUSED: News '", title, "' in ", minsLeft, " minutes!");
      return;
   }
}

3. Drop-In Library: #include <MarketPulse.mqh> Zero Boilerplate

Include MarketPulse.mqh in your EA project to access clean, cached, non-blocking helper functions without writing raw WebRequests:

#include <MarketPulse.mqh>

int OnInit()
{
   // Initialize with server URL and 60-second local cache
   MarketPulse_Init("https://www.news.eamvm.in/api.php", 60);
   return(INIT_SUCCEEDED);
}

void OnTick()
{
   // 1-Line Filter: pauses 60m before and 15m after high impact news
   if(!MP_CanTrade(_Symbol, 60, 15))
   {
      Comment("Paused: High impact news event active on ", _Symbol);
      return;
   }
   
   // Your normal EA strategy goes here...
}

4. Compact Matrix Feed: Multi-Currency Dashboard ~3 KB Payload

GET https://www.news.eamvm.in/api.php?mode=matrix or https://www.news.eamvm.in/api.php?mt5=matrix

Designed specifically for dashboard EAs like MarketPulseDemo.mq5. Pre-calculates source labels, today's heatwave, and weekly risk for all 20 currencies. Reduces network payload by 98.5% (from 220KB down to 3KB).

5. ForexFactory Compatible Feed: api_2.php 100% FF Schema

GET https://www.news.eamvm.in/api_2.php or https://www.news.eamvm.in/api_2.php?symbol=EURUSD&impact=High&pretty=1

Emits the exact JSON array structure used by standard ForexFactory feeds (https://nfs.faireconomy.media/ff_calendar_thisweek.json), powered by multi-provider consensus (ForexFactory + MQL5 + Investing + Myfxbook). Resolves impacts to full words (High, Medium, Low) based on highest provider severity.

โš ๏ธ MT5 Setup: Whitelist WebRequest URL (Avoid Error 4014)

MetaTrader 5 blocks external HTTP requests by default. To allow your EA to fetch news from your server, do this once:

  1. Open MetaTrader 5.
  2. Click top menu: Tools → Options (or press Ctrl+O).
  3. Select the Expert Advisors tab.
  4. Check the box: "Allow WebRequest for listed URL".
  5. Click the green "+" button and add:
    https://www.news.eamvm.in/api.php
    (or your root server URL: https://www.news.eamvm.in)
  6. Click OK. Your EA is now connected!