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 Gerik, Today, 09:40 AM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by RookieTrader, Today, 09:37 AM
            1 response
            10 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by alifarahani, Today, 09:40 AM
            0 responses
            5 views
            0 likes
            Last Post alifarahani  
            Started by KennyK, 05-29-2017, 02:02 AM
            3 responses
            1,285 views
            0 likes
            Last Post NinjaTrader_Clayton  
            Started by AttiM, 02-14-2024, 05:20 PM
            11 responses
            186 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Working...
            X