Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Drawing in Indicator panel

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

    Drawing in Indicator panel

    Hi

    I am stumped as to how to get an indicator to draw not on the price panel but in its own panel. The code is just a simple narrow range indicator but I want it to print "NR4" in a separate price panel not on the main panel.

    This is the code,

    PHP Code:
    {      
                if (CurrentBar < 4) return;
                
                range1 = Math.Abs(High[0]-Low[0]);
                range2 = Math.Abs(High[1]-Low[1]);
                range3 = Math.Abs(High[2]-Low[2]);
                range4 = Math.Abs(High[3]-Low[3]);
                        
                if( range1 < range2    && range1 < range3    && range1 < range4)    
                    
                {
                    DrawText("NR4"+CurrentBar,"NR4",0, Low[0] - 100, Color.BlueViolet);
                    
                }      
                } 
    
    How do I get it to draw in its own panel?

    And also if you have a value such as in the above example of range1 , range2 etc how do you use the DrawText method to also draw the value on the chart?

    #2
    Originally posted by Tremblinghandtrader View Post
    How do I get it to draw in its own panel?
    I use the following code snippet, but I don't know if that is "the correct" way. Perhaps you find it useful though:

    PHP Code:
    protected override void Initialize()
    {
    DrawOnPricePanel = false; // don't draw in the price panel
    } 
    
    Regards,

    Comment


      #3
      Yep that was it. I did try that but didn't change the the Y plot values so they showed in the price panel!

      Thanks.

      Just need to figure out how to plot values as text now.

      Comment


        #4
        Ah good that it helped.
        Originally posted by Tremblinghandtrader View Post
        Just need to figure out how to plot values as text now.
        Perhaps you could use Convert.ToString() ?

        For example:
        PHP Code:
        DrawText("NR4"+CurrentBar, Convert.ToString(range1), 0, Low[0] - 100, Color.BlueViolet); 
        


        Regards,

        Comment


          #5
          Originally posted by J_o_s View Post
          Perhaps you could use Convert.ToString() ?


          Thats it. Thanks heaps.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Hwop38, 05-04-2026, 07:02 PM
          0 responses
          164 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Started by CaptainJack, 04-24-2026, 11:07 PM
          0 responses
          318 views
          0 likes
          Last Post CaptainJack  
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          246 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          350 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          179 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Working...
          X