Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 timko, Today, 06:45 AM
    1 response
    7 views
    0 likes
    Last Post gaz0001
    by gaz0001
     
    Started by Waxavi, 04-19-2024, 02:10 AM
    3 responses
    41 views
    0 likes
    Last Post gaz0001
    by gaz0001
     
    Started by Max238, Today, 01:28 AM
    2 responses
    26 views
    0 likes
    Last Post NinjaTrader_ChristopherJ  
    Started by Shansen, 08-30-2019, 10:18 PM
    25 responses
    949 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by JonesJoker, 04-22-2024, 12:23 PM
    8 responses
    43 views
    0 likes
    Last Post JonesJoker  
    Working...
    X