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

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.
    Kate W.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by jaybedreamin, Today, 05:56 PM
    0 responses
    2 views
    0 likes
    Last Post jaybedreamin  
    Started by DJ888, 04-16-2024, 06:09 PM
    6 responses
    18 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by Jon17, Today, 04:33 PM
    0 responses
    1 view
    0 likes
    Last Post Jon17
    by Jon17
     
    Started by Javierw.ok, Today, 04:12 PM
    0 responses
    6 views
    0 likes
    Last Post Javierw.ok  
    Started by timmbbo, Today, 08:59 AM
    2 responses
    10 views
    0 likes
    Last Post bltdavid  
    Working...
    X