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 NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      54 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      130 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      72 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      44 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      49 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X