{
entryValue = High[0] + 5*TickSize;
if (Position.MarketPosition == MarketPosition.Flat && entryOrder == null && TradingTime(Time[0]))
{
EnterLongStopMarket(1, true, DefaultQuantity, entryValue, "long stop entry");
}
}
}
{
if (ToTime(time)>=StartTime && ToTime(time)<=StopTime)
{
return true;
}
return false;
}
if (entryOrder != null && TradingTime(Time[0]) == false)
{
CancelOrder(entryOrder);
Print( TradingTime(Time[0])+ " CancelOrder Trading time is: " + ToTime(Time[0]));
}
I am checking what time the order has been submitted (backest) with OnOrderUpdate()
{
// Checks for all updates to entryOrder.
if (entryOrder == null && order.Name == "long stop entry")
{
entryOrder = order;
Print("Order accepted at " + time.ToString());
}
The printout is the following:
Could you please help me to understand why the order is sumbitted before the TradingTime() condition, starting at 110000, is true?
Thank you
Martin
PS
attached the strategy
I am using NT8, please move my reply if needed. Just did not wat to open a new topic as the subject is similar

Comment