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 Hwop38, 05-04-2026, 07:02 PM
            0 responses
            150 views
            0 likes
            Last Post Hwop38
            by Hwop38
             
            Started by CaptainJack, 04-24-2026, 11:07 PM
            0 responses
            302 views
            0 likes
            Last Post CaptainJack  
            Started by Mindset, 04-21-2026, 06:46 AM
            0 responses
            243 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by M4ndoo, 04-20-2026, 05:21 PM
            0 responses
            344 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by M4ndoo, 04-19-2026, 05:54 PM
            0 responses
            174 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Working...
            X