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

    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks Jesse. That works great!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by f.saeidi, Today, 05:56 AM
      2 responses
      8 views
      0 likes
      Last Post NinjaTrader_Erick  
      Started by Pattontje, Yesterday, 02:10 PM
      2 responses
      35 views
      0 likes
      Last Post Pattontje  
      Started by xiinteractive, 04-09-2024, 08:08 AM
      7 responses
      27 views
      0 likes
      Last Post NinjaTrader_Erick  
      Started by Skifree, Today, 03:41 AM
      2 responses
      8 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by trimpy, Today, 04:38 AM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X