支持中心 帮助文档 联系我们
📱 微信: 18391752892 | 💬 QQ: 3313198376 | ✈️ Telegram | 📧 fishfx123@gmail.com
EURUSD 1.0856 +0.12% GBPUSD 1.2678 +0.08% USDJPY 149.23 -0.15% XAUUSD 2034.56 +0.34% EURUSD 1.0856 +0.12% GBPUSD 1.2678 +0.08% USDJPY 149.23 -0.15% XAUUSD 2034.56 +0.34%

MarketInfo Universal Lib for MQL 4

👤 作者: COSTEL VLAD

4.5 分

¥0.00

📌 版本: v1.0
📥 下载: 0
⭐ 评分: 4.5

📝 产品详情

MarketInfo Universal Lib for MQL 4

作者COSTEL VLAD
版本v1.0
激活数0
Universal MarketInfo Service Library for MT4 & MT5

Bring simplicity and power to your trading projects with the Universal MarketInfo Service — a professional library that exposes a unified API for both MetaTrader 4 and MetaTrader 5.

No more rewriting code for each platform. With this library, you can:
  • Access symbol data, OHLC prices, spreads, and volatility with a single call.
  • Query account balance, free margin, stop levels, and lot constraints.
  • Work with currency precision, pip values, and normalized volumes.
  • Retrieve time data and detect Strategy Tester mode.

Whether you’re building Expert Advisors, indicators, or scripts, this library ensures your code is portable and, reliable, and future‑proof.

  • Write once, run everywhere — MT4 & MT5.
  • Save time, reduce errors, and focus on strategy, not boilerplate.

You can download the free source code of this library from github and you can include it directly in your EA code; please note that the source file is compatible with both MT4 and MT5 platforms.


Usage Example 

// Include the market info API header
#import "vladefix/market-info-lib-v1.00.ex4"
   string GetSymbol();
   double GetAskPrice();
   double GetBidPrice();
   double GetClose(int, ENUM_TIMEFRAMES);
   double GetOpen(int, ENUM_TIMEFRAMES);
   double GetHigh(int, ENUM_TIMEFRAMES);
   double GetLow(int, ENUM_TIMEFRAMES);
   ...
   double GetFreeMarginAfterCheck(double, int, double);
   string DoubleToCurrencyString(double);
   bool IsTestingMode();
   void DestroyMarketInfoLib();
#import

//-------------------------------------------------------
// Initialization function (OnInit)
//-------------------------------------------------------
int OnInit()
{
   Print("Symbol: ", GetSymbol());
   Print("Ask: ", GetAskPrice(), " | Bid: ", GetBidPrice());
   Print("Spread: ", GetSpread(), " points");

   double lot = NormalizeVolume(0.158);
   Print("Normalized lot: ", lot);

   double balance = GetAccountBalance();
   Print("Account Balance: ", DoubleToCurrencyString(balance));

   if(IsTestingMode())
      Print("Running in Strategy Tester...");
}


void OnDeinit(const int reason)
  {
     DestroyMarketInfoLib()
  }

安全须知

本产品仅通过 MQL5.com 官方渠道获取。其他渠道版本可能缺少完整功能和技术支持。

EA 配置

交易品种XAUUSD
时间框架H1 (推荐)
推荐经纪商IC Markets, IC Trading
最低存款$300 / 0.01手

📸 截图预览