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

Right Justify

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

    Right Justify

    Gents
    This is a pretty simple question but I can't find the answer

    I have this code:
    DrawTextFixed("TL",""
    +" Session Open" +open.ToString("F2").PadLeft(15) +"\n"
    +" Session High" +hi.ToString("F2").PadLeft(16) +"\n"
    +" Session Low" +lo.ToString("F2").PadLeft(17) +"\n"
    ,TextPosition.TopLeft);

    .PadLeft leaves the charachters just slightly mis-aligned, maybe due to the font particulars of the font (?)

    I would like to right justify the output - within whatever context DrawTextFixed uses to determine the right edge of the output.



    Is there a way to do this?
    Thanks


    #2
    Unfortunately when using DrawTextFixed() your method is going to be the best way I'm aware of for aligning the Text.

    If you wanted to display text aligned in a different manor you would have to override Plot()

    An example of getting started with this would be the system standard Pivots indicator. However we won't be able to provide support if going the route.
    LanceNinjaTrader Customer Service

    Comment


      #3
      Okey Dokey
      Thanks
      (never hurts to ask!)

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by ZenCortexCLICK, Today, 04:58 AM
      0 responses
      5 views
      0 likes
      Last Post ZenCortexCLICK  
      Started by sidlercom80, 10-28-2023, 08:49 AM
      172 responses
      2,280 views
      0 likes
      Last Post sidlercom80  
      Started by Irukandji, Yesterday, 02:53 AM
      2 responses
      17 views
      0 likes
      Last Post Irukandji  
      Started by adeelshahzad, Today, 03:54 AM
      0 responses
      7 views
      0 likes
      Last Post adeelshahzad  
      Started by Barry Milan, Yesterday, 10:35 PM
      3 responses
      13 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Working...
      X