Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Chart freeze with indicator that loads 28 additional DataSeries

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

    Chart freeze with indicator that loads 28 additional DataSeries

    Hi,
    I have built an indicator to examine forex relationships, and it loads 28 DataSeries of forex, using the chart timeframe.
    That seems to work fine, except that after a while the chart freezes, and the data stops flowing, and Ninja's Control Centre becomes unusable.
    At first, of course, I presumed the coding of the analysis logic within the indicator was somehow at fault, however I have now ruled that out by getting OnBarsUpdate() to do nothing except print the time on the chart.

    Code:
    if (State==State.Realtime)
         Draw.TextFixed(this,"proof of life",DateTime.Now.ToString(),TextPosition.BottomRight);
    
    return; // SHOW STOPPER - ENSURE DO NOTHING (TESTS FREEZING CHART)
    ​
    It still freezes.
    This, therefore, is beyond being a coding problem and seems to be a Ninja problem. I'd like you to examine and test the code please, to see what might be done.

    Thanks in advance,
    saltminer

    #2
    Hello saltminer,

    Thanks for your post.

    Adding a large number of additional data series to a NinjaScript, such as 28 added data series, will cause a very large number of computer resources to be used which could result in your computer freezing during calculations. This is because the indicator must process data for each data series that is added to the script.

    If any of these added data series use a Tick interval, such as 1-Tick, this could cause even more resources to be used when running your indicator. This is because the indicator would need to calculate each incoming tick that occurs for those added data series.

    You would likely need to reduce the number of additional data series added to your script to reduce the number of computer resources being used. By reducing the number of computer resources being used, NinjaTrader will be less likely to lag or freeze when running the indicator.

    If you reduce the number of additional data series added to the indicator to say, 3 added series, does the behavior you are reporting continue?

    I have tested a small sample script that adds 3 additional 1-Minute data series to the script and draws text on the chart using the Draw.TextFixed() method. The indicator ran without issue.

    Note that if you are running your indicator with Calculate.OnEachTick, you could consider changing the indicator to Calculate.OnPriceChange or Calculate.OnBarClose so the script consumes fewer computer resources.

    See the help guide documentation below for more information.
    AddDataSeries(): https://ninjatrader.com/support/help...dataseries.htm
    Working with Multi-TimeFrame/Multi-Instrument NinjaScripts: https://ninjatrader.com/support/help...nstruments.htm
    Performance Tips: https://ninjatrader.com/support/help...ance_tips2.htm

    Let me know if I may assist further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

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