如您所知,UNIVERSAL ZIGZAG是一个完整的 Zigzag 专家和指标。我们可以在我们的专家中这样称呼它:
int handle=iCustom(Symbol(),Period(),"iUniZigZagSW",SrcSelect,
DirSelect,
RSIPeriod,
RSIPrice,
MAPeriod,
MAShift,
MAMethod,
MAPrice,
CCIPeriod,
CCIPrice,
ZZPeriod);
通过这几行代码,我们可以得到锯齿形的最后一个高点和低点:
double lhb[], zz[];
if(CopyBuffer(handle,4,0,**1**,lhb)<=0)
{
Print("Error obtaining data from the ZigZag 2");
return;
}
// index of the bar when counting to the right of zero
ind=bars-(int)lhb[0]-1;
// value of the ZigZag at the ind bar
if(CopyBuffer(handle,2,ind,**1**,zz)<=0)
{
Print("Error obtaining data from the ZigZag 3");
return;
}
...
由于我将 1 数字加粗,这些是我们想知道的高点数。
问题是,我怎样才能获得 Zigzag 的最后 3 个或更多高点或低点?
即使增加CopyBuffer(handle,4,0,**1**,lhb)
结果中数组的数量也不正确。
返回不正确的CopyBuffer(handle,2,ind,1..X,zz)
数字或只是 Zigzag 的最后一个高点或低点。