Cant enter two order at the same time

Hi all!

Im trying to create a strategy and im back testing the strategy. I want to put 2 orders on market at the same time. But with diferents take profit and stop loss. But Ninjatrader only recognise the first. Why the second order isn’t working?

My code for the entries is:

              >   TIXStopLoss = 16;
                TIXTakeProfit = 32;
                EnterLong(1, "EnterLong");
                SetStopLoss("EnterLong", CalculationMode.Ticks, TIXStopLoss / 2, false);
                SetProfitTarget("EnterLong", CalculationMode.Ticks, TIXStopLoss * 2, false);

                EnterLong(1, "EnterLong Runner");
                SetStopLoss("EnterLong Runner", CalculationMode.Ticks, TIXStopLoss, false);
                SetProfitTarget("EnterLong Runner", CalculationMode.Ticks, TIXTakeProfit, false);

Kind regards.

1 Like

Try checking the “Entries per direction” on the default properties page of the strategy builder. I’m not absolutely sure that will solve your issue but it might be a starting point.

Good luck

1 Like

Entries Per Direction is absolutely the starting point for that.

I have this OnStateChange:

EntriesPerDirection = 4;
EntryHandling = EntryHandling.AllEntries;

This is not the problem :frowning:

OK. Next step use TraceOrders to get the reason the entry is ignored.