MT4 EA源码:Quantora Margin Calculator MT4 开源保证金计算器面板|星钻会员尊享 - 资源合集论坛 - Meta Trade 4 - BBTrading

MT4 EA源码:Quantora Margin Calculator MT4 开源保证金计算器面板|星钻会员尊享

此资源为星钻会员专享,每日更新,收录于《大白EA宝库:星钻会员专属合集》。

这是一个开源保证金计算器面板:计算所需保证金、可用保证金影响、预估保证金水平与持仓价值。本帖文件为 MT4 源码,打包成 zip 下载,解压后在 MetaEditor 里编译使用,参数与文件开头见下方源码预览。

源码预览(先看代码,再决定下不下)

本帖是源码 EA:Quantora_Margin_Calculator_MT4.mq4,全文共 465 行。下面是它的全部可调参数与文件开头,完整源码在上方下载区,星钻会员可见。

可调参数(16 个)

  • string InpTradeHeader = "========== TRADE SETTINGS =========="
  • bool InpUseCurrentSymbol = true
  • string InpCustomSymbol = ""
  • ENUM_Q_TRADE_DIRECTION InpTradeDirection = Q_BUY_TRADE
  • double InpLotSize = 0.10
  • double InpCustomPrice = 0.0
  • string InpSafetyHeader = "========== SAFETY SETTINGS =========="
  • double InpSafeMarginUsePct = 20.0
  • double InpWarningMarginUsePct = 40.0
  • double InpDangerMarginUsePct = 70.0
  • string InpPanelHeader = "========== DASHBOARD =========="
  • bool InpShowPanel = true
  • ENUM_BASE_CORNER InpPanelCorner = CORNER_LEFT_UPPER
  • int InpPanelX = 15
  • int InpPanelY = 145
  • int InpTimerSeconds = 1
//+------------------------------------------------------------------+
//|                                   Quantora Margin Calculator MT4 |
//|           Professional Trading Utility for MetaTrader 4          |
//|                                                                  |
//| Copyright © 2026 Quantora                                        |
//| https://www.b123.com/                    |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2026 Quantora"
#property link      "https://www.b123.com/"
#property version   "1.00"
#property strict
#property description "Professional margin calculator for MetaTrader 4."
#property description "Calculates required margin, free margin impact and margin safety."

enum ENUM_Q_TRADE_DIRECTION
  {
   Q_BUY_TRADE  = 0,
   Q_SELL_TRADE = 1
  };

//============================== INPUTS =====================================
input string                 InpTradeHeader          = "========== TRADE SETTINGS ==========";
input bool                   InpUseCurrentSymbol     = true;
input string                 InpCustomSymbol         = "";
input ENUM_Q_TRADE_DIRECTION InpTradeDirection       = Q_BUY_TRADE;
input double                 InpLotSize              = 0.10;
input double                 InpCustomPrice          = 0.0;

input string                 InpSafetyHeader         = "========== SAFETY SETTINGS ==========";
input double                 InpSafeMarginUsePct     = 20.0;
input double                 InpWarningMarginUsePct  = 40.0;
input double                 InpDangerMarginUsePct   = 70.0;

input string                 InpPanelHeader          = "========== DASHBOARD ==========";
input bool                   InpShowPanel            = true;

风险提示:EA 交易有风险,过往与参数表现不代表未来。正式使用前先在模拟盘跑够样本,确认在自己的点差、滑点环境下仍符合预期,再决定是否上实盘。

版本说明:资源随 MT4/MT5 版本迭代可能失效,如遇失效请在本帖留言反馈。

请登录后发表评论