4066是历史数据没有刷新的缘故,多试几次即可。
MarketClosed = iVolume(NULL,PERIOD_D1,0)<5;
int error = GetLastError();
if(error==4066)
{
ResetLastError();
for(int i = 0; i<2;i++)
{
Sleep(5000);
MarketClosed = iVolume(NULL,PERIOD_D1,0)<5;
}
}
发表评论