我想求周期为60天振幅的第2个前低距离今天多少天,用如下公式对吗?我测试结果有些问题?复现代码如下:
OnBarOpen(ArrayRef<Integer> indexs)
{
ema60 = XAverage(TrueRange,60);
ema60 = XAverage(ema60,15);//平滑
lopoint60= ema60[1] > ema60[2] and ema60[2] <= ema60[3];
Nth_lo60_2 = NthCon(lopoint60,2);
Nth_lo60_1 = NthCon(lopoint60,1);
PlotBool("lopoint60=", lopoint60,c,green);
PlotNumeric("Nth_lo60_2=", Nth_lo60_2,c,Red);
PlotNumeric("Nth_lo60_1=", Nth_lo60_1,c,Red);
}
我用NtheCon(con,N), N=1在图层看没问题,但在N=2时有问题,值在很长一段时间是不变的?
已经解决,谢谢