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 judysamnt7, 03-13-2023, 09:11 AM
    4 responses
    57 views
    0 likes
    Last Post DynamicTest  
    Started by ScottWalsh, Today, 06:52 PM
    4 responses
    36 views
    0 likes
    Last Post ScottWalsh  
    Started by olisav57, Today, 07:39 PM
    0 responses
    7 views
    0 likes
    Last Post olisav57  
    Started by trilliantrader, Today, 03:01 PM
    2 responses
    19 views
    0 likes
    Last Post helpwanted  
    Started by cre8able, Today, 07:24 PM
    0 responses
    9 views
    0 likes
    Last Post cre8able  
    Working...
    X