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 inanazsocial, Today, 01:15 AM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by rocketman7, Today, 02:12 AM
    0 responses
    10 views
    0 likes
    Last Post rocketman7  
    Started by dustydbayer, Today, 01:59 AM
    0 responses
    1 view
    0 likes
    Last Post dustydbayer  
    Started by trilliantrader, 04-18-2024, 08:16 AM
    5 responses
    23 views
    0 likes
    Last Post trilliantrader  
    Started by Davidtowleii, Today, 12:15 AM
    0 responses
    3 views
    0 likes
    Last Post Davidtowleii  
    Working...
    X