Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Receiving order changed and execution events from NT

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

    Receiving order changed and execution events from NT

    Dear All,

    I have a custom application that helps with my trading stats. I can use it at the moment to hook into my IB TWS and monitor my working orders and executions.

    I would like to make it hook up with NT. What's the best way of doing this?

    I started by making it poll the NT log files periodically, but found latency issues here, because NT doesn't always flush out the log files as soon as an order is modified.

    Ideally, I would like to reference a .dll inside NT itself and receive events for orders created / modified and for executions.

    Any ideas?
    With many thanks,
    Ben

    #2
    - you should not access NT logs files, since this could cause lock ups in NT as NT tries to write information to the logs
    - Please check out the NT ATI DLL interface: http://www.ninjatrader-support.com/H...unctions2.html
    DierkNinjaTrader Customer Service

    Comment


      #3
      Thank you so much for your very quick reply.

      I had not found NTDirect.dll in the windows\system23 directory, and am thankful to you for pointing it out!

      I haven't tried it out yet, but the interface looks as though it'll be perfect

      Cheers / Ben

      Comment


        #4
        You're welcome
        DierkNinjaTrader Customer Service

        Comment


          #5
          Dear Dierk,

          Why do I receive a "A refence to ... could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component" error when trying to add a reference to c:\windows\system32\NTDirect.dll?

          I am using Visual Studio Express 2005, c#

          Cheers / Ben

          Comment


            #6
            Not sure what you are doing, but NtDirect.dll is not a COM dll nor a .NET assembly, but just a regular DLL.
            DierkNinjaTrader Customer Service

            Comment


              #7
              Hi Dierk,

              In Visual Studio, I was clicking Project --> Add Reference --> Browse, and trying to add the dll that way.

              I know there is a way to explicitly link to the .dll in code, but I'm not sure how to do that. Is there any documentation on the topic?

              cheers / ben

              Comment


                #8
                Sorry no, we do not provide support down to that level.
                Hint: you would have to load the DLL via LoadLibrary and access the function as in the "good old" days.
                DierkNinjaTrader Customer Service

                Comment


                  #9
                  OK. I finally found a way to connect to NT from c#, thanks to the post here:

                  http://www.ninjatrader-support.com/v...t=ntdirect.dll

                  The only problem now is: calling the Order() function does not return any orders unless they were created through the same interface. Am I correct in saying this?

                  I want to get a list of the orders that have been placed manually in the super dom.

                  cheers / Ben

                  Comment


                    #10
                    The DLL only maintains information on orders generated through DLL calls. There is no way to retrieve or manage orders generated through outside of a DLL call.
                    RayNinjaTrader Customer Service

                    Comment


                      #11
                      Dear Dierk and Ray,

                      Many thanks for your answers so far. I am wrecking my brains on this problem:

                      In my custom app, how do I get a list of the working orders that are currently active on NT, irrespective of how they were created?

                      cheers / Ben

                      Comment


                        #12
                        Sorry, this is not supported as this time.
                        DierkNinjaTrader Customer Service

                        Comment


                          #13
                          OK. Here's an idea.

                          By referencing other dll's, I was able to get a SuperDom form in my code, and display it. (I had to set the working directory of my software to the NT installation folder to make the superdom open without error)

                          In this state, however, it was not connected to the instance of NT which was running and showing market data. It seemed to be just an orphan.

                          Is it possible that I can "host" an NT process within my app. Then, I can show a superdom, and my software can be made a part of the loop thru which the orders are placed?

                          Anything to get that info.

                          cheers / ben

                          Comment


                            #14
                            It might be possible, but we do not provide support for that. Sorry, it's just a matter of bandwidth.
                            DierkNinjaTrader Customer Service

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by omermirza, Today, 12:39 PM
                            0 responses
                            1 view
                            0 likes
                            Last Post omermirza  
                            Started by larkmail, Today, 12:30 PM
                            0 responses
                            4 views
                            0 likes
                            Last Post larkmail  
                            Started by Danila, Today, 11:08 AM
                            1 response
                            10 views
                            0 likes
                            Last Post NinjaTrader_Jesse  
                            Started by dbida001, Today, 10:31 AM
                            1 response
                            3 views
                            0 likes
                            Last Post NinjaTrader_ChristopherJ  
                            Started by Brandon9821, Today, 08:27 AM
                            3 responses
                            25 views
                            0 likes
                            Last Post Brandon9821  
                            Working...
                            X