I scripted the following:
protected override void OnExecution(IExecution execution)
{
if (entryOrder != null && entryOrder == execution.Order)
{
if (execution.Order.OrderState == OrderState.Filled || execution.Order.OrderState == OrderState.PartFilled || (execution.Order.OrderState == OrderState.Cancelled && execution.Order.Filled > 0))
{
// Resets the entryOrder object to null after the order has been filled or partially filled
if (execution.Order.OrderState != OrderState.PartFilled)
{
entryOrder = null;
}
}
if(execution.Order.OrderState == OrderState.Cancelled && execution.Order.Filled ==0)
{
DrawText("My text" + CurrentBar, "hier", 0, High[0] + 20 * TickSize, Color.Red);
}
}
...some more code
}
Everything else works as it's supposed to do.
Drawing test when submitting entryorders works. though.
Why is that?
Thanks in advance.
Stephan

Comment