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 rhyminkevin, Today, 04:58 PM
      4 responses
      52 views
      0 likes
      Last Post dp8282
      by dp8282
       
      Started by iceman2018, Today, 05:07 PM
      0 responses
      5 views
      0 likes
      Last Post iceman2018  
      Started by lightsun47, Today, 03:51 PM
      0 responses
      7 views
      0 likes
      Last Post lightsun47  
      Started by 00nevest, Today, 02:27 PM
      1 response
      14 views
      0 likes
      Last Post 00nevest  
      Started by futtrader, 04-21-2024, 01:50 AM
      4 responses
      50 views
      0 likes
      Last Post futtrader  
      Working...
      X