此资源为星钻会员专享,每日更新,收录于《大白EA宝库:星钻会员专属合集》。
这个 EA 等待 RSI、MACD、随机指标中达到设定数量同时出现背离后开仓,带均线趋势过滤、成交量过滤,支持固定或按比例手数。本帖文件为 MT5 源码,打包成 zip 下载,解压后在 MetaEditor 里编译使用,参数与文件开头见下方源码预览。
源码预览(先看代码,再决定下不下)
本帖是源码 EA:multi-divergence-ea-mt5.mq5,全文共 533 行。下面是它的全部可调参数与文件开头,完整源码在上方下载区,星钻会员可见。
可调参数(23 个)
double LotSize = 0.1;(Lot size)int StopLoss = 100;(Stop loss in points)int TakeProfit = 200;(Take profit in points)int MaxSpread = 30;(Maximum spread allowed)bool UseMoneyManagement = false;(Use money management)double RiskPercent = 2.0;(Risk percentage per trade)int RSI_Period = 14;(RSI period)int MACD_Fast = 12;(MACD fast EMA)int MACD_Slow = 26;(MACD slow EMA)int MACD_Signal = 9;(MACD signal)int Stoch_K = 5;(Stochastic %K)int Stoch_D = 3;(Stochastic %D)int Stoch_Slowing = 3;(Stochastic slowing)int BarsToCheck = 50;(Bars to check for divergence)int MinBarsDistance = 5;(Minimum bars distance between peaks/troughs)double MinDivergenceStrength = 0.7;(Minimum divergence strength (0-1))int MinConfirmations = 3;(Minimum confirmations needed (1-3))bool UseVolumeFilter = true;(Use volume confirmation)bool UseTrendFilter = true;(Use trend filter)bool AllowBuy = true;(Allow buy trades)bool AllowSell = true;(Allow sell trades)int MaxTrades = 1;(Maximum concurrent trades)int MagicNumber = 123456;(Magic number)
//+------------------------------------------------------------------+ //| Multi_Divergence_EA.mq5 | //| Copyright 2025, Le Trung Kien Hoang | //| https://www.b123.com/ | //+------------------------------------------------------------------+ #property copyright "Copyright 2025, Le Trung Kien Hoang" #property link "https://www.b123.com/" #property version "1.00" #include <Trade\Trade.mqh> //--- Input parameters input group "=== Risk Management ===" input double LotSize = 0.1; // Lot size input int StopLoss = 100; // Stop loss in points input int TakeProfit = 200; // Take profit in points input int MaxSpread = 30; // Maximum spread allowed input bool UseMoneyManagement = false; // Use money management input double RiskPercent = 2.0; // Risk percentage per trade input group "=== Divergence Settings ===" input int RSI_Period = 14; // RSI period input int MACD_Fast = 12; // MACD fast EMA input int MACD_Slow = 26; // MACD slow EMA input int MACD_Signal = 9; // MACD signal input int Stoch_K = 5; // Stochastic %K input int Stoch_D = 3; // Stochastic %D input int Stoch_Slowing = 3; // Stochastic slowing input group "=== Divergence Detection ===" input int BarsToCheck = 50; // Bars to check for divergence input int MinBarsDistance = 5; // Minimum bars distance between peaks/troughs input double MinDivergenceStrength = 0.7; // Minimum divergence strength (0-1) input int MinConfirmations = 3; // Minimum confirmations needed (1-3) input bool UseVolumeFilter = true; // Use volume confirmation
风险提示:EA 交易有风险,过往与参数表现不代表未来。正式使用前先在模拟盘跑够样本,确认在自己的点差、滑点环境下仍符合预期,再决定是否上实盘。
版本说明:资源随 MT4/MT5 版本迭代可能失效,如遇失效请在本帖留言反馈。

