Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exit() error message

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Exit() error message

    I'm getting the following error whilst running an optimization excercise:

    'An Exit() method to submit an exit order at '04/08/2013 23:10:00' has been ignored. Please search on the term 'Internal Order Handling Rules' in the Help Guide for detailed explanation.'

    I can't work out what exactly is causing this and therefore how to fix it. Please find my code below:

    Code:
    			if (ToTime(Time[0]) >= (Time_Start*10000) && ToTime(Time[0]) <= ((Time_Start*10000)+((Time_Gap*10000)-4500)))
    			{if (CrossAbove(MA_Series1, MA_Series2, 1))
    			{if (myEntryOrderS != null)
    				CancelOrder(myEntryOrderS);
    				myEntryOrderL = EnterLongStop(0, true, 1, High[0] + (TickSize*Tick_Size), "L");}
    			else if (CrossBelow(MA_Series1, MA_Series2, 1))
    			{if (myEntryOrderL != null)
    				CancelOrder(myEntryOrderL);
    				myEntryOrderS = EnterShortStop(0, true, 1, Low[0] - (TickSize*Tick_Size), "S");}}
    			else
    			{if (CrossAbove(MA_Series1, MA_Series2, 1))
    			{if (myExitOrderEL != null)
    				CancelOrder(myExitOrderEL);
    				myExitOrderES = ExitShortStop(0, true, 10000, High[0] + (TickSize*Tick_Size), "ES", "S");}
    			else if (CrossBelow(MA_Series1, MA_Series2, 1))
    			{if (myExitOrderES != null)
    				CancelOrder(myExitOrderES);
    				myExitOrderEL = ExitLongStop(0, true, 10000, Low[0] - (TickSize*Tick_Size), "EL", "L");}}
    				#endregion
    Any ideas would be much appreciated.

    Kind Regards,
    Harry Seager

    #2
    The only way to find out which order is causing this message would be to debug it one step at a time.

    Before doing that I would suggest reading this section at the bottom here: http://www.ninjatrader.com/support/h...d_approach.htm

    Looking at the code my assumption is that one of these two exit methods is being called when there is an entry in the opposite direction

    Code:
    	{if (CrossAbove(MA_Series1, MA_Series2, 1))
    			{if (myExitOrderEL != null)
    				CancelOrder(myExitOrderEL);
    				myExitOrderES = ExitShortStop(0, true, 10000, High[0] + (TickSize*Tick_Size), "ES", "S");}
    			else if (CrossBelow(MA_Series1, MA_Series2, 1))
    			{if (myExitOrderES != null)
    				CancelOrder(myExitOrderES);
    				myExitOrderEL = ExitLongStop(0, true, 10000, Low[0] - (TickSize*Tick_Size), "EL", "L");}}
    For tips on debugging (when dealing with crosses I find that drawing objects are a really useful tools): http://www.ninjatrader.com/support/f...ead.php?t=3418

    Let me know if I can further assist
    LanceNinjaTrader Customer Service

    Comment


      #3
      Thanks for this. I'll give the debugging a go.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      77 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      45 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      27 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      32 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      63 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X