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

load bid/ask data for a bar based on tick series

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

    load bid/ask data for a bar based on tick series

    Hello,

    Is there any C# example available showing how to load tick series and build a candle's bid/ask for each price level ?

    I know how to add series, collections/dictionaries etc. But the general methodology is unclear for me.

    I don't want to use tick replay for performance reasons.

    #2
    Hello dariuszszyc,

    Thank you for the post.

    I wanted to clarify, are you trying to Plot the ask and bid from the TickData of the added ask and bid series? Or are you trying to plot the market depth per price level using the level2 market data?

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hello Jesse,
      I was thinking about ask and bid from added series.

      Comment


        #4
        Hello dariuszszyc

        Thank you for the reply.


        I wanted to gather further clairification on what you want to do here.

        In your first post, you noted that you know how to add series, so if you are trying to add ask and bid Tick series this is the same process or using AddDataSeries to add them.

        Have you already added the tick series, and now you are asking how to Plot that data for each bar? You noted bid/ask for each price level, are you trying to make a price ladder that shows the market depth at each price, or just making the ask and bids price on each bar? Could you provide more specific detail on what your goal is for plotting the data?


        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          I attached a screenshot of what I'm doing.
          I'm creating a structure of each candle (by their ID - column 1 and price level - column 3).
          For each price level of each candle I have total volume, total bid and total ask,
          but currently I'm generating it from tick replay which is a waste of performance as I don't need to look at the order in which contracts were coming.

          I know how to add series, but if I understand correctly - I'd have to add 3 in total (bid, ask and last) but how to process them later to build similar structure. Should I sum one series or other untill Last tick is met or untill OnBarUpdate ?

          I know the flow with tick replay, but not sure how should I approach series to achieve the same result.

          Hope that clarifies.
          Attached Files

          Comment


            #6
            Hello dariuszszyc,

            Thank you for the reply.

            If you plan to use three series, you could accumulate the value until a point at which you want to reset the value to 0 and repeat.

            Depending on the configuration of the script, you may use OnBarUpdate to do the reset, or IsFirstTickOfBar.

            You may also need to reference the Prior bar depending on the configuration to provide the last tick to the correct bar. Really this is something you would need to experiment with inside of the script you will use to check how the scripts configuration will affect the results.

            I am unsure of any existing example of this, but you could search for accumulation on the forum to see various examples of different types of accumulation with variables.

            For processing, you will likely need to use the BarsInProgress index to delegate your logic. We have a description of using multiple series here which outlines how the series would be called and provides examples of accessing that data.




            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Aviram Y, Today, 05:29 AM
            0 responses
            2 views
            0 likes
            Last Post Aviram Y  
            Started by quantismo, 04-17-2024, 05:13 PM
            3 responses
            25 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by ScottWalsh, 04-16-2024, 04:29 PM
            7 responses
            34 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by cls71, Today, 04:45 AM
            0 responses
            6 views
            0 likes
            Last Post cls71
            by cls71
             
            Started by mjairg, 07-20-2023, 11:57 PM
            3 responses
            218 views
            1 like
            Last Post PaulMohn  
            Working...
            X