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 Stanfillirenfro, Today, 07:23 AM
      1 response
      2 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by cmtjoancolmenero, Yesterday, 03:58 PM
      2 responses
      19 views
      0 likes
      Last Post cmtjoancolmenero  
      Started by olisav57, Yesterday, 07:39 PM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by cocoescala, 10-12-2018, 11:02 PM
      7 responses
      943 views
      0 likes
      Last Post Jquiroz1975  
      Started by oviejo, Today, 12:28 AM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Working...
      X