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 Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          581 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          338 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          103 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          554 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          552 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X