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

NinjaScript Chart rendering failed ... DefaultA direct X error ...

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

    NinjaScript Chart rendering failed ... DefaultA direct X error ...

    Hello

    I have a render error, which I cannot catch in the VS debugger. See log-file.

    Is there anyone who can point me in to the right direction to find out what is wrong?

    The problem occurs when I switch to a saved workspace.

    - Chart rendering failed ….
    - Default A direct X error has occurred …


    Regards, Andbro
    Attached Files

    #2
    Hello AndBro,

    Thanks for your post.

    The error reports to be an issue with the state of a DirectX object, which could be a race condition or could be related to using custom brushes without properly freezing them.

    Could you provide more information on this indicator that you are using in the workspace that creates the OnRender() error?

    Let's first make sure we are both testing on NinjaTrader 8.0.8. This can be checked under Help > About. If you need to update, you can download the installer here: http://ninjatrader.com/PlatformDirect

    Does the indicator use Drawing Tools? If you comment out the code for the Drawing Tools, does the error still occur?

    If you are creating your own brushes, can you confirm that you are freezing them as well? Please see the link below for details.

    Creating Custom Brushes - https://ninjatrader.com/support/help...gcustombrushes

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

    Comment


      #3
      Hello Jim,
      Thank you for your answer. I have checked very carefully, searching for a “missing” freeze, but I have a freeze at all my custom brushes.

      The problem only occurs when I load a saved workspace. No problem, if I create the same workspace from scratch. This makes me thing it might be a serializing problem!

      - Is it possible, when loading a saved workspace, that the de- serializing goes wrong even the serializing goes well when saving the workspace (no errors to the log)?

      - Is it possible to track what kind of “DirectX object” that causes the problem? That would give me a good starting point where to dig in to my code!

      Regards, AndBro

      Ps: I use 8.0.8.0 (Multi-Broker)

      Comment


        #4
        Hello AndBro,

        Thanks for the reply.

        - Is it possible, when loading a saved workspace, that the de- serializing goes wrong even the serializing goes well when saving the workspace (no errors to the log)?
        I normally would not expect this to be the case as many indicators that I have used that have custom rendering do not have an issue when switching workspaces. However, you may have a different implementation and you could test this in your script if you are serializing resources that are used in relation to your custom rendering. If you, for example, recreate these resources statically instead of using parameters, this could show if there is an issue with serialization.

        - Is it possible to track what kind of “DirectX object” that causes the problem? That would give me a good starting point where to dig in to my code!
        The log only will provide an error code that could be references against the MSDN error code list. The best way I could think of to troubleshoot further is to comment out sections of the code that perform a certain aspect of your custom rendering.

        For example, if you are using PathGeometry and the order of operations is incorrect, you could comment out code related to creating the GeometryPath as well as the code for adding geometry to the GeometrySink. If the issue no longer persists, then we will know it is related to this section of code and the implementation will have to be checked.

        As SharpDX uses DirectX, the MSDN DirectX documentation may prove to be a valuable resource for developing and debugging.

        Error codes - https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx

        DirectX programming guide - https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx

        Please let me know if I may be of further assistance.
        JimNinjaTrader Customer Service

        Comment


          #5
          Hello Jim,

          You were right about excluding a serializing problem. Good, I did not spend any time on that …

          I finally found out the problem, and it was a 100% render-problem.

          In my indicator I use a static variable to keep information of which panel, plots are to be rendered. Due to different threads, this static variable was not adequate updated when the rendering executed. Now, the problem is solved.

          Thank you, AndBro

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by ScottWalsh, 04-16-2024, 04:29 PM
          6 responses
          27 views
          0 likes
          Last Post ScottWalsh  
          Started by frankthearm, Today, 09:08 AM
          10 responses
          35 views
          0 likes
          Last Post frankthearm  
          Started by GwFutures1988, Today, 02:48 PM
          0 responses
          3 views
          0 likes
          Last Post GwFutures1988  
          Started by mmenigma, Today, 02:22 PM
          1 response
          3 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by NRITV, Today, 01:15 PM
          2 responses
          9 views
          0 likes
          Last Post NRITV
          by NRITV
           
          Working...
          X