I get an error message when I test my strategy on historic data. This error comes in two cases:
1. When position is closed automatically at the end of session (ExitOnClose=true).
2. When position is reversed, (enterlong is submitted while short position is open).
Here is the error message:
Error on calling "OnExecution" method for strategy ...: Object reference is not set to an instance of an object.
And here is "OnExecution", as you can see it is completelly empty.
protected override void OnExecution(IExecution execution)
{
if (execution != null && (execution.Order.OrderState == OrderState.Filled || execution.Order.OrderState == OrderState.PartFilled))
{ // do nothing }
}
I believe there is a problem with internal synchronization inside NT, how can it be fixed?
Best regards,
Sergey.
Comment