Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

volumatric bar erroor

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

    volumatric bar erroor

    I was trying fetch current candle poc and and previous candle poc value using below code
    and i have attached error in screenshot please guide me

    if cpoc and ppoc should return with some numeric value that what i was looking for like price of POC

    // Access Volumetric bars
    VolumetricBarsType volumetricBars = BarsArray[1] as VolumetricBarsType;
    if (volumetricBars == null)
    return;

    double Cpoc = volumetricBars.GetPointOfControl(CurrentBar);
    double Ppoc = volumetricBars.GetPointOfControl(CurrentBar[1]);​
    Last edited by siddhugaddi; 09-13-2024, 04:33 AM.

    #2

    Hello siddhugaddi,

    The first errors are becuse of how you defined VolumetricBarsType, it should look like this:

    NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe barsType = Bars.BarsSeries.BarsType as NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe;​

    The other problem you have here is that GetPointOfControl is not a method, currently the POC is not exposed from the volumetric bars. You can see a list of the available methods that can be used here:



    The third error is simply because [1] was added to CurrentBar in the code you have used, you can just remove the [1] from that to resolve that error.

    Comment


      #3
      Thank You

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      47 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      23 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      33 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      51 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Working...
      X