Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How do I get the color of an indicator programatically

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

    How do I get the color of an indicator programatically

    basically what I want to do is to get the color of an indicator (single plot) and set its text to that same color.

    so that if I have WMA(20) and EMA(30) i can easily tell which is which by their colors of the text

    #2
    Hello Mike82,

    Thank you for your post.

    You may be able to achieve what you want with custom programming, and the following reference sample helps with some of the label formatting available. The DrawTextFixed() method provides an overload that allows font colors.

    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      is there a way to remove the text that lists the indicators used from the chart?

      Comment


        #4
        Mike82,

        You have to remove this manually by Right Clicking > Indicators > and then clearing out the label field for selected indicator.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by mike82 View Post
          basically what I want to do is to get the color of an indicator (single plot) and set its text to that same color.

          so that if I have WMA(20) and EMA(30) i can easily tell which is which by their colors of the text
          To retrieve a Plot's color, try:
          Plots[#].Pen.Color

          Where # = the number of the Plot (starting at 0) that you Add in Initialize.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CaptainJack, 05-29-2026, 05:09 AM
          0 responses
          173 views
          0 likes
          Last Post CaptainJack  
          Started by CaptainJack, 05-29-2026, 12:02 AM
          0 responses
          91 views
          0 likes
          Last Post CaptainJack  
          Started by charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          130 views
          0 likes
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          209 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          186 views
          0 likes
          Last Post CarlTrading  
          Working...
          X