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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      52 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      71 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      38 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      99 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      60 views
      0 likes
      Last Post PaulMohn  
      Working...
      X