Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

use OnRender on an indicator's panel

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

    use OnRender on an indicator's panel

    This question has been probably asked but it is difficult to find the right answer. The question is, how do I use OnRender on an indicator's panel.
    As an example, I have a modified MACD and I can use DrawText to draw the Hi and Low values on the zero line of the bar. But I want to use OnRender instead of DrawText.
    I don't need instructions on how to use OnRender, just on how to send output to MACD's panel.
    Thanks in advance.

    #2
    Hi !

    You have this little thread with some answer. You should use the correct chartpanel. It seems the answer is in the samplecustomplot indicator. Take a llok at it.

    https://ninjatrader.com/support/foru...-draw-in-panel

    Regards

    Comment


      #3
      hbolorin
      Thanks for your reply. SampleCustomPlot is mention in the link, it sends me to NT8 help guide, but I don't see link to the sample script itself.

      Comment


        #4
        You have to open de samplecustomplot in the ninjasctipr editor. It is in the INDICATOR folder.


        Comment


          #5
          Hello satoyama,

          Thanks for your post.

          When you modify your MACD with OnRender() coding, it will use the panel that the MACD is assigned to when the indicator is loaded.

          Paul H.NinjaTrader Customer Service

          Comment


            #6
            Paul H.
            Thanks for your reply. I got it working; the problem was, since I want y-axis to be below 0 line if macd > 0 (and vice versa), I was assigning 0 directly to y-axis instead of GetYByValue(0). It works perfectly (if macd > 0) as it adjusts automatically as I scroll forwards or back; the same for charts with shorter or longer time frame.

            The problem now is when macd < 0, the text should be drawn just above the 0 line. I need a y-axis that behaves like GetYByValue(0) but above the 0 line. Assigning a constant value like GetYByValue(1.618) does not produce the same effect as GetYByValue(0), as the text moves out of proportion when scrolling through the chart.

            Comment


              #7
              Paul H.
              Done. This did it:
              y = GetYByValue(0) - 17.618f;

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Grantx, 01-25-2017, 07:15 AM
              4 responses
              880 views
              0 likes
              Last Post Adfra
              by Adfra
               
              Started by mv075sn, Today, 03:42 PM
              2 responses
              15 views
              0 likes
              Last Post mv075sn
              by mv075sn
               
              Started by vantojo, Today, 03:06 PM
              4 responses
              14 views
              0 likes
              Last Post vantojo
              by vantojo
               
              Started by Amore44, Today, 01:34 PM
              1 response
              11 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by Anthony_0709, Today, 01:48 PM
              1 response
              18 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Working...
              X