MT5 EA源码:COT1 EA COT 持仓报告+Supertrend 趋势|星钻会员尊享 - 资源合集论坛 - Meta Trade 4 - BBTrading

MT5 EA源码:COT1 EA COT 持仓报告+Supertrend 趋势|星钻会员尊享

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

这个 EA 结合 COT 持仓报告数据与 Supertrend 指标判断市场方向做趋势交易,适用于多品种日线。本帖文件为 MT5 源码,打包成 zip 下载,解压后在 MetaEditor 里编译使用,参数与文件开头见下方源码预览。

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

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

可调参数(38 个)

  • bool StEnable = false;(SuperTrend Enable)
  • double StMultiplier = 3;(SuperTrend Multiplier)
  • int StPeriod = 10;(SuperTrend Period)
  • ENUM_TIMEFRAMES IndTimeframe = PERIOD_M15;
  • ENUM_COT_CLASS_CO CotPrimaryClass = COT_CLASS_CO_DEALER;(COT Primary Class)
  • ENUM_COT_MODE CotPrimaryMode = COT_MODE_FO;(COT Primary Mode)
  • ENUM_COT_CLASS_CO CotSecondaryClass = COT_CLASS_CO_LEV;(COT Secondary Class)
  • ENUM_COT_MODE CotSecondaryMode = COT_MODE_FO;(COT Secondary Mode)
  • string OpenTime = "03:00";(Open Time for Trades)
  • double TPCoef = 2.0;(TP Coefficient)
  • ENUM_SL SLType = SL_AR;(SL Type)
  • int SLLookback = 6;(SL Lookback)
  • int SLDev = 30;(SL Deviation (Points))
  • bool Reverse = false;(Reverse Signal)
  • double Risk = 3.5;
  • ENUM_RISK RiskMode = RISK_DEFAULT;(Risk Mode)
  • bool IgnoreSL = false;(Ignore SL)
  • bool IgnoreTP = true;(Ignore TP)
  • bool Trail = true;(Trailing Stop)
  • double TrailingStopLevel = 50;(Trailing Stop Level (%) (0: Disable))
  • double EquityDrawdownLimit = 0;(Equity Drawdown Limit (%) (0: Disable))
  • bool Grid = true;(Grid Enable)
  • double GridVolMult = 1.2;(Grid Volume Multiplier)
  • double GridTrailingStopLevel = 0;(Grid Trailing Stop Level (%) (0: Disable))
  • int GridMaxLvl = 20;(Grid Max Levels)
  • bool News = false;(News Enable)
  • ENUM_NEWS_IMPORTANCE NewsImportance = NEWS_IMPORTANCE_MEDIUM;(News Importance)
  • int NewsMinsBefore = 60;(News Minutes Before)
  • int NewsMinsAfter = 60;(News Minutes After)
  • int NewsStartYear = 0;(News Start Year to Fetch for Backtesting (0: Disable))
  • bool OpenNewPos = true;(Allow Opening New Position)
  • bool MultipleOpenPos = false;(Allow Having Multiple Open Positions)
  • double MarginLimit = 1500;(Margin Limit (%) (0: Disable))
  • int SpreadLimit = -1;(Spread Limit (Points) (-1: Disable))
  • int Slippage = 30;(Slippage (Points))
  • int TimerInterval = 120;(Timer Interval (Seconds))
  • ulong MagicNumber = 1004;(Magic Number)
  • ENUM_FILLING Filling = FILLING_DEFAULT;(Order Filling)
//+------------------------------------------------------------------+
//|                                                         COT1.mq5 |
//|                                          Copyright 2024, Geraked |
//|                                       https://www.b123.com/ |
//+------------------------------------------------------------------+
#property copyright   "Copyright 2024, Geraked"
#property link        "https://www.b123.com/"
#property version     "1.2"
#property description "A strategy using Commitments of Traders (COT) and Super Trend indicator"
#property description "Multiple Symbols-Daily  2021.01.01 - 2024.01.14"

#include <EAUtils.mqh>
#include <Cot.mqh>
#include <Sql.mqh>

#define PATH_ST "Indicators\\SuperTrend.ex5"
#define I_ST "::" + PATH_ST
#resource "\\" + PATH_ST

input group "Indicator Parameters"
input bool StEnable = false; // SuperTrend Enable
input double StMultiplier = 3; // SuperTrend Multiplier
input int StPeriod = 10; // SuperTrend Period
input ENUM_TIMEFRAMES IndTimeframe = PERIOD_M15; // Timeframe

input group "COT"
input ENUM_COT_CLASS_CO CotPrimaryClass = COT_CLASS_CO_DEALER; // COT Primary Class
input ENUM_COT_MODE CotPrimaryMode = COT_MODE_FO; // COT Primary Mode
input ENUM_COT_CLASS_CO CotSecondaryClass = COT_CLASS_CO_LEV; // COT Secondary Class
input ENUM_COT_MODE CotSecondaryMode = COT_MODE_FO; // COT Secondary Mode

input group "General"
input string OpenTime = "03:00"; // Open Time for Trades
input double TPCoef = 2.0; // TP Coefficient
input ENUM_SL SLType = SL_AR; // SL Type

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

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

请登录后发表评论