Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Struggling to get the total volume of each price from a daily data series

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

    Struggling to get the total volume of each price from a daily data series

    Hi there,

    I'm currently running my indicator on a 60 min ES 06-22 chart.

    The indicator plots a horizontal Y drawing on the daily POC by using VolumetricBarsType. This is successful. It then iterates through the days range from the lowest low to the highst high and attempts to get each prices total volume.

    There are two thing going wrong:
    1. The volumes I'm getting back are all way way too low (comparing the correct POC value I get from my first method with this one and it is not correct)
    2. I'm getting a 0 value for a lot of prices. I think it could be linked to the previous days prices but I'm not too sure

    I've hopefully attached the full indicator code here and if you're able to run it, I am logging out the results where you'll be able to see what's going on.

    Thanks very much,

    Tarik
    Attached Files

    #2
    FYI just had a browse of the last few posts and came across https://ninjatrader.com/support/foru...etric-bar-info and one of NinjaTrader_Jim answers is literally my logic here. But I think the traders problems may not be the same as what I am seeing.

    Comment


      #3
      Hello tarikmedjber,


      1. The volumes I'm getting back are all way way too low (comparing the correct POC value I get from my first method with this one and it is not correct)
      Are you seeing the same problem if you use the volumetric as it is shown in the help guide sample? From what I can see you are trying to execute the volumetric code using the daily series you added instead of the volumetric series, you also used the daily bar prices instead of the volumetric. I would suggest trying a more simple test like the help guide sample which only uses the volumetric series to confirm if you get the correct values for the volume.

      2. I'm getting a 0 value for a lot of prices. I think it could be linked to the previous days prices but I'm not too sure
      From what I can see that is the CheckEachPricesVolume method. I see that you used the daily bar high/low with the volumetric series. The 0's could potentially be caused if you are using values that are outside the volumetric bar prices. You would likely need to use a print here to check if the high/low and calculated prices are valid prices which the current volumetric bar has.

      Comment


        #4
        Hi Jesse,

        From what I can see you are trying to execute the volumetric code using the daily series you added instead of the volumetric series, you also used the daily bar prices instead of the volumetric.
        Can you point me to where I am doing this please? From what I believe, the volumetric series I added via
        Code:
         AddVolumetric(null, Data.BarsPeriodType.Day, 1, Data.VolumetricDeltaType.BidAsk, 1);
        is before the Added Daily data series within State.Configure so the Volumetric series index would be 1.

        This is the first instance of me accessing the volumetric series with index 1 and I think it works fine with getting the correct POC price and value.
        Code:
         double priceOfHighestVolume;
        currentPOCValue = barsType.Volumes[CurrentBars[1]].GetMaximumVolume(null, out priceOfHighestVolume);
        I then do the same when accessing each prices total volume
        Code:
        barsType.Volumes[1].GetTotalVolumeForPrice(i));
        .

        At the bottom of the file I do still have the code provided by NT PrintVolumetricBarData.

        You would likely need to use a print here to check if the high/low and calculated prices are valid prices which the current volumetric bar has.
        .

        Yep you are correct here thank you! But i don't understand why the volume series has a different high/low to the daily bar? Also the high/low of the volume bar doesnt seem to be changing for the 5 days I'm testing it on? Strange. I'll look into it whilst waiting for a reply but thank you very much for helping

        Tarik

        Comment


          #5
          Okay I think I may understand where I'm doing this.

          Can you point me to where I am doing this please? From what I believe, the volumetric series I added via
          In the check for BarsInProgress ==2 ?

          Cheers

          Comment


            #6
            lso the high/low of the volume bar doesnt seem to be changing for the 5 days I'm testing it on?
            I'm testing on 5 days from today until the 18th and it seems that the high/ low of the volume is always the second days daily high/low which is strange

            I've attached the output.
            Attached Files

            Comment


              #7
              Sorry for the bombarding of messages Jesse!! I've just fixed it all haha. So I was doing

              Code:
              barsType.Volumes[B][1][/B].GetTotalVolumeForPrice(i));
              instead of

              Code:
              barsType.Volumes[B][CurrentBars[1]][/B].GetTotalVolumeForPrice(i));
              Silly mistake. You helped me greatly to get there so thank you

              Tarik

              Comment

              Latest Posts

              Collapse

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