Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Adding volumetric data series if necessary

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

    Adding volumetric data series if necessary

    Hi, I am developing an indicator that requires volumetric data; however, I still want to use it if the chart main time frame is not volumetric. Not sure if it is the best approach, but to work around the issue, what I have come up so far is trying to add a second data volumetric series based on the main time series and then using the second time series as my main series which obviously creates a lot of redundancy and waste of resources. My questions:

    1- Is there a better approach?
    2- Assuming my approach is correct, I still get into some issues. First of all, adding the volumetric version of a non-volumetric series works fine just by using:
    AddVolumetric(BarsArray[0].Instrument.FullName, BarsArray[0].BarsPeriod.BarsPeriodType, BarsArray[0].BarsPeriod.BaseBarsPeriodValue, VolumetricDeltaType.BidAsk, 1); \\This works fine

    However, If the main time frame is in volumetric and I want to duplicate it I can not use the above line of code; because "BarsArray[0].BarsPeriod.BarsPeriodType," for volumetric data does not simply return, second, day, range, tick, etc. Now my question is how I can duplicate the main volumetric BarsArray[0] into volumetric BarsArray[1]?

    Thank you in advance.





    #2
    Hello Photon66,

    Adding the volumetric as a secondary would be the correct approach however when AddDataSeries/AddVolumetric there is really no choice for the script to be dynamic. What you have shown is not valid based on what the help guide recommends because you are using runtime variables. If you plan to use those methods you need to hard code the values like the help guide describes rather than relying on runtime variables like the instrument/bar series.

    In this case I could only recommend that you make the script for 1 specific purpose instrument instead of planning on having it run on a variety of different settings. You could make separate scripts for separate use cases.

    The AddVolumetric should look like the help guide sample: AddVolumetric("ES 03-21", BarsPeriodType.Minute, 1, VolumetricDeltaType.BidAsk, 1);

    This ensures that the secondary data works in all places. When using runtime variables to construct a dynamic secondary series that will not work in all areas of the platform and should be avoided.


    Please let me know if I may be of additional assistance.


    Comment


      #3
      Thank you very much for the explanation.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      600 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      347 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      558 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      558 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X