I've been looking through different strategies that people have posted and I ran across this code that I can't quite understand what's going on. Can anyone explain what this code does?
private void CancelEntryOrder()
{
if (entryOrder == null) return;
if (entryOrder.OrderState == OrderState.Filled) {
if (entryOrder.IsLong)
ExitLong();
else
ExitShort();
}
else {
CancelOrder(entryOrder);
}
ResetState();
}
Comment