Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to Draw Text Only in a Pane

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

    #16
    Two or More Rows of Text in Sub-pane

    I'm developing my indicator and now wish to use DrawText 3 times in an indicator pane. I'm able to get a single DrawText to plot, but when I use two DrawText's (with different Y axis parameters) it still appears to just plot one.

    Is it possible to use DrawText multiple times in indicator pane? btw- the text is all that is present, except for two Add(new Line)'s to force the pane to have some height.

    Comment


      #17
      Originally posted by coolmoss View Post
      I'm developing my indicator and now wish to use DrawText 3 times in an indicator pane. I'm able to get a single DrawText to plot, but when I use two DrawText's (with different Y axis parameters) it still appears to just plot one.

      Is it possible to use DrawText multiple times in indicator pane? btw- the text is all that is present, except for two Add(new Line)'s to force the pane to have some height.
      Depends on the tag of your drawing. Would you care to post the lines that you are using for Drawing?

      Comment


        #18
        Hey Koganam, you're always there to lend a hand

        Here are the lines I'm using to plot:
        Code:
        Plot0.Set(20);
        			if(bari > 0)
        			{
        			DrawText("tag1" + CurrentBar,true, bari.ToString("0.00"), 0, 15, 0, posTextColor, myFont,StringAlignment.Center,textBoxColor,textBoxColor,10);
        			}
        			else if (bari < 0)
        			{
        			DrawText("tag1" + CurrentBar,true, bari.ToString("0.00"), 0, 15, 0, negTextColor, myFont,StringAlignment.Center,textBoxColor,textBoxColor,10);	
        			}
        			
        			if(bariHi > 0)
        			{
        			DrawText("tag1" + CurrentBar,true, bariHi.ToString("0.00"), 0, 12, 0, posTextColor, myFont,StringAlignment.Center,textBoxColor,textBoxColor,10);
        			}
        			else if (bariHi <= 0)
        			{
        			DrawText("tag1" + CurrentBar,true, bariHi.ToString("0.00"), 0, 12, 0, negTextColor, myFont,StringAlignment.Center,textBoxColor,textBoxColor,10);	
        			}
        The first line was just an attempt to force some range in the pane. I've played around with the Y location values to no avail. Any suggestions appreciated.

        Comment


          #19
          Hello coolmoss,

          Thanks for the code snippet.

          Using the same tag name they will overwrite each other. You may want to change the name of the tag for each condition. For example:

          Code:
          if(bari > 0)
          {
          	DrawText("bariText" + CurrentBar,true, bari.ToString("0.00"), 0, 15, 0, posTextColor, myFont,StringAlignment.Center,textBoxColor,textBoxColor,10);
          }
          else if (bari < 0)
          {
          	DrawText("bariText" + CurrentBar,true, bari.ToString("0.00"), 0, 15, 0, negTextColor, myFont,StringAlignment.Center,textBoxColor,textBoxColor,10);	
          }
          			
          if(bariHi > 0)
          {
          	DrawText("barHiText" + CurrentBar,true, bariHi.ToString("0.00"), 0, 12, 0, posTextColor, myFont,StringAlignment.Center,textBoxColor,textBoxColor,10);
          }
          else if (bariHi <= 0)
          {
          	DrawText("barHiText" + CurrentBar,true, bariHi.ToString("0.00"), 0, 12, 0, negTextColor, myFont,StringAlignment.Center,textBoxColor,textBoxColor,10);	
          }
          JCNinjaTrader Customer Service

          Comment


            #20
            Man, am I an idiot or what? Thanks so much JC and Koganam for your help. I don't know why I missed that, LOL.

            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
            549 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X