while循环当手数加到一定数值时不要再开仓,为何这代码控制不了手数
2022-12-13 16:55

while(Low <= prePrice - GapNum*MinPoint and SendOrderThisBar == False) // 以最低价为标准,判断能进行几次增仓
                {
                    EnPrice = prePrice - GapNum * MinPoint + Slippage*MinPoint;
                    myEntryPrice = prePrice - GapNum * MinPoint;
                    myEntryPrice = IIF(myEntryPrice > Open, Open,myEntryPrice);
                    prePrice = myEntryPrice;
                    Buy(Lot,EnPrice);
                    SendOrderThisBar = True;
                    AlLot = preAlLot + Lot;
                    preAlLot = AlLot;
                    If (preAlLot > 20) Break;
                }
    

评论区
顶部