Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Changing the bar color of a rendered bar by an indicator

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

    Changing the bar color of a rendered bar by an indicator

    Hi NT,

    I am using the HA8 indicator on the 1min candlestick chart, which plots Heiken Ashi bars using the OnRender() method. How to change the colors of these bars using a different indicator?
    For the past 2 days, I have been trying to change the color of bars according to dynamic conditions.

    I tried using the BarBrushes method but it plots the underlying candlestick candles but not the Heikanashi(I understand why).

    Secondly, I thought of drawing a rectangle on top of it but seems like won't be possible using draw.rectangle() method as it doesn't plot on a single bar. It'd have been perfect so I am wondering if it is possible to override it.

    Lastly, I merged the conditions in the HA8 indicator itself but it isn't working according to my conditions as I believe it doesn't track bar time.

    Can you please help?

    (Shifting to inbuilt HA charts isn't an option for me because of the logic I am using in it.)


    Click image for larger version

Name:	Screenshot 2022-09-08 003953.png
Views:	503
Size:	38.2 KB
ID:	1214728

    This is how the Rendered chart looks.


    Looking forward to hearing from you soon.

    #2
    Hello daastan,

    Thank you for your note.

    Your best bet would be to modify the Heiken Ashi 8 indicator itself, as trying to accomplish this from a separate indicator would be much more difficult. In the HA8 indicator, you could add additional inputs for the colors you want to change dependent on your logic. Then you could assign those brushes to the colors used to draw the bars based on conditions you define in OnBarUpdate.

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

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    633 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    364 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    105 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    567 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    568 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X