Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

get the bid ask volume inside the bar from the example

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

    #76
    the problem is that the volumetric volumes seems to be static if you see the price level 14487.5 its volume in the volumetric is 40 and stays that. while my indicator grows as time passes

    Comment


      #77
      Hello Pole123,

      Do you mean visually on the chart the volume is not changing?

      It could be there is no ask or bid movement at that specific price level..

      Below is a link to a video where I have tested.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #78

        Yes in realtime it does changes, but if you print the tick by tick in historical with tick replay enabled it does not change , it's static

        So my question is: How does it get the volumes in historical? since those are a static variable from the start of the bar

        Comment


          #79
          Hello Pole123,

          It would only be changing if the ask and bid are updating at that price. Likely the ask and bid are updating at a different price.

          The values from a script will be the same values the bar type is showing on the chart (albeit one tick behind due to the sequence of events) in both real-time and historical.

          The volume in historical comes from ask/bid time stamped historical tick data.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #80
            Test it yourself, i made it print each tick , if you see its constant for each price level. I would like to know how those are calculated in historical state
            Attached Files
            Last edited by Pole123; 10-25-2023, 03:02 PM.

            Comment


              #81
              Hello Pole123,

              I am not able to reproduce, the values are not static in realtime.

              Below is a link to a video that shows this is not the case.
              https://drive.google.com/file/d/1srK...w?usp=drivesdk


              Below is a link to the help guide on Volumetric.
              https://ninjatrader.com/support/help...tric_bars2.htm

              Calling Volumetric data does not require adding a 1 tick series. The Calculate.OnEachTick would be updating the values for each tick (and the close price of BarsInProgress 1 could be used.


              As a tip, to export a NinjaTrader 8 NinjaScript so this can be shared and imported by the recipient do the following:
              1. Click Tools -> Export -> NinjaScript Add-on...
              2. Click the 'add' link -> check the box(es) for the script(s) and reference(s) you want to include
              3. Click the 'Export' button
              4. Enter a unique name for the file in the value for 'File name:'
              5. Choose a save location -> click Save
              6. Click OK to clear the export location message
              By default your exported file will be in the following location:
              • (My) Documents/NinjaTrader 8/bin/Custom/ExportNinjaScript/<export_file_name.zip>
              Below is a link to the help guide on Exporting NinjaScripts.
              http://ninjatrader.com/support/helpG...nt8/export.htm
              Chelsea B.NinjaTrader Customer Service

              Comment


                #82
                For me it just happens with the historical data, when connected to tradovate which should be CQG

                Comment


                  #83
                  Hello Pole123,

                  In historical TickReplay must be enabled for Calcuate to run OnEachTick or OnPriceChange
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #84
                    Check the video, it is enabled

                    Comment


                      #85
                      Hello Pole123,

                      I'm not seeing any issue.

                      Below is a link to the test.
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #86
                        Originally posted by NinjaTrader_Jim View Post
                        Hello memonolog,

                        Please see the modifications attached. I use two Series<Dictionary<double, double>>'s to track bid/ask volume at price for every bar.

                        Somethings to keep in mind:

                        Anything Series related should only be done in SetValues. If not, you will hit errors since the Dictionary<double, double> is synchronized to the primary data series and CalculateValues is processed in BarsInProgress 1.

                        To work around this, I create temporary class level dictionaries to hold what is being calculated.

                        I then create the Dictionaries from the Series in SetValues and then I copy KeyValuePairs from the temporary dictionary to the Series dictionaries.
                        Hello Jim,

                        Thank you for the example. It helps me a lot!

                        It seems, that 0 asks/bids at a price level are not added to the Dictionary Series. After your Temp Series has been assigned to the Ask/Bid series, i sort the lists by price. When I print the Asks/Bids per price, I do not see any 0s and also the Count of the list is less then the prices per bar. I'm not able to figure out, why that is the case. I do want to have the 0s also in the list. Any idea why that might be the case. I add mockup and hoepfully it explains what the issue is.

                        Many Thanks !


                        Click image for larger version

Name:	08-12-_2023_15-35-50.jpg
Views:	318
Size:	361.5 KB
ID:	1281361

                        Comment


                          #87
                          Hello Stefan Mayer,

                          When the Volumetic is showing a 0, this means there was no ask (or bid depending on which side) update to add to the dictionary.

                          You could change the logic to add a volume of 0 for the ask when the bid updates if there is no value at that price level index in the dictionary.
                          Chelsea B.NinjaTrader Customer Service

                          Comment


                            #88
                            Hi Chelsea,

                            Sorry, I don't understand your reply fully.

                            All of that is done without Volumetric. The Footprint is done/shown with another indicator so i can visualize the data and check my own code, which is based on Jims example.

                            The dictionary is build by the Indicator itself (Example Indicator from Jim). So what ever the reason is, when adding the volume and the price to the Dictionary, the 0 once (Bid or Ask) are not added and I don't know why? Because when i put a Print check in the code, the volume never is 0; so somewhere before Getting the data, the 0 must be filtered out already.

                            Click image for larger version

Name:	222.jpg
Views:	361
Size:	235.5 KB
ID:	1281371

                            Comment


                              #89
                              Hello Stefan Mayer,

                              The dictionary has elements added when there is an ask or bid update. All of the ask and bid updates have volume. If there is no ask or bid update, there is nothing added to the dictionary.

                              Because you want values of 0, meaning no update, you would want to just add these with a volume of 0. If there is an ask update and no bid update, add to the bid dictionary a volume of 0 at that price.
                              Chelsea B.NinjaTrader Customer Service

                              Comment


                                #90
                                Hello Chelsea,

                                thank you for you very fast reply. Since I have some missing knowledge when working with ticks, I want to thank you for your patience and helping closing my knowledge gap in that area.

                                I understand that for 0 no update will be done, but that means, the CalculateValues() method is never called for it, correct? So only after the Bar has closed I'm able to identify the missing price in one of the Dictionaries by searching the 2 Dictionaries, and check if a price exists in both, if not, then i need to add it. Do you see this as the correct approach?

                                And if Bid and Ask are 0, then the price will not appear in any list; which means, i need to check from Bar High to Bar Low for every possibel price in-between and check if it exists?

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                                0 responses
                                577 views
                                0 likes
                                Last Post Geovanny Suaza  
                                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                                0 responses
                                334 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
                                553 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by RFrosty, 01-28-2026, 06:49 PM
                                0 responses
                                551 views
                                1 like
                                Last Post RFrosty
                                by RFrosty
                                 
                                Working...
                                X