Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problems with Add(0 method

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

    Problems with Add(0 method

    It's nice to be able to place additional Barsarray objects onto a chart in the Initialize module using the Add method, but this seems to be a good way to generate indicators that plot flat lines or crash. Usually the method will work, but it's not unusual for the ADDed BarsArray object to have a Count of Zero, causing the indicator to plot a flat line. Then, if Ninjatrader is restarted the ADDed BarsArray objects sometimes will come in and sometimes they won't. Or sometimes Ninjatrader will crash with a stack overflow.

    Because the Add method is used in the Initialize module, where Bars Array properties are not available, there is no way to tell there if the Add() operation was successful, or to do anything about a failure.

    Heaven help you if you try to Dispose() of a BarsArray object in OnTermination(), which will cause a really nasty crash.

    This supposed capability is not living up to reasonable expectations. There seem to be serious under the hood problems with Add().

    "Unfortunately this is beyond the scope...."

    #2
    Hello,

    Thank you for your feedback and sharing your experience with this particular method.

    Would you be able to provide a sample script which illustrates the stack overflow error? I would like to run this on my end to see if we can further explain this behavior, or use this to help improve this method in a potential future version.

    Thanks.
    MatthewNinjaTrader Product Management

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    574 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    332 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    553 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    551 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X