Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to off set text instead of just top right top left etc

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

    How to off set text instead of just top right top left etc

    Can someone help me I want to offset some text so two indicators can both display in the left corner.

    Would any one be able top help alter this code to make it so I can or advise how.

    NinjaTrader.Gui.Tools.SimpleFont myFont = new NinjaTrader.Gui.Tools.SimpleFont("Courier New", 12) { Size = 20, Bold = true };
    Draw.TextFixed(this, "tag", String.Format("{0:0.##}",volatility), TextPosition.TopLeft, Brushes.Green, myFont, Brushes.Transparent, Brushes.Transparent, 100);

    thanks in advance bread​

    #2
    Hello Mr Bread,

    The TextFixed tool does not allow for offsetting. If you need to make multiple lines you can do that by using \n in the string to start a new line. To offset text would require creating a new tool which has a property for that.

    Comment


      #3
      Using Draw.TextFixed, you can just add carriage returns "\n" to lower the text from the top or up from the bottom. Make sure your text box background and outline colors are Transparent.
      eDanny
      NinjaTrader Ecosystem Vendor - Integrity Traders

      Comment


        #4
        Thanks for the reply.

        So from what I understand \n would be placed prior to the "text position "

        Is this correct or is it placed at the start of the string.

        Also how would i drop it by multiple lines of i wanted

        Thanks Bread.

        Comment


          #5
          Hello Mr Bread

          You would put that in your string "My text line one\nMy text line 2"

          That would drop it multiple lines. there is not a way to offset it horizontally besides using spaces.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          547 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          323 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          99 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          543 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          545 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X