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

Level 1 & 2 Data

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

    Level 1 & 2 Data

    If I am looking at OnMarketDepth (level 2 Data) will that include all changes in Level 1 data ? IE will I get all the changes in bid / offer just as in OnBarUpdate ?

    #2
    Hello GKonheiser,

    Thanks for opening the thread.

    OnMarketDepth() is guaranteed to provide level 2 data in the correct sequence for every change of level 2 data.

    OnMarketData() is guaranteed to be in the correct sequence for every change in level 1 data.

    For all changes in level 1 data, I would suggest to use OnMarketData(). Further reading can be found below:

    OnMarketData() - https://ninjatrader.com/support/help...marketdata.htm

    OnMarketDepth() - https://ninjatrader.com/support/help...arketdepth.htm

    Please let me know if I may be of further assistance.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hi Jim,

      Thanks for the reply, if level 2 data include the most the bid and offer at position 0 , ie the current best bid and offer why would this not be identical to level 1 data ?

      Comment


        #4
        Hello GKonheiser,

        Thanks for the additional question.

        The bigger difference between the two methods lies in the MarketDataEventArgs and MarketDepthEventArgs. OnMarketData() which is used for outputting level 1 data has the following MarketDataType's:

        MarketDataType.Ask
        MarketDataType.Bid
        MarketDataType.DailyHigh
        MarketDataType.DailyLow
        MarketDataType.DailyVolume
        MarketDataType.Last
        MarketDataType.LastClose (prior session close)
        MarketDataType.Opening
        MarketDataType.OpenInterest (supported by IQFeed, Kinetick)
        MarketDataType.Settlement
        OnMarketDepth() which is used for outputting level 2 data only has bid and ask available and provides other functionality to build a level 2 book.

        MarketDataType.Ask
        MarketDataType.Bid
        As these methods are called asynchronously and provide different output, you will not see identical Bid and Ask prices passing through these methods. This is where it would be advised to use OnMarketData() for level 1 purposes over the Bid/Ask in OnMarketDepth().

        If you have any additional questions, please don't hesitate to ask.
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by itrader46, Today, 09:04 AM
        0 responses
        1 view
        0 likes
        Last Post itrader46  
        Started by timmbbo, Today, 08:59 AM
        0 responses
        1 view
        0 likes
        Last Post timmbbo
        by timmbbo
         
        Started by bmartz, 03-12-2024, 06:12 AM
        5 responses
        33 views
        0 likes
        Last Post NinjaTrader_Zachary  
        Started by Aviram Y, Today, 05:29 AM
        4 responses
        14 views
        0 likes
        Last Post Aviram Y  
        Started by algospoke, 04-17-2024, 06:40 PM
        3 responses
        28 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X