Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawTestFixed question

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

    DrawTestFixed question

    Hi


    I would need a little help with the method DrawTextFixed.

    Is there a way to have a nice display meaning each line ending at the same pixel...

    Here is what I am trying to display :
    Code:
    result = String.Concat(result, Environment.NewLine, Environment.NewLine, "Position :                    "+position);
                result = String.Concat(result, Environment.NewLine, "Stop Loss :                   "+StopPrice.ToString(FS));
                result = String.Concat(result, Environment.NewLine, "Contract Risk :             "+contractRisk.ToString("c"));
                result = String.Concat(result, Environment.NewLine, "Total Risk :                  "+totalRisk.ToString("c"));
                result = String.Concat(result, Environment.NewLine, "RISK REWARD RATIO :  "+Math.Round(rrRatio,2).ToString());
    
    DrawTextFixed("result", result, TextPosition.TopLeft, Color.Black, f, Color.Black, Color.White,10);
    I have a difficult time getting these lines in line...
    Is there another way than playing with spaces trying to make them fit.

    Thanks

    #2
    Hi blar58,

    There is not available NinjaScript methods for this. Hopefully some community members with experience in C# string formatting can assist here.
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    232 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    149 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    161 views
    1 like
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    243 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    198 views
    0 likes
    Last Post CarlTrading  
    Working...
    X