1赞

3评论

2收藏

用ChatGPT尝试编写的EA

avatar 陶飞 | 2304 人阅读 | 3 人评论 | 2023-05-30

2125600.jpg.jpg

有没有尝试过用ChatGPT编写EA,很遗憾,还是需要人工修正。

//+------------------------------------------------------------------+
//|                                  Future BreakdownLevelDay.mq4 |
//|                                 Copyright 2011-2023, Justin Tao  |
//|     微信:taofei7456  或者 taofei007            @qq.com   |
//+------------------------------------------------------------------+
#property copyright "Copyright 2011-2023, Justin Tao"
#property link      "taofei007@qq.com"
//--------------------------------------------------------------------
extern string TimeSet      = "00:00";  //Order place time, if TimeSet = "00:00", the EA works on the breakdown of the previous day.
extern int    Delta        = 6,        //Order price shift (in points) from High/Low price
              SL           = 2000,      //Stop Loss (in points)
              TP           = 2000,       //Take Profit (in points)
              risk         = 0,        //if 0, fixed lot is used
              NoLoss       = 0,        //if 0, it doesn't uses break-even
              trailing     = 0;        //if 0, it doesn't uses trailing
extern double Lot          = 0.10;     //used only if risk = 0
extern bool   OpenStop     = true;     //Place stop orders if order is opened
extern color  color_BAR    = DarkBlue; //info color
//--------------------------------------------------------------------
double        MaxPrice,MinPrice;
int           STOPLEVEL,magic=123321,tip,TimeBarbuy,TimeBarSell,LastDay;
//--------------------------------------------------------------------
int init()
{
   STOPLEVEL = MarketInfo(Symbol(),MODE_STOPLEVEL);
   if (SL < STOPLEVEL) SL = STOPLEVEL;
   if (TP < STOPLEVEL) TP = STOPLEVEL;
   if (NoLoss   < STOPLEVEL && NoLoss   != 0) NoLoss   = STOPLEVEL;
   if (trailing < STOPLEVEL && trailing != 0) trailing = STOPLEVEL;
   Comment("Copyright ?2011 cmillion@narod.ru\n BreakdownLevelDay input parameters"+"\n"+
      "TimeSet   "   , TimeSet,           "\n",
      "Delta       " , Delta,             "\n",
      "SL           ", SL,                "\n",
      "TP          " , TP,                "\n",
      "Lot          ", DoubleToStr(Lot,2),"\n",
      "risk         ", risk,              "\n",
      "NoLoss    "   , NoLoss,            "\n",
      "trailing     ", trailing);
   if (TimeSet=="00:00") LastDay=1;
}
具体详见附件

""
还没有人打赏,支持一下

评论|共 3 个

陶飞

发表于 2023-5-30 23:18:43 | 显示全部楼层

不错的历史回测,品种SP500
截屏2023-04-07 21.26.24.png
截屏2023-04-07 21.41.39.png

均鸣

发表于 2024-8-8 13:15:39 | 显示全部楼层

大漠枭雄

发表于 2024-9-26 18:46:45 | 显示全部楼层

顶下

您需要登录后才可以回帖 登录 | 注册 微信登录

EA之家评论守则