[警告关闭!]任何新手问题,为了不给论坛添乱。专业人士,不要走过。没有你,哪里都不能去。 - 页 96

 
timbo >> :

观点

双倍积分
当前工具在报价货币中的点数大小。
另见MarketInfo()
例子。



其背景是,如果你把这个脚本附加到GBPUSD以外的货币上,就会发生一个算法错误。因为Point是仪器的一个点,脚本是在其窗口中输入的。

 

你好。我写了一个 基于WPR快速的多货币指标。但它没有自动更新,显示的是4条前的最后数据。

如果可以的话,请修复这个错误。

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 White
#property indicator_color2 Blue

//---- input parameters
extern int P = 14;
extern int n1 = 14;
extern int n2 = 14;
extern int CountBars=3500;

//---- buffers
double val1[];
double val2[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   string short_name;
//---- indicator line
   IndicatorBuffers(2);
   SetIndexStyle(0,DRAW_ARROW, EMPTY);
   SetIndexArrow(0,108);
   SetIndexBuffer(0, val1);
   SetIndexEmptyValue(0,0.0);
   SetIndexStyle(1,DRAW_ARROW, EMPTY);
   SetIndexArrow(1,108);
   SetIndexBuffer(1, val2);
   SetIndexEmptyValue(1,0.0);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| AltrTrend_Signal_v2_2                                            |
//+------------------------------------------------------------------+
int start()
  { double F_u_EUR, F_u_GBP, F_d_EUR, F_d_GBP;
   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=3; i< limit; i++)
{ 

	F_u_EUR=iCustom("EURUSD",15,"WPRfast", P, n1, n2,3000,0, i);
	F_d_EUR=iCustom("EURUSD",15,"WPRfast", P, n1, n2,3000,1, i);
	F_u_GBP=iCustom("GBPUSD",15,"WPRfast", P, n1, n2,3000,0, i);
	F_d_GBP=iCustom("GBPUSD",15,"WPRfast", P, n1, n2,3000,1, i);

if ( F_u_EUR>0&& F_u_GBP>0)
{
	val1[ i]=High[ i]+35*Point;
}
if (0> F_d_EUR&&0> F_d_GBP) 
{
	val2[ i]=Low[ i]-35*Point;
}


}
   return(0);
  }
//+------------------------------------------------------------------+
附加的文件:
wprfast.mq4  3 kb
 
为什么你用int i=3开始循环
 
Roger >> :
为什么你的循环从int i=3开始

哦,伙计,这就对了。这就是为什么数据是在三条前给出的。我从多价分形中提取了框架,没有注意到。

如何让它刷新数据?

 
如果你把它设置为零,它将立即更新。
 
谢谢你,罗杰!
 

是否有可能在MT4中限制接收报价,而不是每一个tick,而是,比方说,每分钟一次?

在Sleep()程序中是否可以接收报价?

 
gorby777 писал(а)>>

是否有可能在MT4中限制接收报价,而不是每一个tick,而是,比方说,每分钟一次?

在Sleep()过程中,是否可以接收报价?

你不能限制报价的接收。但我们可以以一定的周期性来处理报价。

Sleep()并没有阻止报价的到来,只是在市场环境没有更新的情况下,专家顾问看不到它们。

 
Vinin >> :

不可能限制对报价的接受。但有可能以一定的周期性来处理报价。

Sleep()并没有阻止报价的到来,专家顾问只是在不更新市场环境的情况下看不到它们。

谢谢,尽我所能地理解。我只对限制进入的流量感兴趣。

 
gorby777 >> :

谢谢,尽我所能地理解。我只对限制进入的流量感兴趣。

如果流量对你来说至关重要,最有效的方法是限制市场观察窗口中使用的字符数。

原因: