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.
    BertrandNinjaTrader Customer Service

    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.
        BertrandNinjaTrader Customer Service

        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.
          BertrandNinjaTrader Customer Service

          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.
              BertrandNinjaTrader Customer Service

              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 trilliantrader, Today, 03:01 PM
                0 responses
                3 views
                0 likes
                Last Post trilliantrader  
                Started by pechtri, 06-22-2023, 02:31 AM
                9 responses
                122 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by frankthearm, 04-18-2024, 09:08 AM
                16 responses
                67 views
                0 likes
                Last Post NinjaTrader_Clayton  
                Started by habeebft, Today, 01:18 PM
                1 response
                8 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by benmarkal, Today, 12:52 PM
                2 responses
                19 views
                0 likes
                Last Post benmarkal  
                Working...
                X