Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Most efficient way to get live current bid/ask

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

    Most efficient way to get live current bid/ask

    Hello,

    I was wondering if you could just confirm something for me. If I want to get the current bid/ask, there seems to be 2 ways it is done. Via onmarketdata, or GetCurrentBid. My question is, is there any overhead with GetCurrentBid? Only, I see indicators like the price line using onMarketdata, and that would seem to use many more resources than say, a simple function call to getCurrentBid/Ask, if all that function is doing is returning a value it already has to hand?

    I did look in the docs, but it really does not go into any detail I could find about how GetCurrentBid actually works, internally. Would I be right in assuming GetCurrenBid, as needed, for example, 'onpricechange', would be more efficient than OnMarketData, where I would assume the entire tick stream is being sent to that function?

    Thanks.

    #2
    Hello pjsmith,

    Thanks for your post.

    GetCurrentBid/GetCurrentAsk will fetch the most recent Bid/Ask straight from the level 1 data feed before the bid/ask gets processed in NinjaTrader's data streams. This would be lighter if you occasionally need to reference a current bid/ask.

    Adding OnMarketData would be useful if you needed a stream of bid/ask/last to analyze the data and plot information like we do in an indicator. You are correct that the entire tick stream would be sent here.

    Let us know if there is anything else we can do to help.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    567 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    330 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    548 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    548 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X