Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cancelled order due to end of session handling

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

    Cancelled order due to end of session handling

    I have a very confusing situation that I have never seen before in backtesting. I have a strategy I developed almost a year ago. It has been running fine, and I made some small changes. Now I stop getting execution of orders in backtesting after a few trades. At first I thought I must have broken the logic and stopped entering orders. But in the debugger I go and place orders and they don't go anywhere! So I turned on the TraceOrders and the output is below. Note that I also have one Print in my strategy every time a trade completes, "Profit long..."

    At the end it says, "Cancelled order due to end of session handling". I do not have "Exit on Close" set, so what end of session is it handling? I also tried several sim accounts to make sure there wasn't a sim problem. This is pretty urgent because I have other strategies that rely on this one working.

    10/14/2011 11:45:34 PM CancelAllOrders: BarsInProgress=0
    **NT** Disabling NinjaScript strategy 'Tra******et/bde35acfa63344c1926e297c75ce30c2'
    **NT** Enabling NinjaScript strategy 'Tra******et/bde35acfa63344c1926e297c75ce30c2' : On starting a real-time strategy - StrategySync=SubmitImmediately SyncAccountPosition=True EntryHandling=AllEntries EntriesPerDirection=2 StopTargetHandling=PerEntryExecution ErrorHandling=StopStrategyCancelOrdersClosePositio ns ExitOnClose=False Set order quantity by=DefaultQuantity ConnectionLossHandling=KeepRunning DisconnectDelaySeconds=10 CancelEntryOrdersOnDisable=True CancelExitOrdersOnDisable=True MaxRestarts=4 in 5 minutes
    Opening config file: "D:\NT_logs\threefoldmarkets_YG_15.cfg"

    Logger using directory: "D:\NT_logs\1014_2011"
    Logging initialization, earliest date: 10/14/2011 11:45:34 PM
    Opening log file: "D:\NT_logs\1014_2011\YG-15_1014_1145PM.txt".

    10/10/2008 9:45:00 AM Entered internal PlaceOrder() method at 10/10/2008 9:45:00 AM: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Long 1st entry' FromEntrySignal=''
    10/10/2008 12:15:00 PM Entered internal PlaceOrder() method at 10/10/2008 12:15:00 PM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
    10/10/2008 12:45:00 PM Entered internal PlaceOrder() method at 10/10/2008 12:45:00 PM: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Long 1st entry' FromEntrySignal=''
    10/10/2008 1:45:00 PM Entered internal PlaceOrder() method at 10/10/2008 1:45:00 PM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
    10/28/2008 10:30:00 AM Entered internal PlaceOrder() method at 10/28/2008 10:30:00 AM: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Long 1st entry' FromEntrySignal=''
    10/29/2008 12:15:00 PM Entered internal PlaceOrder() method at 10/29/2008 12:15:00 PM: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Long multi entry' FromEntrySignal=''
    11/3/2008 8:15:00 AM Entered internal PlaceOrder() method at 11/3/2008 8:15:00 AM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
    11/4/2008 2:15:00 PM Entered internal PlaceOrder() method at 11/4/2008 2:15:00 PM: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Long 1st entry' FromEntrySignal=''
    11/5/2008 8:30:00 AM Entered internal PlaceOrder() method at 11/5/2008 8:30:00 AM: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Long multi entry' FromEntrySignal=''
    11/10/2008 10:00:00 AM Entered internal PlaceOrder() method at 11/10/2008 10:00:00 AM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
    Profit long: -0.0155829940510564
    11/14/2008 4:15:00 PM Entered internal PlaceOrder() method at 11/14/2008 4:15:00 PM: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Long 1st entry' FromEntrySignal=''
    11/19/2008 11:00:00 AM Entered internal PlaceOrder() method at 11/19/2008 11:00:00 AM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
    Profit long: -0.0129171224774459
    11/19/2008 12:00:00 PM Entered internal PlaceOrder() method at 11/19/2008 12:00:00 PM: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Long 1st entry' FromEntrySignal=''
    11/21/2008 11:00:00 AM Entered internal PlaceOrder() method at 11/21/2008 11:00:00 AM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
    Profit long: -0.00287243703559237
    12/9/2008 8:15:00 AM Entered internal PlaceOrder() method at 12/9/2008 8:15:00 AM: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Long 1st entry' FromEntrySignal=''
    12/10/2008 11:45:00 AM Entered internal PlaceOrder() method at 12/10/2008 11:45:00 AM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
    Profit long: 0.0028688010061924
    12/10/2008 7:30:00 PM Entered internal PlaceOrder() method at 12/10/2008 7:30:00 PM: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Long 1st entry' FromEntrySignal=''
    12/15/2008 10:30:00 AM Entered internal PlaceOrder() method at 12/15/2008 10:30:00 AM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
    Profit long: 0.00690746904665991
    12/29/2008 1:15:00 PM Entered internal PlaceOrder() method at 12/29/2008 1:15:00 PM: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Long 1st entry' FromEntrySignal=''
    12/31/2008 11:30:00 AM Entered internal PlaceOrder() method at 12/31/2008 11:30:00 AM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
    Profit long: 0.00548075539611986
    1/6/2009 7:30:00 PM Entered internal PlaceOrder() method at 1/6/2009 7:30:00 PM: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Long 1st entry' FromEntrySignal=''
    1/7/2009 4:30:00 PM Entered internal PlaceOrder() method at 1/7/2009 4:30:00 PM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
    Profit long: 0.00347667305792717
    1/9/2009 4:00:00 PM Entered internal PlaceOrder() method at 1/9/2009 4:00:00 PM: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Long 1st entry' FromEntrySignal=''
    1/9/2009 4:00:00 PM Cancelled order due to end of session handling: BarsInProgress=0: Order='NT-00022/Sim2' Name='Long 1st entry' State=Working Instrument='YG 01-12' Action=Buy Limit price=0 Stop price=0 Quantity=1 Strategy='Tra******et' Type=Market Tif=Day Oco='' Filled=0 Fill price=0 Token='37dc981b047e4b1a84a76de769b3da93' Gtd='12/1/2099 12:00:00 AM'
    **NT** Syncing account position on starting strategy 'Tra******et/bde35acfa63344c1926e297c75ce30c2'. Account position='' Strategy position=''

    #2
    Ok, I think I figured it out after posting. I had changed the execution order method from "GTC" to "Day." This made a trade at 4:00 PM get cancelled, but my internal handling thought the trade was still valid. So this raises another question, "why does the ICE exchange not allow market GTC orders?" I will start another thread on this question, as this is still quite cryptic and it deserves its own discussion.

    The other question is, how can I handle this while keeping the order method "Day."? Specifically, can I trap the condition of "order cancelled?" I use the OnExecution method for entry handling already, is there a way to check for cancellation of an order? I know it may seem strange to want to enter a market order at 4:00PM as a "day" order, but as you will see in the new thread I will explain.
    Last edited by tradetree; 10-14-2011, 10:08 PM.

    Comment


      #3
      Tradetree,

      I am happy to assist.

      Please try resubmitting the order right after the cutoff (4pm) every day.

      Please let me know if I can assist further.
      Adam P.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      635 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      365 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      106 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      567 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      571 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X