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 charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      72 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      152 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      162 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      100 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      288 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X