|
Transparent OHLC candlesticks |
Posted by Alexander on Aug-15-2017 23:28 |
|
I want to set transparent color for candlestick. I use example and change this line:
`c.addCandleStick(0x00d000, 0xd00030)`
to
`c.addCandleStick(Transparent, 0xd00030)`
But I see vertical line of candle's high-low. How may I solve it?
Example included.
Python 3.5
|
Re: Transparent OHLC candlesticks |
Posted by Peter Kwan on Aug-16-2017 02:09 |
|
Hi Alexander,
In common candlestick charts, a "hollow" candlestick is usually filled using the same color as the background. If you use the transparent color, you will see the grid lines under the candlesticks in addition to the sticks themselves.
(If you look at common candlestick charts, you would not see the grid lines behind the "hollow" candles. It proves "hollows" candles are not really hollow or transparent, but are filled with the same color as the background.)
Regards
Peter Kwan |
Re: Transparent OHLC candlesticks |
Posted by Alexander on Aug-16-2017 02:51 |
|
I want to see grid and indicators behind candle without sticks. How to make it? |
Re: Transparent OHLC candlesticks |
Posted by Peter Kwan on Aug-16-2017 13:25 |
|
Hi Alexander,
May be try the following method. It adds a candlestick without the stick (by setting the line width to 0). Then use additional HLOC layers to add back the two stick segments above and below the candle body.
c.addCandleStick(Transparent, 0xff6666).setLineWidth(0)
range = ArrayMath(openData).sub(closeData).abs().result()
mainChart.addHLOCLayer(highData, ArrayMath(openData).add(closeData).add(range).div(2).result(), [], [], 0x000000)
mainChart.addHLOCLayer(lowData, ArrayMath(openData).add(closeData).sub(range).div(2).result(), [], [], 0x000000)
Hope this can help.
Regards
Peter Kwan |
Re: Transparent OHLC candlesticks |
Posted by Alexander on Aug-17-2017 02:45 |
|
Peter, thank you.
That's what I need. |
|