请教偷价

Params //此处添加参数(单周期多空) Numeric Length(14); //周期 Numeric N1(5); //5日均线 Numeric N2(20); //20日均线 Numeric N3(80); //80日均线 Numeric N4(20); //过去20根k线最高价参数 Numeric N5(1); // MA80 - MA20 > 多少倍atr,建议用1倍而不是5倍,因为80均线的值其实跟20均线差不了多少,除非行情波动大 Numeric TakeProfitSet(100); // 固定止盈点数 Numeric StopLossSet(75); // 固定止损点数 Numeric Time1(0.090500); //早盘开仓时间 Numeric Time2(0.144000); //早盘开仓时间 Numeric Time3(0.210500); //夜盘开仓时间 Numeric Time4(0.235500); //夜盘开仓时间 Numeric Time5(0.145500); //早盘平仓时间 Numeric Time6(0.022500); //夜盘平仓时间 Numeric Time7(0.000000); //夜盘开仓时间 Numeric Time8(0.020000); //夜盘开仓时间 Numeric Lost(1); //开仓手数Vars //此处添加变量 Series<Numeric> MA5; Series<Numeric> MA20; Series<Numeric> MA80; Series<Numeric> ATR; Series<Bool> MAUP1; Series<Bool> MAUP3; Series<Bool> MADK; Series<Bool> MADOWN1; Series<Bool> MADOWN3; Series<Bool> MA1; Series<Bool> MA2; Numeric MinPoint; Numeric MyEntryPrice; Numeric MyExitPrice; Events //此处实现事件函数 OnInit() { //与数据源有关 Range[0:DataCount-1] { //=========数据源相关设置============== //AddDataFlag(Enum_Data_RolloverBackWard()); //设置后复权 AddDataFlag(Enum_Data_RolloverRealPrice()); //设置映射真实价格 AddDataFlag(Enum_Data_AutoSwapPosition()); //设置自动换仓 AddDataFlag(Enum_Data_IgnoreSwapSignalCalc()); //设置忽略换仓信号计算 } } //Bar更新事件函数,参数indexs表示变化的数据源图层ID数组 OnBar(ArrayRef<Integer> indexs) { MA5 = AverageFC(Close,N1); MA20 = AverageFC(Close,N2); MA80 = AverageFC(Close,N3); ATR = AvgTrueRange(Length); MA1 = Close > Highest(High[1],N4); MA2 = Close < Lowest(Low[1],N4); MAUP1 = Close > MA5 && MA5 > MA20 && MA20 > MA80 && Close > Open; MAUP3 = Close > MA5 && MA5 > MA20 && Close > Highest(High[1],N4) && Close > Open; MADOWN1 = Close < MA5 && MA5 < MA20 && MA20 < MA80 && Close < Open; MADOWN3 = Close < MA5 && MA5 < MA20 && Close < Open; MADK = MA80 - MA20 > N5*ATR; PlotNumeric("MA5",MA5); PlotNumeric("MA20",MA20); PlotNumeric("MA80",MA80); MinPoint = MinMove*PriceScale; MyEntryPrice = AvgEntryPrice; If(MarketPosition == 0 && MAUP1[1] && MA1[1] && ((time >= Time1 && Time <= Time2) Or (time >= Time3 && Time <= Time4) Or (time >= Time7 && Time <= Time8))) { Buy(Lost,Open); PlotAuto("多","多1",High +50,Red); } /*If(MarketPosition == 0 && MAUP3[1] && MADK[1] && ((time >= Time1 && Time <= Time2) Or (time >= Time3 && Time <= Time4) Or (time >= Time7 && Time <= Time8))) { Buy(Lost,Open); PlotAuto("多","多2",High +50,Red); }*/ If(MarketPosition == 0 && MADOWN1[1] && MA2[1] && ((time >= Time1 && Time <= Time2) Or (time >= Time3 && Time <= Time4) Or (time >= Time7 && Time <= Time8))) { SellShort(Lost,Open); PlotAuto("空","空1",High + 20,Green); } /*If(MarketPosition == 0 && MADOWN3[1] && MADK[1] && ((time >= Time1 && Time <= Time2) Or (time >= Time3 && Time <= Time4) Or (time >= Time7 && Time <= Time8))) { SellShort(Lost,Open); PlotAuto("空","空2",High + 20,Green); }*/ If(MarketPosition == 1 && BarsSinceEntry >= 1) { If(High >= MyEntryPrice + TakeProfitSet*MinPoint) { MyExitPrice = MyEntryPrice + TakeProfitSet*MinPoint; If(Open > MyExitPrice) MyExitPrice = Open; Sell(0,MyExitPrice); } Else If(Low <= MyEntryPrice - StopLossSet*MinPoint) { MyExitPrice = MyEntryPrice - StopLossSet*MinPoint; If(Open < MyExitPrice) MyExitPrice = Open; Sell(0,MyExitPrice); } } If(MarketPosition == -1 && BarsSinceEntry >= 1) { If(Low <= MyEntryPrice - TakeProfitSet*MinPoint) { MyExitPrice = MyEntryPrice - TakeProfitSet*MinPoint; If(Open < MyExitPrice) MyExitPrice = Open; BuyToCover(0,MyExitPrice); } Else If(High >= MyEntryPrice + StopLossSet*MinPoint) { MyExitPrice = MyEntryPrice + StopLossSet*MinPoint; If(Open > MyExitPrice) MyExitPrice = Open; BuyToCover(0,MyExitPrice); } } If(MarketPosition == 1 && BarsSinceEntry > 0 && (Time == Time5 Or Time == Time6)) { Sell(0,Open); } If(MarketPosition == -1 && BarsSinceEntry > 0 && (Time == Time5 Or Time == Time6)) { BuyToCover(0,Open); } }老师你好,请问我这段代码有没有信号闪烁的问题?有的话,请帮我指出来,我好改进一下,谢谢

这边看了一下,这个代码应该是不会出现信号闪烁的。