Totally Ignores EnterLong/Short

Ninjatrader sometimes totally ignores the API call EnterLong EnterShort. I have seen this happen when I try to create more than 5 market orders in a loop…the code is executing on the strategy thread.
In today’s instance for a strategy running on a demo account the first 6 calls to EnterShort resulted in orders being submitted and OnOrderUpdate got invoked in submitted status for that signal name…while the 7th invocation to EnterShort in that loop, the signal name used in that invocation never turned up in OnOrderUpdate in the state submitted or any other state like rejected cancelled…nothing.

This is not good, if the API call to EnterShort is successful, ninjatrader should guarantee that an update for that order will be provided in OnOrderUpdate…maybe they can introduce a new state called Ignored, and do a callback on OnOrderUpdate with the state Ignored…so atleast I know my order did not go through for whatever reason.

Has anyone noticed this bug, does anyone know if this bug is unique to demo accounts or do they happen on live accounts as well.

Thanks.

This appears to be managed mode.

What is the value of EntryHandling?
What is the value of EntriesPerDirection?

Have you tried using unmanaged mode?
(That is most likely the best solution anyways.)

Managed mode is, by design, a very constrained environment.

            EntriesPerDirection = 99;
            EntryHandling = EntryHandling.UniqueEntries;

I assign a unique signal name everytime i invoke EnterLong and EnterShort.

my trader is pretty stable, at this point this is the only one problem i have noticed, maybe I will write a demo strategy to replicate the problem and see what is the bottleneck regarding how quickly one can invoke EnterShort or EnterLong successively, I can see in my case that my strategy was invoking EnterLong for the 7th time even before the first invocation reached the state submitted.

I had the exact same strategy running on both the live and demo account, and on demo account the problem re-occured, this time with the third ExitLong function when it was being invoked in a loop.
Now either it is a defect with the demo account of ninjatrader, or it is a problem because both the exit signal name was identical.

The demo account is susceptible to randomly ignoring EnterLong/Short…and this is happening even when the load is not heavy, maybe a couple of market orders are getting fulfilled and few ticks later I have placed another EnterLong/Short and it never turns up in any state submitted/rejected/cancelled in OnOrderUpdate.

This is very random and rare but happens on demo (never seen this happen on live), maybe couple of times a week.

Very strange and very bad because if an invocation to EnterLong/Short is successful there should be guaranteed status update on OnOrderUpdate.

It is most likely that you are calling an Enter/Exit method that is incompatible with your current position, or that the call is incorrectly configured (for example, a Limit or Stop price that is incompatible with the current market price).

To help you identify the issue:

  • Review the log and trace files.
  • Add Print statements at all critical points to build your own log and see how orders evolve.
  • Add try–catch blocks to all methods to capture and print exceptions to your log.

yes everything is in place i have my logs clearly showing that the market order that was placed prior to this one and the one after this one, all went through perfectly.
The problem is so intermittent that it is not possible to even replicate it…it is very clear that when multiple market orders are being placed in a loop some of them simply get dropped, they never appear in OnOrderUpdate even though the call to EnterLong/Short went through without any errors.
And this happens only on demo.

It’s really strange that not many people or rather no one has noticed this, maybe not many people are running strategies on demo where a for loop is creating 7 or more market orders each with a unique signal name.

Have you used TraceOrders yet?

Yes have never turned it off…grok says its a known issue with manged orders they cant manage to put so many orders on a sim account…