Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Transitioning of a historical order to a live order

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

    Transitioning of a historical order to a live order

    Hello,

    I am facing the following problem:

    1. The strategy is developed in Unmanaged approach and uses pending entry and exit orders
    2. While running through Historical Fill process, the strategy sets pending orders and manages them according to internal rules
    3. But then even before "On starting a real-time strategy" happens, the strategy crashes sometimes with "has been disabled because it attempted to modify a historical order that has transitioned to a live order" error.

    I am performing the transitioning of historical orders to real-time orders as stated in Help Guide:

    "...
    else if (State == State.Realtime){
    ...
    if (order != null) order = GetRealtimeOrder(order);
    ...
    }
    ..."

    However, this block should not even run since the strategy crashes in the middle of Historical Fill process without even reaching "On starting a real-time strategy" point.

    Is there anything I am missing with the transitioning process?

    Best regards,
    Alexei

    #2
    Hello akuntysh,

    Thank you for your note.

    This error is received when an Order object is assigned historically and then gets modified with Realtime data when that live order has different ID's. In NinjaTrader 8, we will have to transition Order objects when the state reaches State.Realtime so their order ID's can be updated from backtest generated ID's to account generated ID's. The SampleOnOrderUpdate strategy demonstrates how this can be done.

    Transitioning order references from historical to live - https://ninjatrader.com/support/help...storicaltolive

    SampleOnOrderUpdate - https://ninjatrader.com/support/foru...ead.php?t=7499

    GetRealTimeOrder - https://ninjatrader.com/support/help...ltimeorder.htm

    Using OnOrderUpdate and OnExecutionUpdate - https://ninjatrader.com/support/help...and_onexec.htm

    Please let me know if I may be of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    88 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    134 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    118 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    67 views
    0 likes
    Last Post PaulMohn  
    Working...
    X