Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Aligning text vertically

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

    Aligning text vertically

    Is there TextAlignment to align text with bar high & bar low, similar to TextAlignment.Center?

    e.g. TextAlignment.Low, TextAlignment,High

    if not what is the recommended approach?
    Last edited by futurenets; 04-01-2016, 07:33 AM.

    #2
    Hello futurenets,

    Thank you for writing in.

    TextAlignment would not be used to place the text at the high or low of a bar.

    You'll want to use High[0] (to place the text at the high of the current bar), or Low[0] (to place the text at the low of the current bar) for the double y parameter of Draw.Text().
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      ok thanks. This may be my fault but I'm seeing some position variation.

      can I ask which part of the text item is used when y = High or Low?

      Comment


        #4
        Hello futurenets,

        I am not exactly clear about what you are asking.

        Please take a look at the Draw.Text() help guide link: http://ninjatrader.com/support/helpG...?draw_text.htm

        The double y parameter is the y coordinate location where the object will be drawn.

        Example:
        Code:
        Text myText1 = Draw.Text(this, "Text1" + CurrentBar, "High", 0, High[0]);
        Text myText2 = Draw.Text(this, "Text2" + CurrentBar, "Low", 0, Low[0]);
        			
        myText1.Alignment = TextAlignment.Center;
        myText2.Alignment = TextAlignment.Center;
        Please take a look at the attached screenshot to see how the text is rendered on the chart.
        Attached Files
        Zachary G.NinjaTrader Customer Service

        Comment


          #5
          in NT8 the y parameter appears to reference the top of the text (not the middle)?

          so y = Low[0] would be ok but y = High[0] would overlapp with price bar?

          do I have this right?
          Last edited by futurenets; 04-04-2016, 06:11 AM.

          Comment


            #6
            Hello futurenets,

            I am not clear of your question.

            Placing Low[0] as your y value will place the text at the low price of the bar. Placing High[0] as your y value will place the text at the high price of the bar.

            Please take a look at the screenshot I have provided in my previous post.
            Zachary G.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            666 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            377 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            110 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            575 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            580 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X