Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Reversing Positions

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

    Reversing Positions

    When running my strategies with TraceOrders=true I get the following in my logs.

    2/11/2009 1:47:00 PM Ignored PlaceOrder() method at 2/11/2009 1:47:00 PM: Action=SellShort OrderType=Limit Quantity=100 LimitPrice=21.89 StopPrice=0 SignalName=SE' FromEntrySignal='' Reason='An Enter() method to submit an entry order has been ignore. Please search on the term 'Internal Order Handling Rules' in the Help Guide for detailed explanation.'
    I've reviewed the contents of the document at http://www.ninjatrader-support.com/H...verview36.html, however I do not see any scenario that applies to me.

    The order that is being ignored in my case is a reversal order from long to short. Below is the code I am using.

    Code:
    [FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]
    // check for long signal
    [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] (Close[[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]] > myprice)
    {
     LE = EnterLongLimit([FONT=Courier New]myprice[/FONT], [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"LE"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]);
    }
    [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]// check for short signal[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]
    [FONT=Courier New][SIZE=2][FONT=Courier New][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] (Close[[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]] < myprice)
    {
     SE = EnterShortLimit([FONT=Courier New]myprice[/FONT], [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"SE"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]);
    }
    [/SIZE][/FONT][/SIZE][/FONT]

    #2
    What is likely happening is that your long limit order is actually still working. Submitting an EnterShortLimit() is not a reversal order in this case because you do not have a long position. Instead you should cancel your EnterLongLimit() first, confirm cancellation, then submit EnterShortLimit().
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Josh View Post
      What is likely happening is that your long limit order is actually still working. Submitting an EnterShortLimit() is not a reversal order in this case because you do not have a long position. Instead you should cancel your EnterLongLimit() first, confirm cancellation, then submit EnterShortLimit().
      I actually do already have a long position when this order is sent and ignored.

      Comment


        #4
        In this case it could be a Set or Exit method active and getting you into the 'Internal Order Handling' when placing the order to reverse.

        Comment


          #5
          Originally posted by NinjaTrader_Bertrand View Post
          In this case it could be a Set or Exit method active and getting you into the 'Internal Order Handling' when placing the order to reverse.
          You are correct. It was due to my exit orders that were working. Thanks for your help!
          Last edited by SystemTrading; 02-19-2009, 10:39 AM.

          Comment


            #6
            Yes, please cancel those and send you reversal order then.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by cmoran13, Yesterday, 01:02 PM
            0 responses
            29 views
            0 likes
            Last Post cmoran13  
            Started by PaulMohn, 04-10-2026, 11:11 AM
            0 responses
            21 views
            0 likes
            Last Post PaulMohn  
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            160 views
            1 like
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            95 views
            1 like
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            148 views
            2 likes
            Last Post CaptainJack  
            Working...
            X