Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 andrewtrades, Today, 04:57 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by chbruno, Today, 04:10 PM
        0 responses
        6 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Started by josh18955, 03-25-2023, 11:16 AM
        6 responses
        436 views
        0 likes
        Last Post Delerium  
        Started by FAQtrader, Today, 03:35 PM
        0 responses
        9 views
        0 likes
        Last Post FAQtrader  
        Started by rocketman7, Today, 09:41 AM
        5 responses
        20 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X