I have a issue with a daily loss limit for MULTIPLE ORDERS
Lets say by default it is $275.
private int lossLimit = 275;
I use IOrder Array for multiple orders.
private IOrder[] entryOrders = new IOrder[4];
I have this example from Ninja Trader Support. The program works very well. It stops whenever I have my daily loss of 275.
However, if I add a CANCEL ORDER method to the program then IT DOESN’T WORK AT ALL. It continues to run the strategy when my daily stop loss hit. Simply saying it doesn't stop.
if (entryOrders[1] != null && CurrentBar >= barNumbOfShorOrder1 + 1)
{ CancelOrder(entryOrders[1]);
entryOrders[1] = null;}
I back tested on 11/02/2015 it supposed to stop at 4:30 am because of my daily loss hit and no more trading till the end of the session. However it continues to run.
Daily Loss Limit for Multiple orders are very important to me because this is a RISK MANAGEMENT of my strategy
Do you how to fix this strategy?
STRATEGY FILE INCLUDED
Thanks,
Serge
Comment