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 frslvr, 04-11-2024, 07:26 AM
            8 responses
            111 views
            1 like
            Last Post NinjaTrader_BrandonH  
            Started by stafe, 04-15-2024, 08:34 PM
            10 responses
            44 views
            0 likes
            Last Post stafe
            by stafe
             
            Started by rocketman7, Today, 09:41 AM
            3 responses
            8 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by traderqz, Today, 09:44 AM
            2 responses
            5 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by rocketman7, Today, 02:12 AM
            7 responses
            31 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Working...
            X