Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnMarketData ASK/BID error

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

    OnMarketData ASK/BID error

    I have moved onto the OnMarketData/Depth call-backs. I am sure I will have questions later but one issue jumped out which shows that "bid/ask" are not being updated appropriately. They appear to be initialized to the maximum double value and not updated. So adding this line to the OnMarketData(e) function:

    Print("OnMarketData: Args.ToString(): "+e.ToString());

    YieldS:

    OnMarketData: Args.ToString(): instrument='CL 06-15 Nymex' type=Ask price=59.42 volume=18 time=5/7/2015 12:51:16 PM bid=-1.79769313486232E+308 ask=-1.79769313486232E+308 isReset=False
    The Ask/Bid are not updated.

    #2
    I'm checking with development for clarification on expected behavior here. Will update this thread shortly.
    MatthewNinjaTrader Product Management

    Comment


      #3
      The bid/ask properties only should be set for 'type=Last'

      Comment


        #4
        What seems to be logical to me and probably useful is if the Bid/Ask be set to the previous Bid/Ask values for a Bid/Ask event.

        That sentence doesn't seem to be clear, but what I mean is for an ASK even, rather than leaving the passed Bid/Ask values as NAN or MAX VALUE (not sure which you initialize it to), set them to the previous Bid/Ask.

        Then for the ASK event, I can check to see if the ASK is increasing or decreasing. Same goes for a BID event. This would get more mileage out of those setting and avoid some potential use in the future of what they are expected to be only to have the MAX/NAN value sent.

        Comment


          #5
          The ask/bid fields on the market data update stream are only there for last price. There is no interlinking between the ask/bid/last updates.

          If we were to stuff old values into those fields on ask/bid updates, this could potentially be more misleading when the Type Bid Price does not match the Type.Bid bid field. To keep things separate, only Type.Last will have Ask/Bid fields with meaningful values.
          MatthewNinjaTrader Product Management

          Comment


            #6
            Originally posted by NinjaTrader_Matthew View Post
            The ask/bid fields on the market data update stream are only there for last price. There is no interlinking between the ask/bid/last updates.

            If we were to stuff old values into those fields on ask/bid updates, this could potentially be more misleading when the Type Bid Price does not match the Type.Bid bid field. To keep things separate, only Type.Last will have Ask/Bid fields with meaningful values.
            I see your point, but don't think the values are OLD when they are put into the ASK/BID setting, they are current and potentially being updated. It would be a BID or ASK update that would change these values so they would simply report the LAST BID AND ASK and price would be the NEW BID OR ASK. This would allow developers to know the direction of movement in the BID or ASK with the new BID or ASK value coming through the OnMarketData(). I personally see this has value over the current approach. To me the algorithm would be simply:

            1) New BID/ASK/LAST event coming in
            2) Load Last BID/ASK values into Bid & Ask of the event Structure
            3) If BID or ASK update, update Current Ask/Bid value (Future LAST BID/LAST value, not one in the event structure)
            4) Set the incoming event type, price and volume
            5) Pass event to OnMarketData()
            That is just my 2 cents.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by rocketman7, Today, 02:12 AM
            5 responses
            23 views
            0 likes
            Last Post rocketman7  
            Started by trilliantrader, 04-18-2024, 08:16 AM
            7 responses
            28 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by samish18, 04-17-2024, 08:57 AM
            17 responses
            66 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by briansaul, Today, 05:31 AM
            1 response
            15 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by PaulMohn, Today, 03:49 AM
            1 response
            12 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Working...
            X