Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ATI OrderStatus DLL Function Usage

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

    ATI OrderStatus DLL Function Usage

    Is there nuance to using the OrderStatus DLL function? I see in the help that it is defined as:
    string OrderStatus(string orderId)

    so in my Delphi code I declare:
    FUNCTION OrderStatus ( OrderID: string ) : string; stdcall; external 'NtDirect.dll';

    and call it via:
    OrderStatus( Nj_LastOrderID );

    where Nj_LastOrderID is a string that contains the OrderID that was submitted when the order was PLACED. The OrderFilled and AvgFillPrice function calls work fine and are coded in a similar manner but OrderStatus always returns null values. I've also noticed that NewOrderId() function is not returning any values. Are there any known issues with these functions or special usage instructions?

    Thanks,

    Whitmark
    whitmark
    NinjaTrader Ecosystem Vendor - Whitmark Development

    #2
    They work as expected. I just ran our sample code as provided in the documentation against eSignal and it works as expected.
    RayNinjaTrader Customer Service

    Comment


      #3
      Thanks Ray . . . too bad you still don't have your NeoTicker account.

      Should I expect a different response if the OrderID is not found? Can I differentiate between the function not working properly and OrderID not found?

      Thanks

      Whitmark
      whitmark
      NinjaTrader Ecosystem Vendor - Whitmark Development

      Comment


        #4
        It will return empty string in case of an invalid order ID.

        Comment


          #5
          NeoTicker Delphi ATI calls uses OrderID pchar not string

          Looks like my issues had to do with proper declaration of the DLL functions in Delphi. It's been a while since I had worked with coding against the ATI and had forgotten that certain ATI functions require pchar vs string referencing when using a strongly typed programming language like Delphi. For example, the following code per the help facility will compile fine, but will return null values at runtime:
          FUNCTION OrderStatus ( OrderID: string ) : string; stdcall; external 'NtDirect.dll';

          however, the proper coding in Delphi is:
          FUNCTION OrderStatus ( OrderID: pchar ) : pchar; stdcall; external 'NtDirect.dll';

          I would suggest that since the use of the ATI with the NeoTicker platform is promoted and since most development is done using Delphi that this requirement be clarified in a footnote in the help facility for the Orders function and those functions that either require an OrderID pchar parameter or return an OrderID pchar value.
          whitmark
          NinjaTrader Ecosystem Vendor - Whitmark Development

          Comment


            #6
            Thanks for this suggestion.
            RayNinjaTrader Customer Service

            Comment


              #7
              AvgFillPrice

              double AvgFillPrice(string orderId)

              The text says the average entry price. If this is a target or a stop order...does it give me the average fill price (or in this case an exit price)?

              Leroy

              P.S. I haven't figured out how to create a new thread...can't find it anywhere...so I will post here.

              Comment


                #8
                Hello ldissinger,

                If you have the "orderID" of the Stop or Target then yes you should get the AvgFillPrice of the Stop and Target orders.

                To create a new thread you will want to select a topic such as "Automated Trading" and once under this topic you should see a "New Thread" button to the left of the Pages. See attached image below.
                Attached Files
                JCNinjaTrader Customer Service

                Comment


                  #9
                  Thanks

                  Cool, that is what I was hoping for in regards to the "exit" price of a trade.

                  Ah....seems like a "new" topic button should also be placed somewhere in here when reading a thread...but thank you for the info. I thought it would be under thread tools...but that is fine.

                  Leroy

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by andrewtrades, Today, 04:57 PM
                  1 response
                  8 views
                  0 likes
                  Last Post NinjaTrader_Manfred  
                  Started by chbruno, Today, 04:10 PM
                  0 responses
                  6 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
                  7 views
                  0 likes
                  Last Post FAQtrader  
                  Started by rocketman7, Today, 09:41 AM
                  5 responses
                  19 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Working...
                  X