Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Chart rendering error - B5

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

    Chart rendering error - B5

    Hi

    I've been trying to find the source of "Chart rendering failed." errors. I'm at a stage now where I think I need to uninstall / re-install NT8, but before I do, is there anything helpful I can provide you?

    I have an indicator that draws a trend line. Over a period of time, incidences of the following error have become more and more frequent.
    "A direct X error has occured while rendering the chart: HRESULT: [0x88990001], Module: [SharpDX.Direct2D1], ApiCode: [D2DERR_WRONG_STATE/WrongState], Message: Unknown"

    I created a simple indicator that reproduces the error, however, initially it took many instrument changes (50+) on 4 linked charts (as though manually scanning) for the error to occur. The more I tested it, the sooner it occurred, and now it only takes a couple of instrument changes.

    To recover from the error, initially I needed to End Task to kill NT8 and restart NT8. Later, I also needed to restart Windows (7 SP1). Now even a full power down will not restore normal operation. I'm thinking there's some garbage left over from the crashes that's messing things up.

    Before I uninstall NT8 and clean everything up, do you want me to send, e.g. indicator, logs, trace...?

    Cheers
    Tony

    #2
    Hello,

    Thank you for the post.

    For this, because you are planning on a re install and currently it is unknown what all is causing the problem I would suggest doing the following steps:

    If a specific indicator is causing this, I would suggest creating a workspace that contains the charts or other windows required to reproduce.
    Save the workspace
    Export the indicator in question.

    If you can mail that into our platform support @ ninjatrader.com, we could test the indicator/workspace to see if we can re produce and report to development.

    In the case we can not re produce on our end, I would suggest renaming your NinjaTrader 8 folder that is in the Documents folder to "NinjaTrader 8 Old" to preserve the files causing the problem.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      I also get this error in B5. The general repro case is that when an indicator that renders via directx is on the chart and in the OnRender() method, and the user does something such as disconnect/reconnect to a data feed or switches instruments concurrently with execution of OnRender(), this error is logged. 2 things then happen:

      - NT also crashes altogether or the chart freezes (NT will ultimately crash later)
      - a thread is left spinning in an infinite loop (probably the chart UI thread)

      The real core of the issue is that the error does not say what object is that's in the wrong state (RenderTarget probably?) and there's nothing in the docs that I can see about how to check whether the state is valid to render (of whatever object is the issue).

      Also - I'd make a humble request for an exception to be thrown in this case *at the very least*, otherwise there's no way for code to handle this gracefully. That doesn't happen now.

      I don't have a script I can give you to do reproduce this, but you should be able to isolate this condition based on the information above.

      Comment


        #4
        I too seem to recently be experiencing this error as well in b5.. What's unique for me about now vs before is I recently created a workspace with 7 windows open, each with multiple tabs, the same instrument for each tab but with different timeframes, and each tab having 3-5 indicators applied..

        It almost seems (although can not be sure) when using IsSuspendedWhileInactive = true and overriding the OnRender is when I started seeing this error (I'm thinking from an inactive tab (which I hadn't been using before) ).. But then it could also be a drawregion used by one of my indy's in an inactive tab that might be causing this as well.. It's almost impossible to track down, as it doesn't seem to effect every chart, even though they all have the same indy's applied, and it's not something that consistantly happens, only over time.. And like Rancho mentioned there's no indication in the error msg what the object or chart is, or any anything to help isolate..

        Mine doesn't crash NT, but only the window(s) effected, and that's not always the same, I've had it be only one, to up to 3.. Now even though I say NT doesn't crash, once this happens the only way to get things back to normal is to close things thru the task manager..

        To add to my delema, about 1/2 the times I've experienced this is when a web browsing window was maximized on the screen over the top of all the charts, but honestly, I can not tell if this had anything to do with it or not, as it has happened with and without that senerio.. Just seems like a strange coincidence as it's extremely rare I have a web browser open like that and that it's happened multiple time under that scenario.

        I'm running a test today with all my indy's set to IsSuspendedWhileInactive = false to see if this will make any difference at all.. Ultimately this isn't the best or even a good solution really, but might help to issolate down what might be causing this.. So far so good, but it's way to early to tell..


        -=Edge=-
        NinjaTrader Ecosystem Vendor - High Tech Trading Analysis

        Comment


          #5
          I've been trying to troubleshoot why I end up with these directx errors from time to time. I've put together this sample script that I believe should duplicate the same type of errors I'm experiencing..

          Open ninja, do not connect to data.. Open a 1 min es chart and load 5 days of data, set to calculate on price change (instrument, dataseries, and days back probably doesn't matter).. Load this script.. Then connect to data.. Almost every time I instantly get a directx error and chart rendering failed.. If it doesn't do it on connection, just do a refresh ninjascript a couple times..

          Is there a bug somewhere causing this, or am I just missing something simple here, as I did throw this together rather quickly..


          Attached Files
          -=Edge=-
          NinjaTrader Ecosystem Vendor - High Tech Trading Analysis

          Comment


            #6
            Yep, that's one way I can repro it for sure.

            No matter what the resolution I'd again like to pester you guys again for an exception to be thrown in OnRender() if this is a scenario NT can't guard against/prevent in a deterministic way. A deterministic failure case is the next best thing IMO.

            Otherwise there's just no way to handle this at all, let alone gracefully.

            Comment


              #7
              Originally posted by -=Edge=- View Post
              I've been trying to troubleshoot why I end up with these directx errors from time to time. I've put together this sample script that I believe should duplicate the same type of errors I'm experiencing..

              Open ninja, do not connect to data.. Open a 1 min es chart and load 5 days of data, set to calculate on price change (instrument, dataseries, and days back probably doesn't matter).. Load this script.. Then connect to data.. Almost every time I instantly get a directx error and chart rendering failed.. If it doesn't do it on connection, just do a refresh ninjascript a couple times..

              Is there a bug somewhere causing this, or am I just missing something simple here, as I did throw this together rather quickly..


              Thanks, I was able to isolate that scenario to the Draw.Ray() method and reported to development using NTEIGHT-9004
              MatthewNinjaTrader Product Management

              Comment


                #8
                Originally posted by NinjaTrader_Matthew View Post
                Thanks, I was able to isolate that scenario to the Draw.Ray() method and reported to development using NTEIGHT-9004
                hmmm.. I could swear I commented that line out and still got the error on occasion, just not as consistently reproducible..


                -=Edge=-
                NinjaTrader Ecosystem Vendor - High Tech Trading Analysis

                Comment


                  #9
                  Originally posted by -=Edge=- View Post
                  hmmm.. I could swear I commented that line out and still got the error on occasion, just not as consistently reproducible..


                  There could be other issues with the draw objects we'll take a look at here. But at least with your script, I could constantly reproduce with the Draw.Ray so i've sent that specific scenario in.

                  I'm also consulting with development again regarding RanchoDinero comments.
                  MatthewNinjaTrader Product Management

                  Comment


                    #10
                    Hi

                    This is what I've been seeing. Thanks, Edge, for isolating some reproducible steps.

                    For me it didn't occur with the Draw.Ray() line commented out. Nor did it occur with Draw.Ray() replaced by Draw.Line().
                    However, with Draw.ExtendedLine(), the error occurred with even connecting. All I had to do was re-load NinjaScript (F5) once.

                    It seems to be the rendering of the extended ends that causes the issue.

                    I'm using Forex pairs with Kinetick data.

                    Cheers
                    Tony
                    Last edited by Jellybean; 10-23-2015, 10:55 PM. Reason: More information

                    Comment


                      #11
                      Hi

                      A correction (kind of) to my previous post. The error does occur with Draw.Line(), but much less frequently.

                      I changed Draw.Ray() to Draw.Line() in my trend line indicator and proceeded to scan Forex pairs. It crashed after 12 instrument changes (with 4 linked charts) with the same error messages.

                      Cheers
                      Tony

                      Comment


                        #12
                        Originally posted by Jellybean View Post
                        For me it didn't occur with the Draw.Ray() line commented out. Nor did it occur with Draw.Ray() replaced by Draw.Line().
                        However, with Draw.ExtendedLine(), the error occurred with even connecting. All I had to do was re-load NinjaScript (F5) once.
                        Originally posted by Jellybean View Post
                        A correction (kind of) to my previous post. The error does occur with Draw.Line(), but much less frequently. I changed Draw.Ray() to Draw.Line() in my trend line indicator and proceeded to scan Forex pairs. It crashed after 12 instrument changes (with 4 linked charts) with the same error messages.
                        Yes, I don't believe it's just the Ray. You can also change the dot to diamond and you'll get the error from time to time when one or both of the diamonds are not directly visible on the chart..

                        I also believe the draw.region is effected in the same way, as I was getting this error, from a hidden tab I believe, and just over time without doing anything..

                        2015-10-19 06:58:00:673|0|4|Unhandled exception: Object reference not set to an instance of an object.
                        2015-10-19 07:03:56:483|3|16|Failed to call OnRender() for chart object 'Region': 'Object reference not set to an instance of an object.'
                        2015-10-19 07:03:56:483|3|4|Indicator 'Name': Error on calling 'OnRender' method on bar -1: Object reference not set to an instance of an object.
                        2015-10-19 07:03:56:486|3|16|Chart rendering failed. There is likely a problem with a chart object's OnRender method. D2D error = 'Object reference not set to an instance of an object.'

                        Although haven't seen this error again since changing IsSuspendedWhileInactive to false, but I'd really prefer not to have to do that..

                        Also funny you should mention the linked charts.. As there might be an issue with that as well.. I had several charts, with multiple tabs, with each tab 1,2,3 of each chart set up with the same instrument links.. When I manually rolled over crude last month, all the tabs started to change instruments, and then ended up with an error and crash..

                        I can't remember which day I did that on or what the error was, whether it was an object, index out of range, the sharpdx.dll memory, or even a no data exists for the row/column.. I've been working on so many things lately they all start running together.. I nuked all those links back to the off state for the time being, but would be interested to here if anyone else has experienced the same type of issue..


                        -=Edge=-
                        NinjaTrader Ecosystem Vendor - High Tech Trading Analysis

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by f.saeidi, Today, 12:14 PM
                        7 responses
                        16 views
                        0 likes
                        Last Post f.saeidi  
                        Started by Russ Moreland, Today, 12:54 PM
                        1 response
                        6 views
                        0 likes
                        Last Post NinjaTrader_Erick  
                        Started by philmg, Today, 12:55 PM
                        1 response
                        7 views
                        0 likes
                        Last Post NinjaTrader_ChristopherJ  
                        Started by TradeForge, 04-19-2024, 02:09 AM
                        2 responses
                        32 views
                        0 likes
                        Last Post TradeForge  
                        Started by aprilfool, 12-03-2022, 03:01 PM
                        3 responses
                        329 views
                        0 likes
                        Last Post NinjaTrader_Adrian  
                        Working...
                        X