Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

how do you index multiple volumetric data series?

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

    how do you index multiple volumetric data series?

    hi, i'm trying to reference multiple volumetric data series in a script.
    I add the volumetric data series here:

    else if (State == State.Configure)
    {
    AddVolumetric("ES 12-19", BarsPeriodType.Second, 15, VolumetricDeltaType.BidAsk, 1);
    AddVolumetric("ES 12-19", BarsPeriodType.Range, 8, VolumetricDeltaType.BidAsk, 1);
    }

    create a variable here:
    NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe barsType = Bars.BarsSeries.BarsType as
    NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe;

    but how do you access the bar values? for example, if I wanted to access the delta for the bar, I would normally reference: Print("Delta for bar: " + barsType.Volumes[CurrentBar].BarDelta); for example. Do I index Volumes, or current bar? not sure how to access the delta for both the second and range volumetric series.

    #2
    Hello Renorail,

    Thanks for your post.

    From the help guide you would use the following as the means to assign a BarsArray[n] to the instance you create:

    NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe barsType = BarsArray[1].BarsType as NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe;
    Reference: https://ninjatrader.com/support/help...tric_bars2.htm

    Note that the name of the instance is "barsType", so you could also change this to be as you need to identify the instance to then access the data for example:

    NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe my15s = BarsArray[1].BarsType as NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe;

    NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe my8r = BarsArray[2].BarsType as NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe;



    Print("15 second Total Volume: " + my15s.Volumes[CurrentBars[1]].TotalVolume);

    Print ("8 range Total Volume: "+ my8r.Volumes[CurrentBars[2]].TotalVolume);

    Last edited by NinjaTrader_PaulH; 10-01-2019, 07:01 AM. Reason: Please note "Ty pe" should be "Type"

    Comment


      #3
      Thank you Paul!

      Comment

      Latest Posts

      Collapse

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