Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 trilliantrader, 04-18-2024, 08:16 AM
          4 responses
          16 views
          0 likes
          Last Post trilliantrader  
          Started by mgco4you, Today, 09:46 PM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by wzgy0920, Today, 09:53 PM
          0 responses
          7 views
          0 likes
          Last Post wzgy0920  
          Started by Rapine Heihei, Today, 08:19 PM
          1 response
          9 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by Rapine Heihei, Today, 08:25 PM
          0 responses
          9 views
          0 likes
          Last Post Rapine Heihei  
          Working...
          X