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

Volume - ASK BID on each price of candle

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

    Volume - ASK BID on each price of candle

    Hello,

    I want to create indicator which show Volume ASK and Volume BID on every price level of last closed candle:

    Volume ASK, Volume BID, Price
    40, 50, 1002
    59, 20, 1001
    02, 30, 1000

    Is there an easy way how to get Volume ASK and Volume BID of previous Candle on specific price?

    Thanks

    Paul

    #2
    Hello Paul,

    Thank you for your note.

    Is this level 1 or level 2 data?

    With level 1 data you would save accumulate the volume to a dictionary or similar object as those price levels are hit. This could be from adding an ask and bid series with AddDataSeries or from real-time data in OnMarketData.

    With level 2 data a dictionary would still be used but this would be in OnMarketDepth only.

    Below are links to examples.

    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      I want only Level 1 data (these are common I expect). The examples are for what level?

      Comment


        #4
        Hello Paul,

        The 'Creating your own Level II data book' demonstrates level 2 data.

        The TnSVolumeExample is level 1 data that would be seen in the Time & Sales window.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          hello.

          I want to compare the volume ask with the bid.

          For example, between volume ask in 80.25 with volume bid 80.24.

          how can i do this. thank you​

          Comment


            #6
            Hello NinjaTrader_ChelseaB​.

            I want to compare the volume ask with the bid.

            For example, between volume ask in 80.25 with volume bid 80.24.

            how can i do this. thank you​​

            Comment


              #7
              Hello juannn,

              You can get the ask with GetCurrentAskVolume() and GetCurrentBidVolume().



              It sounds like you want to subtract the bid from the ask?

              Print(GetCurrentAskVolume() - GetCurrentBidVolume());
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                How can I do it at a certain price?

                Thank you

                Comment


                  #9
                  Hello juannn,

                  See post # 2 about Level 2 in OnMarketDepth().
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #10
                    what I want is that when the candlestick closes, the buying volume of candlestick 1 of the High[1] price level is printed. For that I have to use LEVEL 2 and a dictionary?

                    Comment


                      #11
                      Hello juannn,

                      Yes, you would need to store all of the Level 2 data in the dictionary, then when the bar closes, get the volume saved at the index of the price.

                      The Level 1 is at whatever price the current level 1 is, which is continuously changing. If you want the last volume or total volume updated at a specific price, then you need to save the volume when there is volume at that specific price.
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #12
                        I've seen how TwS Volume Example works, and I think it does that. in that code how can I get the priceLevelsAsk[marketDataUpdate.Price.ToString()] that I want? Or would I have to do a whole new code?

                        Comment


                          #13
                          Hello juannn,

                          This would depend on what are you wanting..

                          Yes, if you want level 1 data you could save level 1 data to a dictionary instead.

                          Typically, if a user is talking about the volume at price levels, like on the superdom, they are referring to level 2.

                          But yes, use whichever you specifically need.
                          Chelsea B.NinjaTrader Customer Service

                          Comment


                            #14
                            IN TnSVolumeExample I see that it already saves them in a dictionary, I can't use that one?

                            Comment


                              #15
                              Hello juannn,

                              Yes, if you want level 1 data you can use this example.
                              Chelsea B.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by judysamnt7, 03-13-2023, 09:11 AM
                              4 responses
                              59 views
                              0 likes
                              Last Post DynamicTest  
                              Started by ScottWalsh, Today, 06:52 PM
                              4 responses
                              36 views
                              0 likes
                              Last Post ScottWalsh  
                              Started by olisav57, Today, 07:39 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post olisav57  
                              Started by trilliantrader, Today, 03:01 PM
                              2 responses
                              22 views
                              0 likes
                              Last Post helpwanted  
                              Started by cre8able, Today, 07:24 PM
                              0 responses
                              10 views
                              0 likes
                              Last Post cre8able  
                              Working...
                              X