此资源为星钻会员专享,每日更新,收录于《大白EA宝库:星钻会员专属合集》。
这是一个多货币布林带均值回归示例 EA,用 OnTimer 驱动以避免依赖任一品种 tick,各品种独立按布林带上下轨信号交易。本帖文件为 MT5 源码,打包成 zip 下载,解压后在 MetaEditor 里编译使用,参数与文件开头见下方源码预览。
源码预览(先看代码,再决定下不下)
本帖是源码 EA:MultiCurrEA.mq5,全文共 432 行。下面是它的全部可调参数与文件开头,完整源码在上方下载区,星钻会员可见。
可调参数(22 个)
string Symbol_0 ="EURUSD";((Symbol_0) Symbol)bool IsTrade_0 =true;((Trade_0) Trading allowed)ENUM_TIMEFRAMES Period_0 =PERIOD_H1;((Period_0) Period of Bollinger Bands)uint BBPeriod_0 =20;((BBPeriod_0) Period for calculating the average line of Bollinger Bands)uint BBShift_0 =0;((BBShift_0) Horizontal shift of Bollinger Bands)double BBDeviation_0 =2.0;((BBDeviation_0) Standard deviation of Bollinger Bands)string Symbol_1 ="GBPUSD";((Symbol_1) Symbol)bool IsTrade_1 =true;((Trade_1) Trading allowed)ENUM_TIMEFRAMES Period_1 =PERIOD_H1;((Period_1) Period of Bollinger Bands)uint BBPeriod_1 =18;((BBPeriod_1) Period for calculating the average line of Bollinger Bands)uint BBShift_1 =0;((BBShift_1) Horizontal shift of Bollinger Bands)double BBDeviation_1 =1.8;((BBDeviation_1) Standard deviation of Bollinger Bands)string Symbol_2 ="USDJPY";((Symbol_2) Symbol)bool IsTrade_2 =true;((Trade_2) Trading allowed)ENUM_TIMEFRAMES Period_2 =PERIOD_H1;((Period_2) Period of Bollinger Bands)uint BBPeriod_2 =21;((BBPeriod_2) Period for calculating the average line of Bollinger Bands)uint BBShift_2 =0;((BBShift_2) Horizontal shift of Bollinger Bands)double BBDeviation_2 =2.1;((BBDeviation_2) Standard deviation of Bollinger Bands)double DealOfFreeMargin =1.0;((DealOfFreeMargin) Percent of free margin for a deal)double LotIncrease =0.9;((LotIncrease) Ratio for increasing the next lot)uint MagicNumber =555;((MagicNumber1) Magic number)ENUM_digits Digs=5;(Digits of quotes)
//+---------------------------------------------------------------------+ //| MultiCurrEA.mq5 | //| Автор: Maxim Khrolenko | //| E-mail: https://www.b123.com/ | //+---------------------------------------------------------------------+ #property copyright "Maxim Khrolenko" #property link "https://www.b123.com/" //--- Include standard libraries #include <Trade\AccountInfo.mqh> #include <Trade\PositionInfo.mqh> #include <Trade\SymbolInfo.mqh> #include <Trade\Trade.mqh> //---============================== Input paramters ============================================ //--- Number of symbols #define SIZE 3 //--- Symbol 0 --------------------------------- input string Symbol_0 ="EURUSD"; // (Symbol_0) Symbol input bool IsTrade_0 =true; // (Trade_0) Trading allowed //--- Parameters of Bollinger Bands input ENUM_TIMEFRAMES Period_0 =PERIOD_H1; // (Period_0) Period of Bollinger Bands input uint BBPeriod_0 =20; // (BBPeriod_0) Period for calculating the average line of Bollinger Bands input uint BBShift_0 =0; // (BBShift_0) Horizontal shift of Bollinger Bands input double BBDeviation_0 =2.0; // (BBDeviation_0) Standard deviation of Bollinger Bands //--- Symbol 1 --------------------------------- input string Symbol_1 ="GBPUSD"; // (Symbol_1) Symbol input bool IsTrade_1 =true; // (Trade_1) Trading allowed //--- Parameters of Bollinger Bands input ENUM_TIMEFRAMES Period_1 =PERIOD_H1; // (Period_1) Period of Bollinger Bands input uint BBPeriod_1 =18; // (BBPeriod_1) Period for calculating the average line of Bollinger Bands input uint BBShift_1 =0; // (BBShift_1) Horizontal shift of Bollinger Bands input double BBDeviation_1 =1.8; // (BBDeviation_1) Standard deviation of Bollinger Bands //--- Symbol 2 ---------------------------------
风险提示:EA 交易有风险,过往与参数表现不代表未来。正式使用前先在模拟盘跑够样本,确认在自己的点差、滑点环境下仍符合预期,再决定是否上实盘。
版本说明:资源随 MT4/MT5 版本迭代可能失效,如遇失效请在本帖留言反馈。

