I think that you candles are quite confusing, and that you should add a feature. :
The problem is that your candles do not allow to differentiate between an upclose and a downclose. The solution has already been found for black and white candle sticks. The downcloses are filled (black) and the upcloses are hollow (white).
Depending on the the candle color and the background selected, it can be difficult to see a hollow candle on a chart. The solution is to use an opacity for the upcloses which is used to calculate the fill color from the outline color.
For the code you could have a look at the MACDBBLinesV3 indicator. It allows the selection of an opacity for upcloses.
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).
The following 2 users say Thank You to Fat Tails for this post:
(1) First check ChartControl for null. It is null, if your indicator is called from another indicator or strategy. In that case you are not allowed to check for Candlesticks (this would crash the indicator)
(2) Check Chart Control for Candlesticks, if it is not null. If your chart is a candlestick chart, set the boolean candles to true.
For OHLC bars there is nothing to be done, as you can differentiate between upclose and downclose bars without any colors.
(3) In case you have candles, use the candle color for
-> candle outline
-> candle fill color for downcloses
(4) For upcloses use a reduced alpha (somewhere between 0 and 100). As alpha range is 250 and users are used to 10 different values for the opacity, allow user to enter opacity and calculate alpha value from opacity. Use the modified color as fill color for upcandles.
Just an explanation in case that your response was serious. If it was not, somebody else will like the answer.
The following 3 users say Thank You to Fat Tails for this post:
Platform: Abacus, Slide Rule, HP-65, Metastock, TOS, NT
Favorite Futures: Futures
Posts: 3,424 since Aug 2010
Thanks: 1,052 given,
Forum Reputation: Legendary
The reason I had Red color for the upper limits was to indicate a selling opportunity and buying for the green at the bottom. Whatever, one's eye pleases. However, the concept makes visual sense for color divergence.