Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Orders tracking

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

    Orders tracking

    Hello,

    I'm newbie at NT; I come from other platforms, among them, as usual, from MT4, where I'm used to have orders tracked via their "magic numbers".

    So far, I find NT more interesting than other platforms (that's obviously why I'm getting into it), but I've been several days looking for the way to have control over the orders that my systems send to the broker and I feel a little stuck.

    The idea is quite simple: If the system has placed multiple limit orders on market, sometimes some of them must be removed due to multiple circumstances, sometimes it's needed to change the volume of them, sometimes it's needed to change the preferred price, etc.

    In short: When the system sends to the broker the orders, it needs some way to track them, be able to know if a specific order has been executed or not, be able to remove them, modify them, etc.

    I really hope you people can tell me how to do it with NT, since I'm sure there must be a way I just haven't found so far.

    For more information, I want to use NT to work with IB (don't know if this could be important to answer my question)

    Please excuse my english. Thanks in advance.

    #2
    Hello manugarc,

    Thank you for your post and welcome to the NinjaTrader Support Forum!

    You will want to look into using IOrder objects in your code: http://www.ninjatrader.com/support/h...nt7/iorder.htm

    For an example on tracking and adjusting orders via OnOrderUpdate() and IOrder objects please visit the following link: http://www.ninjatrader.com/support/f...ead.php?t=7499

    Please let me know if you have any questions.
    Last edited by NinjaTrader_PatrickH; 05-15-2014, 08:20 AM.

    Comment


      #3
      Hello Patrick,

      Thanks for your quick response; I'll study carefully that example and tell you about in some hours

      Comment


        #4
        Ok, I got the idea and functionality of the example. It's good to know that as long as I keep a copy of the IOrder object used for each order, I'll be able to track them on that way.

        Now, my "but" would be:

        What if I want to turn off the machine at weekends or holidays? Or just in case of energy-failure? How could the system identify after that lapse of time each order, to check, for example, which of them have been closed due to Stop-Loss levels?

        I would need some "id" I could store in a text file (an string or "big resolution"-number), so the system could check that list of orders, and whether they are still active, closed, etc.

        Perhaps I'm missing something and this is not the best approach to solve this situations; please let me know if any other idea could solve the problem in a better way. I'm used to do it this way, but I would change it without problems if needed.

        Comment


          #5
          Hello manugarc,

          Thank you for your response.

          You are not missing anything, but unfortunately, the strategies will not be able to pull orders from previous instances of the strategy. This means if a disconnect occurs the strategy cannot pull the orders and their status when re-connected. However, you can dictate how NinjaTrader and the strategy handle the disconnect with the information at the following link under "Understanding the NinjaScript tab": http://www.ninjatrader.com/support/h...tegies_tab.htm

          This would unfortunately have no effect if you shut down your PC or NinjaTrader or disable the strategy manually.

          Comment


            #6
            Thanks Patrick.

            I want to die.

            If working for example with Interactive Brokers, and having 4 limited orders placed, there's absolutely no way of removing two of them if you reboot the computer?

            Absolutely no way?

            I mean, there's some kind of API or something that could make the trick?
            Last edited by manugarc; 05-20-2014, 05:21 PM.

            Comment


              #7
              Hello manugarc,

              Thank you for your response.

              The current API used for TWS in NinjaTrader would not allow this, however, if you wanted to run a constant connection you could look into the Gateway API but this would be unsupported. You can find information from another user on this at the following link: http://www.ninjatrader.com/support/f...d.php?p=314844

              Please let me know if I may be of further assistance.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              651 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              370 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              109 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              574 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              577 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X