Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnRender Disables Plotting

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

    OnRender Disables Plotting

    I'm having an issue at present where my OnRender method causes my Plots not to display. I'm not sure if this is an issue with the platform or if I am doing something wrong.

    I've made a basic sample indicator to illustrate the problem. If you add the indicator to the chart, you will see the plots display. Then if you uncomment the OnRender method and rebuild, you will see that the labels drawn by OnRender are shown, but the plots have vanished.

    Am I doing something wrong?
    Attached Files

    #2
    This was a schoolboy error on my part, I needed to add the following to the OnRender method so that other things plot:

    Code:
    base.OnRender(chartControl, chartScale);

    Comment


      #3
      Hello Kevinenergy,

      Thanks for your post.

      With reference to the help guide: https://ninjatrader.com/support/help.../?onrender.htm The tip:
      If you are using standard Plots along with custom rendering from an indicator or strategy, you will need to ensure to call the base.OnRender() method for those plots to display.


      protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
      {
      // call the base.OnRender() to ensure standard Plots work as designed
      base.OnRender(chartControl, chartScale);

      // custom render logic
      }

      Comment


        #4
        Thanks Paul I got it working. I've got a new problem though; my text is behind my plots. Is there a way to control the Z-Order of text drawn from OnRender?

        Comment


          #5
          Hello Kevinenergy,

          Thanks for your reply.

          Yes, I see you figured it out a few minutes before I posted.

          For the Z-order, please see: https://ninjatrader.com/support/help...?setzorder.htm

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          571 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          331 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          549 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          550 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X