Removing BarColors ?

Spin

Well-known member
Joined
May 22, 2019
Posts
478
Likes
191
Hello fellow-coders,

I have a Study that colors the bars when certain conditions are met.
Sometimes the conditions are no longer met (during the timespan of that bar), and I want to 'uncolor' it.

I tried this:
Java:
series.setPriceBarColor(index, transparant);
and that results in a weird situation:
530

I can't find a fitting method in the API.
Has anyone succeeded at doing so ?

As always: grateful for all input :)
 

igor.s

Well-known member
Joined
May 22, 2019
Posts
286
Likes
152
In my study I'm using a simple solution. I store the default bar color then reuse it when a painted bar is no longer need it. Basically, I repaint a specific bar with the default color.

Color defaultColor = series.getPriceBarColor(index);
......
series.setPriceBarColor(index, defaultColor);
......

Cheers,
Igor
 

Spin

Well-known member
Joined
May 22, 2019
Posts
478
Likes
191
Well, sometimes one can no longer see the forest, because all the trees are blocking the view :rolleyes:

Not the first time you come up with a simple, but efficient answer, @igor.s. As always, your help is greatly appreciated (y)(y)
 
Top