指标刷新问题

 
发现有好多指标,不能及时刷新。手工切换至其它时间图后再切换回来就立刻刷新了。有没有强制它刷新的方法?

一般指标主程序格式:


int start()
{
int limit;
int counted_bars=IndicatorCounted();

//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;

for(int i=0; i<limit; i++)

{
...指标计算及数据缓存赋值语句

}


//---- done
return(0);

}

 
Jimi Liu:
发现有好多指标,不能及时刷新。手工切换至其它时间图后再切换回来就立刻刷新了。有没有强制它刷新的方法?

一般指标主程序格式:


int start()
{
int limit;
int counted_bars=IndicatorCounted();

//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;

for(int i=0; i<limit; i++)

{
...指标计算及数据缓存赋值语句

}


//---- done
return(0);

}


我也遇到这样的问题。有高手老师出来帮下吗?

 
Jimi Liu:
发现有好多指标,不能及时刷新。手工切换至其它时间图后再切换回来就立刻刷新了。有没有强制它刷新的方法?

一般指标主程序格式:


int start()

参考 ChartRedraw() 函数。

另外,int start() 是 MQL4 旧版指标函数,建议用新的函数格式。

原因: