ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Financial Chart Candle Stick Bar - questions
Posted by Chuck Van Dien on Jan-22-2025 08:56
Hello Peter,

Your help has always been appreciated… Can you point me to links where I can get VB.Net examples for the following:
1. Set programmatically once per chart, Bar Type as Candle Stick
2. Set programmatically, Candle stick width/thickness of bar, outline color, body color (different color for Bull or Bear Candle), candle shadow thickness and color

VB.Net Code examples would help.

Thank you Peter!

Chuck

  Re: Financial Chart Candle Stick Bar - questions
Posted by Peter Kwan on Jan-22-2025 22:36
Hi Chuck,

1. Set programmatically once per chart, Bar Type as Candle Stick

You can create a candlestick chart by using an XYChart or a FinanceChart. An XYChart example is at:

https://www.advsofteng.com/doc/cdnet.htm#candlestick.htm

The API is XYChart.addCandleStickLayer:

https://www.advsofteng.com/doc/cdnet.htm#XYChart.addCandleStickLayer.htm


If you use a FinanceChart, an example is at:

https://www.advsofteng.com/doc/cdnet.htm#finance2.htm

The API is FinanceChart.addCandleStick

https://www.advsofteng.com/doc/cdnet.htm#FinanceChart.addCandleStick.htm


2. Set programmatically, Candle stick width/thickness of bar, outline color, body color (different color for Bull or Bear Candle), candle shadow thickness and color

When you call addCandleStickLayer, you can specify the bull and bear candle colors and the edge color (the stick/border color).

You can use BaseBoxLayer.setDataWidth to configure the width of the candlestick. For example:

'10 pixel wide
myCandleStickLayer.setDataWidth(10)

You can use Layer.setLineWidth to configure the line width of the stick. For example:

'2 pixel line width
myCandleStickLayer.setLineWidth(2)


Best Regards
Peter Kwan