Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

FontFamily Parameter

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

    FontFamily Parameter

    I know how to create SimpleFont parameter which allows the user to specify the size/family and color of the font etc....

    But is it possible to only allow the user to select the Font Family and NOT size/color/bold/italic? I don't want the user to be able to specify the size or color because I'm declaring size and color variations of that elsewhere in the indicator. But I want the user to be able to select the global font family used.

    #2
    Hello several,

    You would need to make an enum for that purpose and then depending on the enum value construct the font.

    Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.

    Comment


      #3
      I've created enums before but how would I get the list of fonts available?

      Comment


        #4
        Hello several,

        You would make a list of item your have coded logic for, you won't have the full list of fonts. You would make for example 3 options the user can choose from and then select one of those 3 in your code based on the users input.

        Comment


          #5
          ok, I understand thanks. Do you know which font Ninjatrader uses by default? I thought it was Montserrat but this isn't a default windows font I don't think.

          Comment


            #6
            Hello several,

            The default is listed on the simplefont page:

            Creates a SimpleFont object using a family name of "Arial" and a size of "12"

            Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            547 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            323 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            99 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            543 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            545 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X