Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Can an indicator get the color set by the user in the configuration settings?

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

    Can an indicator get the color set by the user in the configuration settings?

    I have an indicator in which I set the color of its second plot to either Red or Green based on its value. This works great, but when the user sets the plot to Transparent, I just step on it anyway.
    Is there a way that I can see what color the user has chosen for a plot? So that I could skip setting the color if the color is set to Transparent?

    I've tried looking at PlotBrushes[1][0] and at Plots[1].Brush in OnBarUpdate but they don't seem to hold that information.

    As a work-around I created a separate Boolean parameter that I can use to skip plotting. The downside is that now everywhere I use this indicator in other indicators and in strategies I have to add this extra true/false value in the instantiation.

    #2
    Hello scenewright,

    The PlotBrushes collection is a user defined brush for the plot, that won't contain any value unless you are setting a custom brush in logic while the script is running.

    You can use Plots[1].Brush but you would need to do .ToString() and look for the hex value of transparent which is #00FFFFFF

    Comment


      #3
      Thanks Jesse. That works great!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CaptainJack, 05-29-2026, 05:09 AM
      0 responses
      513 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 05-29-2026, 12:02 AM
      0 responses
      349 views
      0 likes
      Last Post CaptainJack  
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      271 views
      1 like
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      360 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      328 views
      0 likes
      Last Post CarlTrading  
      Working...
      X