Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Background color (backBrush) on building bar

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

    Background color (backBrush) on building bar

    Hi Guys - A long time since my last post.

    I have a quick question. Can the background color (backBrush) be altered on a building bar on a tick by tick basis ?

    Thanks
    Jerry

    #2
    Hello Jerry,

    Thank you for your note.

    Yes, the background color for a bar could be altered on a tick-by-tick basis as long as the script is set to Calculate.OnEachTick. Here is a snippet that would set the BackBrush to green when the volume is an even number and red when the volume is an odd number:
    Code:
                if (Volume[0] % 2 == 0)
                    BackBrush = Brushes.Green;
                else if (Volume[0] % 2 != 0)
                    BackBrush = Brushes.Red;
                else
                    BackBrush = null;​
    If you add this to OnBarUpdate() in an indicator that is calculated on each tick, you will see the BackBrush change between red and green as the bar is building.

    Please let us know if we may be of further assistance.

    Comment


      #3
      Emily
      Thanks - Saved me a bunch of time.
      Jerry

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      597 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      343 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      556 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      555 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X