经济日历函数无法正常取值 新评论 Cheng Wang 2020.06.01 23:21 我指定货币代码GBP,并设定了事件取值的时间范围,但是无法取到完整的时间区间内的所有事件时间。这是什么原因呢?请大家帮我看看下面的代码 void OnStart() { //--- int count=0; MqlCalendarEvent calendarEvent[]; MqlCalendarValue calendarValue[]; int events=CalendarEventByCurrency("GBP",calendarEvent); for(int i=0;i<events;i++) { if(calendarEvent[i].importance>1 && calendarEvent[i].type>0 && CalendarValueHistoryByEvent(calendarEvent[i].id,calendarValue,D'2020.05.18 00:01:00',D'2020.06.01 23:59:00')) { Print(calendarValue[0].time); } } } 输出后的时间只有,太奇怪了 2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.20 09:00:00 2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.22 09:00:00 2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.22 09:00:00 2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.22 09:00:00 2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.22 09:00:00 2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.20 09:00:00 2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.20 09:00:00 2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.20 09:00:00 2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.19 09:00:00 2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.19 09:00:00 2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.19 09:00:00 2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.22 02:01:00 2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.21 11:30:00 2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.21 11:30:00 2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.21 11:30:00 Cheng Wang 2020.06.02 04:56 #1 @MetaQuotes help please.thanks Cheng Wang 2020.06.02 12:36 #2 原来是事件ID在设定时间区间内会有重复的现象。如果时间跨度大,将只取前面的事件时间。。 ArraySetAsSeries(Values,true); 这个函数解决了问题,但还是存在BUG,希望官方能对同月内出现的重复经济事件ID能够加标月份来识别。 新评论 原因: 取消 您错过了交易机会: 免费交易应用程序 8,000+信号可供复制 探索金融市场的经济新闻 注册 登录 拉丁字符(不带空格) 密码将被发送至该邮箱 发生错误 使用 Google 登录 您同意网站政策和使用条款 如果您没有帐号,请注册 可以使用cookies登录MQL5.com网站。 请在您的浏览器中启用必要的设置,否则您将无法登录。 忘记您的登录名/密码? 使用 Google 登录
Cheng Wang 2020.06.01 23:21 我指定货币代码GBP,并设定了事件取值的时间范围,但是无法取到完整的时间区间内的所有事件时间。这是什么原因呢?请大家帮我看看下面的代码 void OnStart() { //--- int count=0; MqlCalendarEvent calendarEvent[]; MqlCalendarValue calendarValue[]; int events=CalendarEventByCurrency("GBP",calendarEvent); for(int i=0;i<events;i++) { if(calendarEvent[i].importance>1 && calendarEvent[i].type>0 && CalendarValueHistoryByEvent(calendarEvent[i].id,calendarValue,D'2020.05.18 00:01:00',D'2020.06.01 23:59:00')) { Print(calendarValue[0].time); } } } 输出后的时间只有,太奇怪了 2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.20 09:00:00 2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.22 09:00:00 2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.22 09:00:00 2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.22 09:00:00 2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.22 09:00:00 2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.20 09:00:00 2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.20 09:00:00 2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.20 09:00:00 2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.19 09:00:00 2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.19 09:00:00 2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.19 09:00:00 2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.22 02:01:00 2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.21 11:30:00 2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.21 11:30:00 2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.21 11:30:00
Cheng Wang 2020.06.02 12:36 #2 原来是事件ID在设定时间区间内会有重复的现象。如果时间跨度大,将只取前面的事件时间。。 ArraySetAsSeries(Values,true); 这个函数解决了问题,但还是存在BUG,希望官方能对同月内出现的重复经济事件ID能够加标月份来识别。
我指定货币代码GBP,并设定了事件取值的时间范围,但是无法取到完整的时间区间内的所有事件时间。这是什么原因呢?请大家帮我看看下面的代码
输出后的时间只有,太奇怪了
2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.20 09:00:00
2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.22 09:00:00
2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.22 09:00:00
2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.22 09:00:00
2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.22 09:00:00
2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.20 09:00:00
2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.20 09:00:00
2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.20 09:00:00
2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.19 09:00:00
2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.19 09:00:00
2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.19 09:00:00
2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.22 02:01:00
2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.21 11:30:00
2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.21 11:30:00
2020.06.02 07:20:41.047 04 (AUS200Cash,H1) 2020.05.21 11:30:00