Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator name and parameters like NT 7

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

    Indicator name and parameters like NT 7

    I'm upgrading a series of custom indicators I've built for NT 7.

    I'd like to have these indicators to show their names (+parameters) exactly like NT 7.

    Is there a simple way to do that?

    I know you can use DisplayName, but that would imply that I would have to code "DisplayName" for each indicator. Also, I'm very used to the way NT 7 displayed the parameters of my indicators so it makes much easier for me to 'feel' like I'm using the same indicator as in NT 7.

    Another thing I noticed is that any color in the parameters are shown in NT 8 indicator label in the chart as a bunch of Hex numbers. At least I would like to show these as the color itself.

    Thanks!

    #2
    Hello ds1111, and thank you for your questions.

    To your first question, you will notice that the attached indicator has its Name property commented out. When you load this chart you will see that NinjaTrader's built-in reflection has correctly named this indicator after its class name.

    To your second question, the hex numbers decode as follows : 0x89abcdef. That is, the first two numbers (if presence) are the transparency, the next two are red, the next two are green, and the last two are blue. 00 is closer to black, and ff is closer to white. This said I was not quite able to see the same thing on my end as you are seeing on yours. I have attached a thumbnail of an indicator's properties on my screen with colors shown visually, rather than in hex numbers. Could you review the attached picture and let us know what we can do differently to bring up the hex numbers?

    I look forward to assisting further.
    Attached Files
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      Please, see the picture attached.

      NT 7 displays the color. NT 8 displays hex numbers.

      I want NT 8 to display the indicator label exactly like NT 7.

      Thanks.
      Attached Files

      Comment


        #4
        Thank you ds1111 for the explanation. This is a side effect of the fact that NT8 uses Brushes instead of Colors (and System.Media.Color instead of System.Drawing.Color at that).

        Generally, to control how information is displayed in the upper left, you can include a custom serialization / unserialization routine. In this case, you will want a routine that converts a brush to and from a color name. Using two publicly available stack overflow pages (linked in code comments), I have created an indicator which accomplishes this goal, which is attached.

        Code samples we provide are for educational purposes, and are not intended for live trading, and are not guaranteed to accomplish any user goal or to be maintained. It is likely code changes in the future will break this code.

        Note that the keyword NinjaScriptProperty is on the serialized variable.



        Please let us know if there are any other ways we can help.
        Attached Files
        Jessica P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        574 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        332 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        553 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X