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

About CurrentBid and CurrentAsk

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

    About CurrentBid and CurrentAsk

    Hello,

    I am developing an Indicator, and need to use the CurrentBid and CurrentAsk of each tick I proccess in OnBarUpdate.

    I have two doubts about how "current" are CurrentBid and CurrentAsk:

    1) When a new tick arrives (it was produced in a context with a Bid and an Ask) this tick will produce a MarketData event and, after that, a BarUpdate event.
    I process that tick in OnBarUpdate. Let's suppose that in the time elapsed since it arrived in OnMarketData, a new Bid or Ask is received. Then, when I use CurrentBid or CurrentAsk (in OnBarUpdate), what values do they have, the old Bid and Ask, valid when the tick arrived, or the new Bid and Ask currently valid, which arrived after the tick?

    2) When OnBarUpdate receives the first tick in real time. Do CurrentBid and CurrentAsk have proper values (the actual Bid and Ask) or they are initialized with some default values until a Bid and an Ask arrive as MarketData events?

    Thank you very much in advance for any help.

    #2
    telbentel, which CalculateOnBarClose setting are you using here?

    1. OnBarUpdate() is called for each tick change and OnMarketData() for each L1 data change - the Bid / Ask in the OnBarUpdate() are aligned to it's events, while you could experience a slightly different timing in the OnMarketData() as it could have for example updated at a different time.

    2. Historically they would hold the closing price value, if a new realtime call for OnBarUpdate() is detected they would update with the L1 data as this point in time.
    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by algospoke, 04-17-2024, 06:40 PM
    6 responses
    49 views
    0 likes
    Last Post algospoke  
    Started by arvidvanstaey, Today, 02:19 PM
    4 responses
    11 views
    0 likes
    Last Post arvidvanstaey  
    Started by samish18, 04-17-2024, 08:57 AM
    16 responses
    61 views
    0 likes
    Last Post samish18  
    Started by jordanq2, Today, 03:10 PM
    2 responses
    9 views
    0 likes
    Last Post jordanq2  
    Started by traderqz, Today, 12:06 AM
    10 responses
    21 views
    0 likes
    Last Post traderqz  
    Working...
    X