Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Question about OnBarUpdate and timing

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

    Question about OnBarUpdate and timing

    Hi,

    Could someone please clarify what happens in the following situation?

    The current Bid has only 20 lots at say 866.00 which are taken in a single order.

    The next OnBarUpdate processes this.

    As that happens will GetCurrentBid() return the just taken Bid of 866.00 or the new Bid of 865.75?

    I realise that I could get the Bid data via OnMarketData however as OMD and OBU dont always match (there is an intermitent 1 tick lag) it is possible when doing Bid/Ask analysis to apply OMD data incorrectly within the OBU portion of the indicator.

    Thanks

    #2
    GetCurrentBid() gets the bid at that point in time. If a new bid formed you will get the new bid.

    You can just run your bid/ask analysis from OnMarketData() or OnMarketDepth().
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Josh,

      Thanks for the rapid reply...

      That is as I expected and yes i can use OMD however as mentioned in my first post this can return inconsistent results because of the lag issue.

      I appears (unfortunately) there is no way around the issue of getting 100% accurate Bid/Ask analysis with Ninja at the moment....

      Anything being done about this in version 7?

      Thanks

      Comment


        #4
        rt-trader,

        GetCurrentBid() just accesses the data directly. So it can actually be ahead of OnMarketData(). OnMarketData() is event driven so it is not necessarily the absolute latest bid price while GetCurrentBid() is the moment you call it. But remember, GetCurrentBid() from OnBarUpdate() is not updated on every single bid change since a bid change does not constitute a bar update event.

        As bid prices change back and forth it may seem like a delay but there really isn't one. Hope that helps.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Thanks for the clarifications Josh...

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Franck Z, Today, 09:49 AM
          0 responses
          6 views
          0 likes
          Last Post Franck Z  
          Started by pvtrader, Today, 08:02 AM
          2 responses
          7 views
          0 likes
          Last Post pvtrader  
          Started by Natoc, Today, 03:04 AM
          1 response
          17 views
          0 likes
          Last Post NinjaTrader_Jason  
          Started by Rudy2323, Today, 02:56 AM
          2 responses
          28 views
          0 likes
          Last Post Rudy2323  
          Started by tonynt, Yesterday, 02:07 PM
          1 response
          38 views
          0 likes
          Last Post NinjaTrader_Jason  
          Working...
          X