MT5 EA源码:XANDER Grid XAUUSD 黄金双向网格,按前烛方向开仓|星钻会员尊享 - 资源合集论坛 - Meta Trade 4 - BBTrading

MT5 EA源码:XANDER Grid XAUUSD 黄金双向网格,按前烛方向开仓|星钻会员尊享

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

这是一个黄金双向网格 EA,按前一根蜡烛方向开仓,两单以上按加权平均价统一止盈,带每日盈利目标与浮亏上限暂停新单。本帖文件为 MT5 源码,打包成 zip 下载,解压后在 MetaEditor 里编译使用,参数与文件开头见下方源码预览。

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

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

可调参数(21 个)

  • string sep0 = "★ XANDER Grid XAUUSD";(══ XANDER Systems ══)
  • string sep1 = "══════ GRID SETTINGS ══════";(─────────────────────)
  • int xs_TakeProfit = 300;(Take Profit per position (pips))
  • int xs_GridStep = 390;(Distance between grid levels (pips))
  • int xs_MinProfit = 120;(Minimum grid profit to close (pips))
  • string sep2 = "══════ LOT SETTINGS ══════";(─────────────────────)
  • double xs_StartLots = 0.01;(Starting lot size)
  • double xs_MaxLots = 0.04;(Maximum lot size allowed)
  • string sep3 = "══════ CLOSE STRATEGY ══════";(─────────────────────)
  • ENUM_CLOSE_TYPE xs_CloseType = AVERAGE_TP;(Close method)
  • string sep4 = "══════ RISK PROTECTION ══════";(─────────────────────)
  • bool xs_UseDailyTarget = false;(Enable Daily Profit Target)
  • double xs_DailyTarget = 10.0;(Daily Profit Target ($) — closes all when reached)
  • bool xs_UseMaxDrawdown = false;(Enable Max Floating Drawdown)
  • double xs_MaxDrawdown = 50.0;(Max Floating Drawdown ($) — pauses new entries)
  • string sep5 = "══════ EXPERT SETTINGS ══════";(─────────────────────)
  • int xs_Magic = 2001;(Magic Number)
  • int xs_Slippage = 30;(Slippage (pips))
  • string sep_last = "══════ CONTACT ══════";(─────────────────────)
  • string xs_community = "https:(www.b123.com/"; // 🌐 Join our trading community)
  • string xs_freelance = "https:(www.b123.com/"; // 💼 Freelance & dev requests — MQL5 only)
//+------------------------------------------------------------------+
//| XANDER Grid XAUUSD                                               |
//| Version: 1.0          | Date: 2026-04-09                         |
//| Platform: MT5                                                    |
//| Company: XANDER Systems                                          |
//+------------------------------------------------------------------+
// CHANGELOG:
// v1.0 - 2026-04-09 - Initial release
//                     Bidirectional grid with candle direction filter
//                     Average TP and Partial Close modes
//                     Daily Profit Target
//                     Max Floating Drawdown protection
//                     Auto clean chart on load (grid, volume, trade history, levels)
//+------------------------------------------------------------------+
// Join our trading community:
// Telegram : https://www.b123.com/
//
// Freelance & development requests — MQL5 profile only:
// MQL5     : https://www.b123.com/
//+------------------------------------------------------------------+
#property copyright   "© XANDER Systems"
#property link        "https://www.b123.com/"
#property version     "1.00"
#property description "XANDER Grid XAUUSD — Bidirectional Grid EA for Gold"
#property description "Community: https://www.b123.com/"
#property description "Freelance & dev requests: https://www.b123.com/"

#include <Trade\PositionInfo.mqh>
#include <Trade\Trade.mqh>

CPositionInfo m_position;
CTrade        trade;

//--- Close strategy enum
enum ENUM_CLOSE_TYPE

风险提示:这类 EA 带网格/马丁类加仓逻辑,顺风时看不出来,单边行情里仓位和浮亏会一起放大。上实盘前先在模拟盘跑够样本,把最大层数和总手数按自己能承受的回撤设死,不要用默认参数直接跑。

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

请登录后发表评论