Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ATI unexpected results

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

    ATI unexpected results

    Hi there,

    I am debugging a couple of things here as I get started with NTDirect.dll for ATI.

    Here is the behavior I have been able to get so far that agrees:

    int Connected(int showMessage): It returns 0 when NT is running, -1 otherwise (good)
    int SubscribeMarketData(string instrument): It return 0 if not already subscribed, else -1 (good)
    int UnsubscribeMarketData(string instrument): It return 0 if not already unsubscribed, else -1 (good)

    Now the issues:

    [1] int SubscribeMarketData(string instrument): with any string as input passed on for "instrument" returns 0
    Problem: If I pass "aadiuah aduh" as an instrument, I get a successful flag 0 as subscribed (this does not raise an error is attempting to resubscribe to the nonexisting instrument "aadiuah aduh")

    [2] double CashValue(string account): this is returning a 0.0 cash value
    Problem: The simulation account I have has a cash value of 3k

    Please advise and note that the behavior in [1] is not correct since it returns that I subscribed successfully to an instrument (that does not exist). Thank you.

    Pedro

    #2
    Hello,

    Thank you for the post.

    I just wanted to reply and let you know that I am currently looking into this item and will reply back once I have further details.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Here's some more I have been able to figure out on my own. It seems if when I pass a wrong string, NtDirect will return a 0 (even though a 0 also means a success according to the function descriptions). I was able to get the CashValue correctly (below I show both examples of correct and incorrect account names and the results for each). However, it seems I am not passing the correct instrument name still (see successful subscription and a last value of 0.0). I also show a subscription to a nonexisting instrument returning 0's all across as well. This is bad behavior (to return success to something that obviously failed). In any rate, what the correct instrument nomenclature to pass as a string? This is delaying development of my project (the lack of examples here anywhere is really killing this, why not a single example? Are we not supposed to be using these ATI features?). If this is not really for development, please clarify and advise, thank you.

      Comment


        #4
        I was able to get the prices by switching "C:\\Program Files (x86)\\NinjaTrader 8\\bin\\NtDirect.dll" for "C:\\Windows\\SysWOW64\\NtDirect.dll" and that worked. This feels like guessing and hacking ;(

        Comment


          #5
          Hello,

          Thank you for the reply.

          I wanted to reply back to your original question.

          In this situation what you are seeing would be expected or that no error is reported because there actually is no error happening.

          You are subscribing to the instruments, but because they do not exist they are just created in the database. This is the same action if you typed a random instrument into a chart that was not in the database.

          You could check if the resulting ask bid and last are all 0 values to know if the instrument was actually subscribed to.

          This interface is only used connecting specific third party applications to NinjaTrader so it is developed in a specific way for those applications specifically. While this is exposed for the developer if they wish to use it, there is no guideline or documentation or support for this interface.

          You are correct in using the C:\\Windows\\SysWOW64\\NtDirect.dll, this is the location the platform uses as well. Unfortunately there is no developer guide for this interface, generally, we would suggest using NinjaScript for any order entries needed or the File interface if possible as those are much easier to develop with. If your project absolutely needs to use the dll interface, you may need to make some logic to work around items like the random instrument subscription with no -1 reported back.

          I look forward to being of further assistance.
          JesseNinjaTrader Customer Service

          Comment


            #6
            I am revisiting this work again. At the moment, I have a live feed for "ZF 03-18", however, once I subscribe to it, MarketData is returning 0.0. "ZF 03-18" exists as I am watching the live feed. Any ideas?

            EDIT:

            On a second note, I see the value now, strange. Apologies.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by CortexZenUSA, Today, 12:53 AM
            0 responses
            1 view
            0 likes
            Last Post CortexZenUSA  
            Started by CortexZenUSA, Today, 12:46 AM
            0 responses
            1 view
            0 likes
            Last Post CortexZenUSA  
            Started by usazencortex, Today, 12:43 AM
            0 responses
            5 views
            0 likes
            Last Post usazencortex  
            Started by sidlercom80, 10-28-2023, 08:49 AM
            168 responses
            2,265 views
            0 likes
            Last Post sidlercom80  
            Started by Barry Milan, Yesterday, 10:35 PM
            3 responses
            11 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Working...
            X