bool isHistoryLoading; int init(){ isHistoryLoading = true; .. } int start(){ if (isHistoryLoading){ dt=iTime(Symbol(),PERIOD_M1,0); if (dt == 0) return; // or if( !iBars(Symbol(), PERIOD_M1)) return; isHistoryLoading = false; int counted = 0; } else counted = IndicatorCounted(); for(int iBar = Bars - 1 - counted; iBar >= 0; iBar--) { ...}
Problems with ERR_HISTORY_WILL_UPDATED (4066 ) & weekends - MQL4 forum
- www.mql5.com
Problems with ERR_HISTORY_WILL_UPDATED (4066 ) & weekends - MQL4 forum
luenbo:
找到报错原因了,timeseries access函数会出现这样的报错,已经解决了问题。
4066 ERR_HISTORY_WILL_UPDATED Requested history data is in updating state
luenbo 回复说:请求的历史数据正在更新,意思是你的终端正在将数据从经纪商服务器侧下载下来。
1、能说得再详细点么,这个错误是什么时候出出现:比如 :1、是不是在指标刚加载到图表时出现,2 ,是不是在引用其它图表的数据时,会出现这种报错。
2、 解决办法是什么,如果我在指标 的start()函数第一行就加如下语句,对不对?
if(GetlastError()==4066) return(1);
这样会有什么影响,会不会导致指标不正常运行。
3、为什么MQL5 没有4066错误代码