Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Get BackBrushes Value

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

    Get BackBrushes Value

    Hello guys,

    I have an indicator that changes the BackBrush color depending on conditions. I want to know if I can extract the backbrush color on a historical bar or current bar using the BackBrushes method. So far I have not been able to do that, I want to get on a string the color on the background of the bar.

    Im using this code, but nothing is printed:

    Print("CurrentBar: " + CurrentBar + " Color: " + BackBrushes[0]);

    Please help!

    #2
    Hello facuevasm,

    In general using the brush for logic would not be suggested, this would be a situation where a Series could be used to store what value is on each bar. That would be a better approach and could also be use as a signal if the series is read from another script.

    If you specifically wanted a color name you could make a Series<string> and when you set the BackBrush to a color you would set the series to the color name. Later if you needed to know the color of a certain bar you would have the series ready to use.

    Comment


      #3
      Thank you Jesse. But in this case, another strategy is setting the BackBrush color. And I want to be able to read which color the strategy set on each bar.

      Let me know how I could achieve this.

      Comment


        #4
        Hello facuevasm,

        The BackBrush series would only be visible to the script setting it, if you need the two strategies to communicate you would need to make a single strategy that does all of the tasks.

        Comment


          #5
          Got it. Thank you for your help Jesse.

          :=)

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          58 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 05-10-2026, 08:12 PM
          0 responses
          34 views
          0 likes
          Last Post CarlTrading  
          Started by Hwop38, 05-04-2026, 07:02 PM
          0 responses
          195 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Started by CaptainJack, 04-24-2026, 11:07 PM
          0 responses
          360 views
          0 likes
          Last Post CaptainJack  
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          281 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X