Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to clear all historical orders as the first action?

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

    How to clear all historical orders as the first action?

    An error message that reads "...has been disabled because it attempted to modify a historical order that has transitioned to a live order..."

    in this case, i think it would be easier to just clear all historical orders as the first action in the code. What needs to be done in State.Historical or State.DataLoaded to perform a purge of all historical orders?

    #2
    Hello Boonfly8

    You can exit orders on the last historical bar.

    if (State == State.Historical && CurrentBar == Count - 2)

    Below is a link to an example (ProfitChaseStopTrailExitOrdersExample_NT8).
    https://ninjatrader.com/support/foru...345#post521345
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    376 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    243 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    208 views
    1 like
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    294 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    254 views
    0 likes
    Last Post CarlTrading  
    Working...
    X