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 NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    62 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    134 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    75 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    45 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    50 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X