刷新图表窗口 - 页 2

 

问题 "可能是指标使用了一个限制,即IndicatorCounted() 函数
以便不重新绘制条形图。

改变时间框架会重置,WindowRedraw()可能不会。它的功能是重绘对象,而不是指标索引。

void WindowRedraw() )
强制重绘当前图表。这通常是在对象的属性被改变后使用。

我知道在我写的大多数东西上,我通常会去重新计算1000条左右,而这是由右键点击启动的。
这是由右键刷新开始的。

如果你不严格限制指标的循环,你会在每个tick上得到一个指标刷新。

 
?有些人有一些线索,这是怎么回事?为什么我在使用WindowRedraw()后没有看到任何效果?

非常感谢。
 

你是 "阅读困难 "吗?

 
嗨,Phy。

在将近两个月后,我收到了你的最后一次回复。我只是不知道我是如何跳过的。我在 "重新绘制我的指标 "方面仍有问题。现在我将尝试用你给我的信息来解决这个问题。非常感谢你,,。
 

显示你的代码...

 
brspMA:
hi phy, 就在近两个月后,我收到了你的最后一次回复。我只是不知道我是怎么跳过的。我在 "重绘我的指标 "方面仍然有问题。现在我将尝试用你给我的信息来解决这个问题。非常感谢你,,,


我读了这个主题,我认为你的代码中存在一个问题=>WindowRefresh()函数 不会帮助你。
 
嗨,

,我想我是想重置指标,迫使它从头再画一遍!?我的问题是,我正在使用一个函数,在函数中改变过去的数据的新数据,结果是我的图表在时间上变成了一团。我需要定期重绘我的整个指标。最近,我一直在改变时间框架,所以当我回到原来的时间框架时,我的图表窗口是干净的(重绘)。以下是我的代码模式:

int start(){
   int limit;
   int counted_bars=IndicatorCounted();
   //---- check for possible errors
   if(counted_bars<0) return(-1);
   //---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
   if (limit>GV) limit = GV;
   //---- main loop
   for(int i=limit; i>=1; i--){
 
 
{calculates the variable and feed the buffers}
 
return(0);}
非常感谢,,。
 
在你的代码中插入2行

int start(){
   int limit;
   int counted_bars=IndicatorCounted();
   //---- check for possible errors
   if(counted_bars<0) return(-1);
   //---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
 
   double startTime=GetTickCount();
   if (limit>GV) limit = GV;
   //---- main loop
   for(int i=limit; i>=1; i--){
 
 
{calculates the variable and feed the buffers}
 
   double finishTime=GetTickCount();
   Print("Calculation time is ",(finishTime-startTime)/1000.0," seconds");
return(0);}
 

什么是GV?

我最近一直在做的事情,是这样的。

for( int i = MathMax(WindowFirstVisibleBar(), Bars-IndicatorCounted()); i>= 0; i--) {

它在每个tick 上重绘指标的可见部分,但不重绘看不见的条。

 
phy:

什么是GV?

我最近一直在做的事情,是这样的。

for( int i = MathMax(WindowFirstVisibleBar(), Bars-IndicatorCounted()); i>= 0; i--) {

它在每个tick上重绘指标的可见部分,但不重绘看不见的条。


GV是一个全局变量,我用来根据我想回溯测试的时间长短来设置限制。

你们真了不起!我将在今天下午实现这段代码。

for( int i = MathMax(WindowFirstVisibleBar(), Bars-IndicatorCounted()); i>= 0; i--){
谢谢你们的慷慨解囊,,。