我的程序信号闪烁什么原因??
下面这段程序开仓就出现闪烁,然后闪烁,然后重复开仓,我昨天就同时出现了三次开仓 //------------------------------------------------------------------------ // 简称: zfy_22_L // 名称: 做多循环网格2.2版本,从高价向低价循环 //------------------------------------------------------------------------ Params Numeric qdjglow(18000); // 低价——价格区间 Numeric qdjghi(20000); // 高价——价格区间 Numeric wgjg(500); // 每个网格间格的价格是多少 Numeric Lots(1); // 交易手数 Numeric pc(10); // 平仓时网络处加多少平仓 Vars Numeric qdjg(20000); Numeric i(0); Numeric scount(1); // 循环次数 Series<Array <Numeric>>nft; Numeric nf(0); Events OnBar(ArrayRef<Integer> indexs) { qdjg=qdjghi; scount=(qdjghi-qdjglow)/wgjg; For i = 0 To scount { if(nft[1][i]==1) nft[0][i]=nft[1][i]; Else nft[0][i]=0; } For i = 0 To scount { nf=nft[0][i]; // 开多仓 If(High[1] >=qdjg-wgjg*i And low[1] <= qdjg-wgjg*i And nf == 0 and low>qdjglow and low<qdjghi) { Buy(Lots, qdjg-wgjg*i); nft[0][i]=1; Commentary("1n"+text(i)); Break; } Else { // 平多仓 If( high >= qdjg-wgjg*(i-1)+pc And nf == 1) { Sell(Lots, qdjg-wgjg*(i-1)+pc); nft[0][i]=0; Commentary("2n"+text(i)); Break; } } } }