My bot should do the following. Every New York Open it should place a Stop Limit order both to the the buy and sell side. Also the orders should expire the same day, ensuring the bot places a trade every day. However when I backtest, the bot doesn't place a trade everyday. Any idea why?
protected override void OnTick()
var Hour = Server.Time.TimeOfDay.TotalHours;
if (Hour == EntryTime)
PlaceStopLimitOrder(TradeType.Buy, SymbolName, VolumeInUnits, Symbol.Ask + (Entry * Symbol.PipSize), 0.0, "NY Open", SL, TP, Server.Time.AddHours(12));
PlaceStopLimitOrder(TradeType.Sell, SymbolName, VolumeInUnits, Symbol.Bid - (Entry * Symbol.PipSize), 0.0, "NY Open", SL, TP, Server.Time.AddHours(12));