EA:在数据发布前1分钟挂单交易
我写了个简单的EA程序,编译通过了,也能加入到窗口中,但问题是: (1)测试时,报告是空白的 (2)实时运行时,start()好像没有执行,日志中见不到调试行信息。 以下是运行日志和源代码,请高手指点一二: 2009-04-24.log: 08:18:13 PendingOnData_M1 GBPUSD,M1: uninit reason 5 08:18:13 PendingOnData_M1 GBPUSD,M1 inputs: UniqueMagic=20090415; DataTime='2009.04.24 02:15'; DataTitle="美国3月消费者物价指数月率"; AsOCO=true; Lots=0.1; ExpireMinutes=3; onBars=3; PendingGap=100; StopLossGap=100; TakeProfitGap=200; Slippage=30; 08:18:13 PendingOnData_M1 GBPUSD,M1: uninit reason 1 08:18:13 PendingOnData_M1 GBPUSD,M1: removed 08:18:36 PendingOnData_M1 GBPUSD,M1: loaded successfully 08:18:41 PendingOnData_M1 GBPUSD,M1 inputs: UniqueMagic=20090415; DataTime='2009.04.24 02:15'; DataTitle="美国3月消费者物价指数月率"; AsOCO=true; Lots=0.1; ExpireMinutes=3; onBars=3; PendingGap=100; StopLossGap=100; TakeProfitGap=200; Slippage=30; 08:24:06 PendingOnData_M1 GBPUSD,M1: uninit reason 5 08:24:06 PendingOnData_M1 GBPUSD,M1 inputs: UniqueMagic=20090415; DataTime='2009.04.24 02:15'; DataTitle="美国3月消费者物价指数月率"; AsOCO=true; Lots=0.1; ExpireMinutes=3; onBars=3; PendingGap=100; StopLossGap=100; TakeProfitGap=200; Slippage=30; source codes: //+------------------------------------------------------------------+ //| Custom PendingOnData_M1.mq4 | //| 作者:杨志强 2009.04.15 //| 功能:在数据发布前1分钟挂单交易 // //+------------------------------------------------------------------+ #property copyright "杨志强20090415" #property show_inputs extern int UniqueMagic = 20090415; extern datetime DataTime=D'2009.04.15 14:30'; //数据发布时间; extern string DataTitle="美国3月消费者物价指数月率";//数据标题 extern bool AsOCO=true; //是否OCO订单 extern double Lots=0.1; //开单量 extern int ExpireMinutes=3; //有效时间(分钟数) extern int onBars=3;//确定高低点的柱数 extern double PendingGap=100; //挂单距离 extern double StopLossGap=100;//止损距离 extern double TakeProfitGap=200;//止盈距离 extern double Slippage=30; //滑点数 //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int init() { return(0); } //+------------------------------------------------------------------+ //| 重要数据发布前1分钟挂单处理 | //+------------------------------------------------------------------+ int start() { Print(TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES)," PendingOnData_M1.Start()..."); //调试行 int ss = DataTime-TimeCurrent(); if ((ss60)) return(0); //仅在数据发布前1分钟有效 int total=OrdersTotal(); for(int pos=0;pos |
打赏
最新创建圈子
- 新闻EA运行效果图圈 2019-05-05
圈主:admin 帖子:1