信号闪烁
highprice = Highest(high[1], IntPart(0.5 * Length));lowprice = Lowest(low[1], IntPart(0.5 * Length)); malong = (high > highprice and highprice > highprice[IntPart(0.5 * Length)] and highprice[IntPart(0.5 * Length)] > highprice[IntPart(1 * Length)]) ; mashort = (low < lowprice and lowprice < lowprice[IntPart(0.5 * Length)] and lowprice[IntPart(0.5 * Length)] < lowprice[IntPart(1 * Length)]);if (malong) { Flag = -1; StartIndex = CurrentBar; Commentary(\"Long\"); } if (mashort) { Flag = 1; StartIndex = CurrentBar; Commentary(\"Short\"); } Commentary(\"CurrentBar - StartIndex222:\" + Text(CurrentBar - StartIndex)); Commentary(\"BarsSinceEntry:\" + Text(BarsSinceEntry)); //信号连续触发,信号持仓周期增加if(Flag == 1 and CurrentBar - StartIndex == Waitbar + nextbar ) { Buy(1, Enterprice); LossPrice = Enterprice - 100 * MinMove() * PriceScale(); ProfitLossFlag = False; }if(Flag == -1 and CurrentBar - StartIndex == Waitbar + nextbar ) { SellShort(1, Enterprice); LossPrice = Enterprice + 100 * MinMove() * PriceScale(); Commentary(\"OPenPrice:\" + Text(OPenPrice)); ProfitLossFlag = False; } if (MarketPosition == 1 and (BarsSinceEntry >= Closebar + nextbar - Waitbar ) ) { Sell(1,Enterprice); } if (MarketPosition == -1 and (BarsSinceEntry >= Closebar + nextbar - Waitbar ) ) { BuyToCover(1,Enterprice); }代码如上所示,进行一个简单测试,为什么这样还是会有信号闪烁的问题(主要是开仓信号)?