Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MarketData method returns 0 when no change

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

    MarketData method returns 0 when no change

    Ive noticed the MarketData method in the ATI client interface acting a bit unexpectedly.

    I'm using Yahoo as my Account Connection. This is working fine in the NinjaTrader app itself.

    If I run my app after the London Stock Exchange has closed for the day every call to MarketData returns 0. I never get the last trade price even though it is shown in NinjaTrader as the correct value. I'm not sure if it is related to the market close time or if the variable behind MarketData only updates on a share price change but this to me seems like a bug?

    I'm using NinjaTrader V7.0.0.22

    #2
    Harry, this is expected - there is simply no price to access at this point in time, you would see it update on the next change in Level 1 data.

    Comment


      #3
      Hi Bertrand.

      If there is no price to access then why am I seeing a price in the NinjaTrader application? If the price is available to NT then surely it should be available via a call to MarketData?

      In more detail:
      1: ATI application starts and subscribes to market data.
      2: application calls MarketData and receives 0 back.
      3: application calls MarketData every second until last trade price is received (up to 60s for yahoo connection).
      4: application continues to call MarketData every second and receives price successfully on every call even if price has not changed.

      Performing these steps during the day works fine. However, performing these steps after end of trading day results in not getting past step 2. I left my application running overnight and the price was eventually received when the market opened in the morning.

      This to me is a bug since NT is able to receive the last trade price even though the market is closed but it doesnt pass this on to the ATI client application.

      I's be interested to hear from other users as to their thoughts on this being a bug.

      Thanks.

      Comment


        #4
        Thanks for the details Harry, I'll look into here and get back to you.

        Comment


          #5
          We looked into matters and the behavior you see is expected, if you access it externally it needs an event to 'push' the data to your custom application using the ATI.

          Comment


            #6
            Thanks for looking into it. Howevr, I still consider this to be a bug.

            A standard 'pull' style approach involves requesting data. In the ATI you have to call MarketData() to pull the data in. A 'push' style approach would send price changes to the client app in the form of an event and would happen without having to call MarketData(). Therefore, the current approach does not fit the expected model.

            I expect the problem is that the ATIServer class in NT connects as a listener with whatever is providing the price info internally. The listener is only notified on price changes. The marketData variable inside the ATIServer class will be initialised to 0 on startup. NT must also have a way of requesting price data internally instead of just waiting for an event otherwise the NT app itself would have this problem. Therefore, if the ATIServer called this on initialisation to populate the marketData variable then the problem goes away.

            Is there somewhere I can submit a formal bug report on this?

            Comment


              #7
              Harry, this was logged as a bug report and looked into - it works as expected according to what's expected for the AT interface. Unfortunately you can't compare the NT / Yahoo internal behavior to it.

              Comment


                #8
                Ok. I fail to see how the current way it works is helpful if it only works at certain times of day. But if its not going to be changed then there's no point me trying futher.

                Thanks for your help anyway Bertrand.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by argusthome, 03-08-2026, 10:06 AM
                0 responses
                77 views
                0 likes
                Last Post argusthome  
                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                0 responses
                45 views
                0 likes
                Last Post NabilKhattabi  
                Started by Deep42, 03-06-2026, 12:28 AM
                0 responses
                27 views
                0 likes
                Last Post Deep42
                by Deep42
                 
                Started by TheRealMorford, 03-05-2026, 06:15 PM
                0 responses
                32 views
                0 likes
                Last Post TheRealMorford  
                Started by Mindset, 02-28-2026, 06:16 AM
                0 responses
                63 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Working...
                X