When I run my trading system in simulation, I find all bid & ask price always equals 0, it causes my order never get filled. Maybe I can use other price for backtest, but I don't wanna change my code for simulation and live separately.
Here's my code snippet:
PositionSettings settings = new PositionSettings();
settings.PositionType = signal == TradeSignal.Long ? PositionType.Long :
settings.LimitPrice = signal == TradeSignal.Long ? Ask.Current : Bid.Current;
settings.OrderType = OrderType.Limit;
settings.Size = 1;
settings.BarsValid = -1;
settings.BarCountExit = -1;
settings.StopLossType = TargetPriceType.AbsolutePrice;
settings.StopLoss = signal == TradeSignal.Long ? BarUtils.LowestLow(Bars, 2) :
So could you please tell me there is a way to figure this out?
Thanks in advance