Thanks for your reply.
Clearly, on the screenshot, you are showing an order called "Close position" which indicates the position was closed by an entry order in the opposite direction. You are also using ExitLong or ExitShort methods and I suspect you are calling that at the same time you are calling EnterLong or EnterShort. which as I advised previously, "If you call an exit order at the same time as the entry order in the opposite direction, you can create a racing condition which could then end up with 2 orders."
I would suggest you resolve this by using print statements before each enter/exit method to see which one is firing when. If you find an EnterShort when you are calling exitLong or find an EnterLong when calling ExitShort then you have some logic to clean up.
Here is an example: Print (Time[0]+" EnterLong block ");
The print statement will be sent to the New>Ninjascript output window which needs to be open before running the script.
Here is a link to our debugging tips: https://ninjatrader.com/support/help...script_cod.htm

Comment