MT4 EA源码:VR Locker Lite – Trading strategy based on a positive lock 正向锁仓对冲轻量版|星钻会员尊享 - 资源合集论坛 - Meta Trade 4 - BBTrading

MT4 EA源码:VR Locker Lite – Trading strategy based on a positive lock 正向锁仓对冲轻量版|星钻会员尊享

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

这是正向锁仓策略的轻量版:先同手数开多空对冲单,再随价格拉开距离形成正向锁并逐步扩大锁间距离,用加权均价与浮盈目标管理篮子;可调起始手数、加仓乘数(默认 2.0)、加仓步距(默认 200 点)、浮盈加点、滑点与 MagicNumber。本帖文件为 MT4 源码,打包成 zip 下载,解压后在 MetaEditor 里编译使用,参数与文件开头见下方源码预览。

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

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

可调参数(6 个)

  • double iStartLots = 0.01;(Initial trading volume (lot size))
  • double iMultiplier = 2.0;(Multiplier for increasing position volume)
  • double iProfitPlus = 30;(Profit target in points to add to average price)
  • int iStep = 200;(Distance in points for adding to losing positions)
  • int iMagicNumber = 227;(Unique identifier for EA's positions)
  • int iSlippage = 30;(Maximum allowed slippage in points)
//+------------------------------------------------------------------+
//|                                               VR Locker Lite.mq4 |
//|                                      Copyright 2025, Trading-Go. |
//+------------------------------------------------------------------+
#property copyright "@ Voldemar"                                      // Copyright information
#property link      "https://www.b123.com/" //
#property version   "26.010"                                          // Expert Advisor version
#property strict

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
input double  iStartLots   = 0.01; // Initial trading volume (lot size)
input double  iMultiplier  = 2.0;  // Multiplier for increasing position volume
input double  iProfitPlus  = 30;   // Profit target in points to add to average price
input int     iStep        = 200;  // Distance in points for adding to losing positions
input int     iMagicNumber = 227;  // Unique identifier for EA's positions
input int     iSlippage    = 30;   // Maximum allowed slippage in points
double lt = 0;                     // Variable for calculated lot size
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   Comment("");
   lt = iStartLots;


   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {

风险提示:这类 EA 风险等级高,行情不利时回撤会来得快、来得深。上实盘前先在模拟盘跑够样本,把单笔风险、止损和最大持仓按自己能承受的上限设死,不要用默认参数直接跑。

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

请登录后发表评论