Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 elirion, Today, 09:32 PM
            0 responses
            2 views
            0 likes
            Last Post elirion
            by elirion
             
            Started by cre8able, Today, 09:15 PM
            1 response
            5 views
            0 likes
            Last Post bltdavid  
            Started by cummish, Today, 08:43 PM
            0 responses
            12 views
            0 likes
            Last Post cummish
            by cummish
             
            Started by Option Whisperer, Today, 07:58 PM
            4 responses
            21 views
            0 likes
            Last Post Option Whisperer  
            Started by ETFVoyageur, 05-07-2024, 07:05 PM
            13 responses
            87 views
            0 likes
            Last Post ETFVoyageur  
            Working...
            X