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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      45 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      21 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      31 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      50 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