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

Change the text size in a strategy

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

    Change the text size in a strategy

    How can I change the size of a text in a strategy?

    DrawText("Punkt3" + CurrentBar , "3" , Swing(stärke).SwingLowBar (0,1,20), Low[Swing(stärke).SwingLowBar (0,1,20)]- TickSize * abstand , Color.Black);

    Thank you

    #2
    Hello Ironman9973, and thank you for your question.

    There is a reference sample that goes over exactly what you're looking for. Please see the 'changing fonts for draw objects' page for further information. I am providing an example.

    Code:
    [FONT=Courier New] int stärke = 14, abstand = 2;
    [B]Font helveticaFont = new Font("Helvetica", 14);[/B]
    bool autoscale = false;
    int yPixelOffset = 0;
    int opacity = 0;
    DrawText("Punkt3" + CurrentBar , autoscale, "3" , Swing(stärke).SwingLowBar (0,1,20), Low[Swing(stärke).SwingLowBar (0,1,20)]- TickSize * abstand , yPixelOffset, Color.Black, [B]helveticaFont[/B], StringAlignment.Center, Color.Black, Color.White, opacity);
    [/FONT]
    I am including a link to the Help Guide page for DrawText and a publicly available MSDN link for Font.


    Defines a particular format for text, including font face, size, and style attributes. This class cannot be inherited.


    Please let us know if there is any other way we can help.
    Jessica P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Belfortbucks, Today, 09:29 PM
    0 responses
    6 views
    0 likes
    Last Post Belfortbucks  
    Started by zstheorist, Today, 07:52 PM
    0 responses
    7 views
    0 likes
    Last Post zstheorist  
    Started by pmachiraju, 11-01-2023, 04:46 AM
    8 responses
    151 views
    0 likes
    Last Post rehmans
    by rehmans
     
    Started by mattbsea, Today, 05:44 PM
    0 responses
    6 views
    0 likes
    Last Post mattbsea  
    Started by RideMe, 04-07-2024, 04:54 PM
    6 responses
    33 views
    0 likes
    Last Post RideMe
    by RideMe
     
    Working...
    X