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 Atlant, Today, 09:23 AM
      2 responses
      10 views
      0 likes
      Last Post Atlant
      by Atlant
       
      Started by bortz, 11-06-2023, 08:04 AM
      49 responses
      1,769 views
      0 likes
      Last Post NinjaTrader_RyanS  
      Started by Vietanhnguyen2hotmailcom, Today, 10:29 AM
      3 responses
      9 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by milfocs, Yesterday, 07:23 PM
      3 responses
      14 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by kenz987, Today, 10:20 AM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X