• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Vertical Text Aligned to Top of Chart

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

    Vertical Text Aligned to Top of Chart

    Hi,
    I'm using NT8 B5 and have three quick questions:

    a) how do I draw text vertically instead of horizontally?

    b) how do I align text so that it aligns to the top of the screen of a chart?

    c) when adding indicators in a strategy using AddChartIndicator, how do I set the display text for the indicator to blank so it doesn't display the indicator text at the top of the chart?

    #2
    Hello GrumpyTrader,

    Thank you for your inquiry.

    To answer your questions:
    • A. You could use "\r\n" in between each word so each word will be printed up to down rather than left to right.

      Example:
      Code:
      TextFixed myTF = Draw.TextFixed(this, "tag1", "Text\r\nto\r\ndraw", TextPosition.Center);
      This would show up on the chart as:
      Code:
      Text
      to
      draw
      More information about \r\n can be found here: http://www.dotnetperls.com/newline

    • B. You'll want to use Draw.TextFixed to draw text at a fixed point on the chart. You can then use TextPosition.TopLeft or TextPosition.TopRight to align text to the top left or right of the chart. If you'd like it at the top center, you can use TextPosition.Center and specify a positive YPixelOffset to move it up to where you'd like it.

      Example:
      Code:
      TextFixed myTF = Draw.TextFixed(this, "tag1", "Text to draw", TextPosition.Center);
      myTF.YPixelOffset = 300;
      For more information about Draw.TextFixed, please take a look at the NinjaTrader help guide at this link: http://ninjatrader.com/support/helpG..._textfixed.htm

    • C. You can do this by accessing the index of the chart indicator you have added through AddChartIndicator and use ChartIndicators[idx].Name = ""; to remove the name completely.

      Sample:
      Code:
      else if (State == State.Configure)
      {
           AddChartIndicator(SMA(50));
           ChartIndicators[0].Name = "";
      }
      For more information about the ChartIndicators collection, please take a look at the NinjaTrader 8 help guide at this link: http://ninjatrader.com/support/helpG...indicators.htm


    Please, let us know if we may be of further assistance.
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      Hi Who I do this on NT7, i just like my test be on Left side??

      Comment


        #4
        Hello marcos_vitorino,

        Thank you for writing in.

        Unfortunately, the ITextFixed object in NT7 does not have a YPixelOffset property as NT8's TextFixed object does.

        You would only be able to DrawTextFixed() either at the bottom left or the top left: https://ninjatrader.com/support/help...wtextfixed.htm

        Please, let us know if we may be of further assistance.
        Zachary G.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Johnny Santiago, Today, 12:20 PM
        0 responses
        4 views
        0 likes
        Last Post Johnny Santiago  
        Started by NinjaTrader_Brandon, Today, 10:24 AM
        0 responses
        30 views
        0 likes
        Last Post NinjaTrader_Brandon  
        Started by ptertich, Today, 07:56 AM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Started by aslane, Today, 08:24 AM
        1 response
        14 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Started by Capablanca, Yesterday, 05:51 PM
        1 response
        13 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Working...
        X