年度星钻会员尊享!MT4 EA:RiskSizer Panel Lite MT4 按风险百分比算手数量化交易程序 - 交易机器人 | 助力投资交易更好成功资源合集论坛量化交易程序 - 交易机器人 | 助力投资交易更好成功Meta Trade 4量化交易程序 - 交易机器人 | 助力投资交易更好成功BBTrading

年度星钻会员尊享!MT4 EA:RiskSizer Panel Lite MT4 按风险百分比算手数

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

这是一个仓位计算面板类工具 EA:按账户风险百分比来计算下单手数,配有一键买卖面板。本帖文件为 MT4 源码,打包成 zip 下载,解压后在 MetaEditor 里编译使用,参数与文件开头见下方源码预览。

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

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

可调参数(8 个)

  • double InpRiskPercent = 1.0;(Risk % per trade (Balance))
  • double InpRiskStep = 0.10;(Risk step for +/- buttons)
  • int InpDefaultSL_Points = 3000;(Default SL distance (points))
  • int InpDefaultTP_Points = 6000;(Default TP distance (points))
  • int InpMaxSpread_Points = 0;(Max spread filter (points). 0 = ignore)
  • int InpDeviation_Points = 20;(Slippage (points))
  • int InpMagic = 20260120;(Magic number)
  • int InpUiRefreshMs = 250;(UI refresh interval (ms))
//+------------------------------------------------------------------+
//|                                         RiskSizer_Panel_Lite.mq4 |
//|                                 © 2026, Ngo The Hung (thehung21) |
//|                          https://www.b123.com/ |
//+------------------------------------------------------------------+
#property copyright "© 2026, Ngo The Hung (thehung21)"
#property link      "https://www.b123.com/"
#property version   "1.00"
#property strict
#property description "RiskSizer Panel Lite (MT4) — Risk% Lot Calculator + One-Click BUY/SELL"
#property description "Two draggable horizontal lines define SL/TP zone. Risk is based on Account Balance."

//----------------------------- Inputs ------------------------------
input double InpRiskPercent        = 1.0;      // Risk % per trade (Balance)
input double InpRiskStep           = 0.10;     // Risk step for +/- buttons
input int    InpDefaultSL_Points   = 3000;     // Default SL distance (points)
input int    InpDefaultTP_Points   = 6000;     // Default TP distance (points)
input int    InpMaxSpread_Points   = 0;        // Max spread filter (points). 0 = ignore
input int    InpDeviation_Points   = 20;       // Slippage (points)
input int    InpMagic              = 20260120; // Magic number
input int    InpUiRefreshMs        = 250;      // UI refresh interval (ms)

//----------------------------- Constants ---------------------------
#define  PREFIX_BASE   "RSZL_"

//----------------------------- Globals -----------------------------
string   GPrefix;
bool     GUiReady = false;

double   GRiskPercent = 1.0;

// Panel objects
string   OBJ_BG, OBJ_HDR, OBJ_SEP;
string   OBJ_TITLE;

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

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

请登录后发表评论