Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

ATI not returning Price Data

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

    ATI not returning Price Data

    Hi

    Using the NinjaTrader.Client.dll I do not seem able to get Bid Ask data from the ATI Service for most instruments.

    string Instrument = "NZDUSD";
    double Bid, Ask;
    NinjaTrader.Client.Client NinjaClient = new NinjaTrader.Client.Client();

    if (NinjaClient.Connected(1) == 0) {
    if (NinjaClient.SubscribeMarketData(Instrument) == 0) {
    Bid = NinjaClient.MarketData(Instrument, 1);
    Ask = NinjaClient.MarketData(Instrument, 2);

    NinjaClient.UnsubscribeMarketData(Instrument);
    }
    }

    NinjaClient.MarketData(Instrument, 1) returns 0 for most instruments. I have Bid Ask data in the Ninja Controle Center so can confirm that market is open and am getting data.

    I am using NT7.

    Any ideas what is going wrong?

    Thanks

    Mike
    Last edited by upshon; 01-16-2011, 05:39 PM.

    #2
    upshon, when you say "most instruments", which instruments are functioning correctly?
    AustinNinjaTrader Customer Service

    Comment


      #3
      it varies, once I restart NinjaTrader it changes. I was able to get AUDUSD and no others, then after a reboot AUDUSD didn't work but EURAUD did.

      Comment


        #4
        I am using eSignal data. Data seems fine in Ninja charts

        Comment


          #5
          Have also tried changing data provider to MB Trading Demo account and get same result. Well actually I cant get data for any instrument now.

          Comment


            #6
            The strange thing is that the ATI interface is working, as you can see from the attached screen shot, in my visual studio debugger I have various values set in the Ninja Client object that have been returned from NinjaTrader, it just Bid and Ask info not being returned.
            Last edited by upshon; 02-08-2011, 05:57 AM.

            Comment


              #7
              The leanest way to check the ATI is via PowerShell. Here is some basic commands and the output:

              Code:
              PS C:\> Add-Type -path "c:\Program Files\NinjaTrader 7\bin\NinjaTrader.Client.dll"
              PS C:\> $atiTest = New-Object NinjaTrader.Client.Client
              PS C:\> $atiTest.Connected(1)
              0
              PS C:\> $atiTest.CashValue("Sim101")
              93905.6249999997
              PS C:\> $atiTest.SubscribeMarketData("ES 03-11")
              0
              PS C:\> $atiTest.MarketData("ES 03-11", 0)
              1285.5
              PS C:\> $atiTest.MarketData("ES 03-11", 1)
              1285.25
              PS C:\> $atiTest.MarketData("ES 03-11", 2)
              1285.5
              PS C:\>
              I'm on IQFeed but it shouldn't make a difference.

              $atiTest.TearDown() when you are done tears down the connection.

              Comment


                #8
                Looking at the code you first posted you might want to kill the "if connected and if subscribed" logic and just poll for the last/bid/ask every 100 milliseconds or so.

                Comment


                  #9
                  Thanks MXASJ taking out the check for connection has fixed the issue. Thats pretty strange but it works.

                  Thanks again for your help.

                  Mike

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Aviram Y, 08-09-2023, 09:04 AM
                  10 responses
                  298 views
                  0 likes
                  Last Post MrHump
                  by MrHump
                   
                  Started by jpapa, Today, 07:22 AM
                  1 response
                  5 views
                  0 likes
                  Last Post NinjaTrader_Gaby  
                  Started by kevinenergy, 02-17-2023, 12:42 PM
                  116 responses
                  2,758 views
                  1 like
                  Last Post kevinenergy  
                  Started by franatas, 12-04-2023, 03:43 AM
                  7 responses
                  106 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by Jltarrau, Today, 05:57 AM
                  3 responses
                  9 views
                  0 likes
                  Last Post Jltarrau  
                  Working...
                  X