Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order bookkeeping issues for live and simulation

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

    Order bookkeeping issues for live and simulation

    I am wonder if there is any order bookkeeping mechanism in NT7. I am going to implement one. There is an example SampleMonitorStopProfit in the forum.

    protected override void OnOrderUpdate(IOrder order)
    {
    if (order.OrderState = = OrderState.PendingSumbit)
    {
    orderbook.Add(order)
    }

    if (order.OrderState == OrderState.Cancelled || order.OrderState == OrderState.Filled || order.OrderState == OrderState.Rejected)
    {
    orderbook.Remove(order)
    }
    }

    Therefore I can query the orderbook to find those pending order and trying to modify it. However, there is a question. Suppose I stop the strategy which already place an stop order in the broker, what will happen to the orderbook if I restart the strategy? As the time the strategy just before live, those orders are handled by NT7 internally. Will the order state and info about the order will be reflected once it turns into live order? Will the orderbook syn during switch from sim to live?

    Thanks!

    #2
    Welcome to our forums - depending on the sync options you've chosen NinjaTrader would rerun the historical portion of the strategy and match to any open orders already running on the account, it has to be a 100% match though to be considered value.



    If you directly compare IOrders you would be fine, but if you're working with the Tokens and OCO strings as well be advised those will change as your strategy goes from historical to live, the order id itself can also change in the lifetime cycle of the order.

    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by AH369, 07-03-2024, 10:17 AM
    8 responses
    829 views
    1 like
    Last Post Karado58  
    Started by FAQtrader, 04-25-2024, 12:00 PM
    58 responses
    1,287 views
    0 likes
    Last Post rene69851  
    Started by kevtancw, Today, 07:09 PM
    0 responses
    4 views
    0 likes
    Last Post kevtancw  
    Started by LanceFulk, Today, 06:28 PM
    0 responses
    6 views
    0 likes
    Last Post LanceFulk  
    Started by utilizator, Today, 04:53 PM
    0 responses
    8 views
    0 likes
    Last Post utilizator  
    Working...
    X