怎样识别 Marker closed,跳过去

 

我的主函数是OnTick()驱动的,但是在回测中还是会出现如下的问题

一般都是出现在0点,新的一天交易是从0点15开始的,我很奇怪Marker closed的时候, Ontick()会执行么,如何识别 Marker closed?我好在程序里面跳过

 

Market Close的時候一樣會有Tick發生 

參考品種規格書裡面有標示交易時間跟報價時間 編一個自訂義函數在市場休息時不交易就可以的

 
Hung Wen Lin #:
訂義函數在市場休息時不交易就可以的

请教一下,如何这个函数编写?

 
看这个帖子https://www.mql5.com/en/forum/373227/ 有解决方案
How to check 'Market is closed' befor opening a position? - My expert advisor is trying to open a position immediately at time 00.00, because the market is closed during Friday night and
How to check 'Market is closed' befor opening a position? - My expert advisor is trying to open a position immediately at time 00.00, because the market is closed during Friday night and
  • 2021.07.13
  • www.mql5.com
My expert advisor is trying to open a position immediately at time 00:00. I get 'market is closed' ( trade_retcode_market_closed , error code: 10018) message, because the trading is start only at time 00:01: how can i check in advance if it is possible to open a position