Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Volumetric dataseries

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

    Volumetric dataseries

    Hello,

    I´m having error messages ref. onbarupdate when using volumetric dataseries and I cant find the reason. I have
    NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe barsType = BarsArray[2].BarsType as NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe;
    if (barsType == null) return;
    NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe barsType2 = BarsArray[4].BarsType as NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe;
    if (barsType2 == null) return;
    and I use it eg
    if(barsType2.Volumes[CurrentBars[4]].GetAskVolumeForPrice(Highs[4][0])>barsType.Volumes[CurrentBars[2]].GetAskVolumeForPrice(Highs[2][0]))
    and
    if(barsType.Volumes[CurrentBars[2]].GetBidVolumeForPrice(Highs[2][0])==0)
    and when accessing bars ago
    if(barsType2.Volumes[CurrentBars[4]-1].GetAskVolumeForPrice(Highs[4][1])>.....)

    Is there any syntax wrong please? I cant find from helpguide what would be wrong here.

    Thank you!
    Tony
    Last edited by tonynt; 12-18-2020, 02:44 PM. Reason: typo

    #2
    Hello Tony,

    Thanks for your post.

    I suggest using debugging prints to see which line of code is throwing the error. Once you identify the line of code that is throwing the error, check each object in that line to see which object is null when you are refencing it. The object you are referencing that is null would need to be corrected, either with a null check, or the object that is being referenced will need to be replaced with an object that is not null.

    Debugging Tips - https://ninjatrader.com/support/help...script_cod.htm

    Checking for null references - https://ninjatrader.com/support/help...references.htm

    We look forward to assisting.

    Comment


      #3
      Hello,

      I found the error...

      Thank you for your support!
      Tony
      Last edited by tonynt; 12-20-2020, 10:19 AM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CaptainJack, 05-29-2026, 05:09 AM
      0 responses
      172 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 05-29-2026, 12:02 AM
      0 responses
      88 views
      0 likes
      Last Post CaptainJack  
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      129 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      208 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      185 views
      0 likes
      Last Post CarlTrading  
      Working...
      X