Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Managed Entry / Exit randomly ignored

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

    Managed Entry / Exit randomly ignored

    I have been using NinjaTrader for years and don't think I've ever seen this before. I have two machines with the same version of NT, 7.0.1000.22. One machine is Windows Server 2008 and one is Windows 8.1, both are 64 bits. On the Windows Server 2008 machine, I was seeing managed orders being ignored. At first I thought it was due to end of day conditions, where an order is placed at 4PM right when the market is closing and was getting ignored (actually that is a different condition that I also have a question on). For this question / bug, however, I have an order in the middle of the day. It is at 12:30PM on an historical bar of 11/27/2009 for an EnterLong. The bars are 60 minute bars on TF instrument. The next bar I exit the long, so this is on 11/27/2009 at 13:30. In the debugger I see that the Position.MarketPosition is Long at 13:30, as it should be from the EnterLong at 12:30. I see it call ExitLong at 13:30, but the next bar, at the start of the next bar, Position.MarketPosition is still Long!

    Note that all Entry / Exits are simple managed market orders.
    Last edited by tradetree; 06-28-2014, 03:10 PM.

    #2
    Hello Tradetree,

    Thank you for your note.

    Are you running TraceOrders = true in the Initialize() method?

    I would recommend running this, as this will print to the output window if and why the Exit order would get ignored.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Maybe you can interpret these two cases below. What is the "end of session handling" and what controls how it behaves? In the first case I have better understanding, because it is 4:00PM when the order is placed. But the second case is 1:30PM.

      4/16/2009 4:00:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Ticks Value=0 Currency=2500 Simulated=False
      4/16/2009 4:00:00 PM Entered internal PlaceOrder() method at 4/16/2009 4:00:00 PM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='EL1' FromEntrySignal='L1'
      4/16/2009 4:00:00 PM Cancelled order due to end of session handling: BarsInProgress=0: Order='NT-00196/Sim101' Name='EL1' State=Working Instrument='TF 09-14' Action=Sell Limit price=0 Stop price=0 Quantity=1 Strategy='TradetreeSignals_TC' Type=Market Tif=Day Oco='' Filled=0 Fill price=0 Token='c52fb25fe363496b885d9fc2bd94291f' Gtd='12/1/2099 12:00:00 AM'
      4/20/2009 10:30:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Ticks Value=0 Currency=2500 Simulated=False

      11/27/2009 12:30:00 PM Entered internal PlaceOrder() method at 11/27/2009 12:30:00 PM: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='L1' FromEntrySignal=''
      11/27/2009 1:30:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Ticks Value=0 Currency=2500 Simulated=False
      11/27/2009 1:30:00 PM Entered internal PlaceOrder() method at 11/27/2009 1:30:00 PM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='EL1' FromEntrySignal='L1'
      11/27/2009 1:30:00 PM Cancelled order due to end of session handling: BarsInProgress=0: Order='NT-00413/Sim101' Name='EL1' State=Working Instrument='TF 09-14' Action=Sell Limit price=0 Stop price=0 Quantity=1 Strategy='TradetreeSignals_TC' Type=Market Tif=Day Oco='' Filled=0 Fill price=0 Token='09900dd32b71478ebd5e605cac6d86be' Gtd='12/1/2099 12:00:00 AM'
      11/30/2009 10:30:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Ticks Value=0 Currency=2500 Simulated=False

      This is from a different version of the strategy on another computer (same two points in time):
      4/16/2009 4:00:00 PM Entered internal PlaceOrder() method at 4/16/2009 4:00:00 PM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='EL1' FromEntrySignal='L1'
      4/16/2009 4:00:00 PM Cancelled pending exit order, since associated position is closed: Order='NT-00195/Sim101' Name='Stop loss' State=Working Instrument='TF 09-14' Action=Sell Limit price=0 Stop price=365.9 Quantity=1 Strategy='TradetreeSystems' Type=Stop Tif=Gtc Oco='NT-00130-429' Filled=0 Fill price=0 Token='f0d4283efa7148f9a416ba1ecb39532c' Gtd='12/1/2099 12:00:00 AM'


      11/27/2009 12:30:00 PM Entered internal PlaceOrder() method at 11/27/2009 12:30:00 PM: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='L1' FromEntrySignal=''
      11/27/2009 12:30:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Ticks Value=0 Currency=2500 Simulated=False
      11/27/2009 1:30:00 PM success Trade Cnt = 10
      11/27/2009 1:30:00 PM Entered internal PlaceOrder() method at 11/27/2009 1:30:00 PM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='EL1' FromEntrySignal='L1'
      11/27/2009 1:30:00 PM Cancelled pending exit order, since associated position is closed: Order='NT-00408/Sim101' Name='Stop loss' State=Working Instrument='TF 09-14' Action=Sell Limit price=0 Stop price=491.3 Quantity=1 Strategy='TradetreeSystems' Type=Stop Tif=Gtc Oco='NT-00272-429' Filled=0 Fill price=0 Token='aff1942c3fc64d2a9dd520746428fc0b' Gtd='12/1/2099 12:00:00 AM'
      Last edited by tradetree; 06-28-2014, 07:22 PM.

      Comment


        #4
        tradetree, end of session handling would apply to the primary series only and would work per the used session template - which one is used in your testing managed mode cases here?
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Bertrand View Post
          tradetree, end of session handling would apply to the primary series only and would work per the used session template - which one is used in your testing managed mode cases here?
          I don't understand this question. I only have one series, so there is only a primary. The session template is U.S. Equities RTH on both.

          Comment


            #6
            Thanks tradetree, that helps. Defintely not something I would expect since the end of session handling should not kick into gear at this point in time on your RTH template. What I could not say is what impact the different OS used would have potentially.

            Have you been changing timezones potentially on this machine where the issue occurs? As if you would do that, the already downloaded / stamped bars would not be changed. So I'm wondering if it might be perhaps a data issue? What you could do is downloading the data fresh after the cache has been emptied with NT closed (delete subfolders seen under Documents\NinjaTrader 7\db\cache).
            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by elirion, Today, 09:32 PM
            0 responses
            2 views
            0 likes
            Last Post elirion
            by elirion
             
            Started by cre8able, Today, 09:15 PM
            1 response
            5 views
            0 likes
            Last Post bltdavid  
            Started by cummish, Today, 08:43 PM
            0 responses
            12 views
            0 likes
            Last Post cummish
            by cummish
             
            Started by Option Whisperer, Today, 07:58 PM
            4 responses
            21 views
            0 likes
            Last Post Option Whisperer  
            Started by ETFVoyageur, 05-07-2024, 07:05 PM
            13 responses
            87 views
            0 likes
            Last Post ETFVoyageur  
            Working...
            X