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

I'm getting an 'Chart rendering failed' error while running my strategy.

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

    I'm getting an 'Chart rendering failed' error while running my strategy.

    Hello,

    I made a new strategy and it works fine. But sometimes it get error messages

    Chart rendering failed. There is likely a problem with a chart object's OnRender method. D2D error = 'HRESULT: [0x88990016], Module: [SharpDX.Direct2D1], ApiCode: [D2DERR_PUSH_POP_UNBALANCED/PushPopUnbalanced], Message: The push and pop calls were unbalanced. '

    A direct X error has occurred while rendering the chart: HRESULT: [0x88990016], Module: [SharpDX.Direct2D1], ApiCode: [D2DERR_PUSH_POP_UNBALANCED/PushPopUnbalanced], Message: The push and pop calls were unbalanced. '

    Most of the time the strategy works fine. I looked here in the forum and saw that it is necessary to send you the trace and log files. Can you please give me a ticket number that I can send you this files for further analyses?

    Best Regards
    Andreas
    Attached Files

    #2
    Hello Andreas189,

    Are you able to reproduce this error with the SampleMACrossover included with NinjaTrader in a new empty workspace?

    Does the strategy override OnRender()?

    Does the strategy call drawing object methods?

    Are you using 8.0.26.1? (Help -> About)
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello Chelsea B.,

      thank you for your quick response.
      • I will try the SampleMACrossover in a new workspace.
      • I looked for a string 'OnRender' but no results.
      • Yes, my strategy calls some drawing tools.
      • I'm using the version 8.0.25.0 I will update it first and give you a feedback asap
      Best Regards
      Andreas

      Comment


        #4
        Hello Chelsea B.,

        I updated NinjaTrader to the newst version 8.0.26.1 and I'm getting the errors again. I also tried the SampleMACrossover strategy in a new workspace and it works fine (no errors).

        Sometimes I also get an error 'Unhandled exception: Object reference not set to an instance of an object.'.

        Best Regards
        Andreas

        Comment


          #5
          Hello Andreas,

          If the SampleMACrossover is not able to reproduce, then likely the issue is with improper code in the strategy.

          Object reference is a variable, not set to an instance of an object mean the variable has a null value.
          Hello, I keep running into an error of "Object reference not set to an instance of an object." when I set the entryOrder to Null after it has been cancelled. Below is the block of code that I found in several of the example strategies. protected override void OnOrderUpdate(Order order, double limitPrice,


          What line of code is causing the error?
          Comment out the logic in OnBarUpdate() until the error stops. Uncomment until the error returns. What was uncommented when the error returned?
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Hi ChelseaB,

            it took a while but now I have found the bad code and I didn't expeceted that this cause the error.

            When I uncomment this 3 lines the Rendering error came back:

            ...
            public override string DisplayName
            {
            get { return Instrument + " " + BarsArray[0].BarsPeriod + " Chart.";}
            }​

            ...

            and the call some lines later

            ...
            protected override void OnBarUpdate()
            {
            Print(DisplayName);

            Best Regards
            Andreas​

            Comment


              #7
              Hi ChelseaB,

              if I use this code:

              ...
              public override string DisplayName
              {
              get { return Instrument + " " + BarsPeriod + " Chart.";}
              }​
              ...​

              I didn't get an Rendering error.

              Best Regards
              Andreas

              Comment


                #8
                Hello Andreas,

                The DisplayName is called for the Strategies window and can be called before the strategy is enabled, before the Instrument or BarsPeriod is created.

                Use a condition to ensure the Instrument and BarsPeriod are not null.
                Chelsea B.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by futtrader, 04-21-2024, 01:50 AM
                4 responses
                41 views
                0 likes
                Last Post futtrader  
                Started by Option Whisperer, Today, 09:55 AM
                1 response
                11 views
                0 likes
                Last Post bltdavid  
                Started by port119, Today, 02:43 PM
                0 responses
                1 view
                0 likes
                Last Post port119
                by port119
                 
                Started by Philippe56140, Today, 02:35 PM
                0 responses
                3 views
                0 likes
                Last Post Philippe56140  
                Started by 00nevest, Today, 02:27 PM
                0 responses
                2 views
                0 likes
                Last Post 00nevest  
                Working...
                X