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 chbruno, Today, 04:10 PM
    0 responses
    3 views
    0 likes
    Last Post chbruno
    by chbruno
     
    Started by josh18955, 03-25-2023, 11:16 AM
    6 responses
    436 views
    0 likes
    Last Post Delerium  
    Started by FAQtrader, Today, 03:35 PM
    0 responses
    6 views
    0 likes
    Last Post FAQtrader  
    Started by rocketman7, Today, 09:41 AM
    5 responses
    19 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by frslvr, 04-11-2024, 07:26 AM
    9 responses
    127 views
    1 like
    Last Post caryc123  
    Working...
    X