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 NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          62 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          134 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          75 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          45 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          50 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X