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 argusthome, 03-08-2026, 10:06 AM
      0 responses
      109 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      57 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      37 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      39 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      76 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X