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 Revazi123, Today, 08:48 AM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_ChrisL  
          Started by M_ichel, Today, 08:38 AM
          2 responses
          8 views
          0 likes
          Last Post M_ichel
          by M_ichel
           
          Started by soon123, Today, 12:18 AM
          1 response
          24 views
          0 likes
          Last Post NinjaTrader_PaulH  
          Started by space_trader, Today, 12:52 AM
          1 response
          21 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by ybhx0315, Yesterday, 09:06 PM
          0 responses
          21 views
          0 likes
          Last Post ybhx0315  
          Working...
          X