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

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 techgetgame, Today, 11:42 PM
    0 responses
    5 views
    0 likes
    Last Post techgetgame  
    Started by sephichapdson, Today, 11:36 PM
    0 responses
    1 view
    0 likes
    Last Post sephichapdson  
    Started by bortz, 11-06-2023, 08:04 AM
    47 responses
    1,612 views
    0 likes
    Last Post aligator  
    Started by jaybedreamin, Today, 05:56 PM
    0 responses
    9 views
    0 likes
    Last Post jaybedreamin  
    Started by DJ888, 04-16-2024, 06:09 PM
    6 responses
    19 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Working...
    X