Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Getting the current pending orders

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

    Getting the current pending orders

    I am a new user coming from MT4 and MBT. Actually so far I have three questions about NT.
    1. How could I get the current pending orders? The code examples showed that the entry methods return the instance of the order to a local variable. This could work fine during the session. But if the system crashed and I have to restart the strategy, those local variables would be initialized to null while there might be pending limit/stop orders. The way to keep synchronized is to initialize those variables to be the current pending orders. But I couldn't find anything in the help doc.
    2. Also related to system crashing. How to automatically start strategies when NT starts up? I could put NT in the startup fold so it gets launched when the system is started, but still have to manually start the strategies.
    3. In MT4 and MBT, the tick price contains both Ask&Bid. So one tick means a pair of two. But in NT, if I implement the OnMarketData method to get the tick price, the Ask and Bid were sent separately which caused two ticks. I could store the previous Ask or Bid then still keep feeding my strategy a pair. My question is whether this means my strategy would get double or at least more ticks than MT4 and MBT. Since the number of ticks is very important to my strategy, I have to make it clear. This is actually a question about how the NT maps the tick feeding with both Ask&Bid to it's OnMarketData method. Besides, anyone know what's the "Last" price is in OnMarketData?
    Thanks for help!

    #2
    1. NT7 will provide syncing features.
    2. You need to start them manually.
    3. Not sure I follow you. There are three types of events received from OnMarketData(). Ask, Bid, and last. Last are the ones that actually update the bar. What determines which one is last is strictly handled by your data provider. Whatever they provide from the last stream is what is used.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      For the 3rd question, when coding in MT4 or MBT, there are methods equal to OnMarketData to implement. In their methods, both Ask and Bid are sent in as a pair. My strategy handles them as 'one tick" and the code are called once. In NT, the OnMarketData only gives one price per call, which could be either Ask, Bid or Last. So I want to know how the mapping works in NT for such kind of feeding. For example, in MBT, a tick comes with 1.3902 as Ask and 1.3900 as Bid, if I connect to MBT in NT, will the OnMarketData be called twice or three times? Since I have a tick counter in my strategy, after porting to NT, the result would be different and I do want to know the difference to adjust settings.

      Thanks!

      Originally posted by NinjaTrader_Josh View Post
      1. NT7 will provide syncing features.
      2. You need to start them manually.
      3. Not sure I follow you. There are three types of events received from OnMarketData(). Ask, Bid, and last. Last are the ones that actually update the bar. What determines which one is last is strictly handled by your data provider. Whatever they provide from the last stream is what is used.

      Comment


        #4
        3 times. One for bid, ask, and last.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        668 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        377 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        110 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        575 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        580 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X