Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trying to avoid NT8 crashes

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

  • GeorgeW
    replied
    Hello Jim,
    I have worked out that my issue is that one of my indicators is using lots of draw objects, so if I load let's say 20 days, there are thousands of draw objects loaded. This causes the performance issues when I use the drawing tools and try to adjust the colour of say a manually drawn horizontal line. If I reduce the days loaded to say 5, as my indicator has less draw objects on the chart, the performance issue disappears when working with the drawing tools. But I am going to want many more than 5 days of tick data loaded at times.

    My drawing code is all in OnBarUpdate(), I haven't got my head around OnRender() yet. I have tried the NT8 Best Practices - Performance Practices - Restricting OnRender() calculations to visible ChartBars : by wrapping the code below around my drawing objects code within the OnBarUpdate() section. This reduces the screen blackouts to seconds instead of minutes. Is there anything else I can do to eliminate them altogether?
    Code:
    if (ChartBars != null)
    		  {
    		    /* restricting this loop to only the ChartBars.From/ToIndex limits the loop to only what is visible on the chart. This reduces
    			  the random spikes in CPU useage that drawing lots of objects that are not visible can cause*/
    		    for (int barIndex = ChartBars.FromIndex; barIndex <= ChartBars.ToIndex; barIndex++)
    }
    }    {

    Leave a comment:


  • NinjaTrader_Jim
    replied
    Hello everyone,

    Thank you for providing that input.

    I will continue monitoring this thread for any reproduce-able issues that we can pursue.

    @manugarc, have you been able to reproduce the error using the sample provided?
    Last edited by NinjaTrader_Jim; 04-26-2017, 07:55 AM.

    Leave a comment:


  • GeorgeW
    replied
    Hello Jim,

    I removed all my indicators, reloaded them one at a time and tested the Drawing Tools. I have found that the issue only occurs when I have one of my custom indicators loaded. I'll have to check it out to discover why it is causing this problem. It only happens on tick charts that I have this indicator on. I have virtually the same indicator loaded onto minute charts (the only difference is that a secondary series on that indicator is set to Miniutes rather than Ticks), and the problem does not occur on the minute charts.

    Thanks

    Leave a comment:


  • reach4thelasers
    replied
    From that exception stacktrace it looks like you're trying to draw something to the chart from an async EventHandler. You need to wrap the draw request in a closure and Dispatch it to the correct thread's work queue:
    Code:
    	ChartControl.Dispatcher.Invoke(() => Draw.Line(this, false, 0, 1, 0 etc etc etc));

    Leave a comment:


  • NinjaTrader_Jim
    replied
    Hello everyone,

    I am not refuting anyone's claims that they are experiencing issues. In order to provide further input, I need to reproduce the issue. On my end, I cannot reproduce this matter. It will be much more beneficial if we can utilize a piece of code that demonstrates the issue on all of our machines.

    Those who are experiencing issues, can you reproduce issues with the barebones sample as well?

    Are there any exact steps I can take to reproduce this matter as well? For example, manugarc points out it needs to be tested for a few days, but is there a specific interval of market replay data we can use to efficiently reproduce the matter?

    @GerorgeW, are you able to reproduce crashes using Drawing Tools (on a chart not by NinjaScript) in Safe Mode? (Safe Mode will boot NinjaTrader 8 without any add-ons workspaces or templates.) Please Hold the Ctrl button and double click the NinjaTrader 8 icon. Release the Ctrl key when the splash screen appears and says you are booting Safe Mode. (You can confirm you are in Safe Mode under Help > About) If so, could you provide a video of the exact steps I need to take to reproduce? We use Jing. (I have not been able to reproduce by simply creating a text object and changing the properties.)

    If we cannot find a cause to this matter, we may have to arrange a remote support session to gather more information.

    I look forward to being of further help.

    Leave a comment:


  • Alfred
    replied
    Originally posted by manugarc View Post
    Hi Jim,

    I've simplified my strategies to the maximum; now they just draw some vertical lines (less than 10 per day in a 1 minute-bar chart each one), to be sure what's the problem, and after 20 hours of having them running here I have it:

    Code:
     2017-04-21 05:46:28:011|3|16|Failed to call OnRender() for chart object 'Vertical Line': 'External component has thrown an exception.'
    That's all the content on the log file, no more lines or messages.

    This makes NT8 (latest version) crash.

    I would appreciate a sincere answer; Is it possible to avoid these crashes as far as you know?
    Can I have an OnRender() code which Try/Catch on these exceptions?
    Do you think is there any way to keep on using NT8 without getting these exceptions?

    Thanks in advance.
    I have been having similar crashes when drawing vertical lines manually with the Draw Tools....(plus I get the same OnRender Vertical Line error message)....I draw perhaps 40 or so vertical lies a day....it is not unusual to get several crashes a day. So far cannot identify what may trigger a specific crash....

    Leave a comment:


  • GeorgeW
    replied
    Today I used the NT Drawing Tools to write some notes to the chart. I wanted to adjust them via the properties, and again the chart went black as I accessed properties. Once I got access, I adjusted the note and pressed OK. The chart went black again, lasting for several minutes, so I had to shut down NT via Task Manager.
    I have attached an image of the black chart.

    This general problem has been identified by others at Futures.io - see post #21 "Although NT8 is much faster in many regards, doing a few simple tasks, it is much more sluggish than NT7. The crosshair, bringing up indicators properties box and general graphical refreshing to name a few...*"
    Attached Files

    Leave a comment:


  • GeorgeW
    replied
    Hello Jim,

    I am using the inbuilt NT Drawing Tools manually when this happens, so I am not using another indicator or strategy. The horizontal line freeze can occur at any time after the line has been drawn on the chart. Changing the colour of the arrow line makes the chart go black immediately, sometimes for 1 minute +.

    Leave a comment:


  • manugarc
    replied
    That's great Jim. Now put a number of those strategies to run and wait a few days. Exceptions don't appear as soon as you want.

    By the way, please don't offense, but I'm graduated as computer science engineer and I'm quite sure that if drawing a vertical line breaks NT8 the problem is not on my code. I have NEVER had this kind of problems on any other platform and I'm impressed you persevere on saying the problem is on my code when it's so obvious it's not possible since it happens when DRAWING A SAD VERTICAL LINE.

    EDIT:

    I'll elaborate it a bit more just to make the situation clear:

    If I'm using your "draw-line" function to ask NT8 to add a line, and I'm using your OnRender() function to draw them, there is no possible way that my code has nothing to do with those exceptions; all the process is "NT8-internal".

    Either your draw-line function stores in a wrong way the data, or OnRender() doesn't manage correctly the objects to be drawn, that's why I find misplaced that you ask me to contact any consultant.

    You have at least another person telling you he's having the same problem with horizontal lines; come on guys, someone should be checking what happens with OnRender() instead of trying to ignore the problem. It's not about any complex algorithm, it's about drawing a simple line...
    Last edited by manugarc; 04-22-2017, 10:04 AM.

    Leave a comment:


  • NinjaTrader_Jim
    replied
    Hello manugarc,

    There has to be more to your issue than just creating vertical lines that is creating the OnRender() error.

    I have created a barebones strategy that only draws vertical lines and I am not receiving any errors. I have attached my code and a screenshot of a chart that demonstrates that the NinjaTrader 8 drawing objects do work properly.

    If you are completely stumped with debugging your code, we could get you connected with a NinjaScript Consultant that would be happy to debug the code for you. (If that is the case, please send an email to platformsupport[at]ninjatrader[dot]com.)

    Please let me know if I can be of further help.
    Attached Files

    Leave a comment:


  • manugarc
    replied
    Hi Jim,

    Well, there is not much more to say; the strategy draws vertical lines and that makes NT8 crash.

    I guess you can reproduce it by using a code which draw lines, as my strategies do.

    I was asking you about the OnRender() function code to debug it by myself since now I don't know what code do you use.

    "Providing debug assistance is outside the scope of our support" Please have in mind I'm not asking for debugging my code but yours. The exception is not generated by any of my functions but by OnRender() when a vertical/horizontal line is drawn. Being a version "stable", this shouldn't be happening.
    Last edited by manugarc; 04-21-2017, 02:47 PM.

    Leave a comment:


  • NinjaTrader_Jim
    replied
    Hello manugarc and GeorgeW,

    In order to assist further, I must see how you are producing these errors.

    Could you provide me an indicator or strategy that only has logic to place these drawing objects and produce the error? Providing debug assistance is outside the scope of our support, so I would only offer my opinion of the errors received. We are not equipped to design strategies or indicators to reproduce scenarios described by our clients. This is where we would require a test case from you to investigate further.

    I would appreciate a sincere answer; Is it possible to avoid these crashes as far as you know?
    I would need to have a complete understanding of how you are reproducing this error before I can offer any suggestions.

    Can I have an OnRender() code which Try/Catch on these exceptions?
    You can add Try/Catch blocks to code within OnRender(), but if you are not overriding it and placing your own code there, there would not be much reason to consider this.

    Do you think is there any way to keep on using NT8 without getting these exceptions?
    We will have to know how you are producing these errors if you would like to correct them.

    I look forward to being of further help.

    Leave a comment:


  • GeorgeW
    replied
    Hello ManugarC and Jim,

    I also have intermittent crashes due to a similar error thrown on the horizontal lines, or if I try to adjust the colour of a draw object.

    Code:
    21/04/2017 07:38:12	NinjaScript	Failed to call OnRender() for chart object 'Horizontal Line': 'External component has thrown an exception.'
    I suspect it may have started when I used SIM22_DrawingToolbarV3 Indicator, but I cannot be sure, as although removing it reduces the occurrences, the errors still happen.

    Leave a comment:


  • manugarc
    replied
    Hi Jim,

    I've simplified my strategies to the maximum; now they just draw some vertical lines (less than 10 per day in a 1 minute-bar chart each one), to be sure what's the problem, and after 20 hours of having them running here I have it:

    Code:
     2017-04-21 05:46:28:011|3|16|Failed to call OnRender() for chart object 'Vertical Line': 'External component has thrown an exception.'
    That's all the content on the log file, no more lines or messages.

    This makes NT8 (latest version) crash.

    I would appreciate a sincere answer; Is it possible to avoid these crashes as far as you know?
    Can I have an OnRender() code which Try/Catch on these exceptions?
    Do you think is there any way to keep on using NT8 without getting these exceptions?

    Thanks in advance.
    Last edited by manugarc; 04-20-2017, 10:15 PM.

    Leave a comment:


  • manugarc
    replied
    Ok, so I guess there is some kind of misunderstood; maybe my fault, excuse my english. I though you were suggesting me to override OnRender() to debug it (it looks to me a good idea indeed), but I think you believe I've already override it; I have not, that's why I wasn't able to do anything more than asking for help

    EDIT: Right now I find quite hard to create a sample code since my strategy is too big in code to simplify it, specially when I don't know where could be the problem, but it works with more than only 1 instrument on the chart; not sure about that could be part of the problem, but after thinking about it for a long time, I don't find anything else "special" on my strategy leaving apart its internal logic.

    EDIT2: In short: All I do regarding to visual objects is to draw some vertical lines (really few) and the messages NT places on the chart when the strategy sends the orders.
    Last edited by manugarc; 04-13-2017, 02:16 PM.

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by SalmaTrader, 07-07-2026, 10:26 PM
0 responses
92 views
0 likes
Last Post SalmaTrader  
Started by CarlTrading, 07-05-2026, 01:16 PM
0 responses
51 views
0 likes
Last Post CarlTrading  
Started by CaptainJack, 06-17-2026, 10:32 AM
0 responses
23 views
0 likes
Last Post CaptainJack  
Started by kinfxhk, 06-17-2026, 04:15 AM
0 responses
34 views
0 likes
Last Post kinfxhk
by kinfxhk
 
Started by kinfxhk, 06-17-2026, 04:06 AM
0 responses
34 views
0 likes
Last Post kinfxhk
by kinfxhk
 
Working...
X