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 DJ888, 04-16-2024, 06:09 PM
                  6 responses
                  18 views
                  0 likes
                  Last Post DJ888
                  by DJ888
                   
                  Started by Jon17, Today, 04:33 PM
                  0 responses
                  1 view
                  0 likes
                  Last Post Jon17
                  by Jon17
                   
                  Started by Javierw.ok, Today, 04:12 PM
                  0 responses
                  6 views
                  0 likes
                  Last Post Javierw.ok  
                  Started by timmbbo, Today, 08:59 AM
                  2 responses
                  10 views
                  0 likes
                  Last Post bltdavid  
                  Started by alifarahani, Today, 09:40 AM
                  6 responses
                  41 views
                  0 likes
                  Last Post alifarahani  
                  Working...
                  X