Recent

Author Topic: Tachart & candlestick  (Read 626 times)

BrLazarus

  • Newbie
  • Posts: 2
Tachart & candlestick
« on: November 18, 2024, 11:38:53 am »
I have successfully created a candlestick chart using data from a MySQL database. Now, I would like to refine the chart further. Could you please advise on how to adjust the width of the candles and the spacing between them?

BrLazarus

  • Newbie
  • Posts: 2
Re: Tachart & candlestick
« Reply #1 on: November 18, 2024, 12:37:07 pm »
I have already discovered how to adjust the width of the candles using the

ohlcSeries.TickWidth property.

However, I am still looking for a way to adjust the spacing between the candles.

wp

  • Hero Member
  • *****
  • Posts: 12523
Re: Tachart & candlestick
« Reply #2 on: November 18, 2024, 02:08:41 pm »
You cannot specify the spacing between the candles, only the width of the candles. There are two properties for it: TOpenHighLowCloseSeries.TickWidth and TOpenHighLowCloseSeries.TickWidthStyle = (twsPercent, twsPercentMin). In any case the TickWidth is understood as a percentage of the distance between adjacent x values (*). When the distance between the x values varies the candle width is not constant. But when you select TickWidthStyle = twsPercentMin the percentage refers to the minimum distance between adjacent x values.

See attached project for a demonstration. It also allows to play with the up/down colors.

(*) This statement is not precisely correct: The phrase "tick width" refers to the one-sided ticks of the series in OHLC presentation. Therefore, the candle stick bar width is twice this value, or in other words, Tickwidth is the percentage of the total candle width to the two-sided data point distance between left to right neighbour.
« Last Edit: November 18, 2024, 02:21:37 pm by wp »

wp

  • Hero Member
  • *****
  • Posts: 12523
Re: Tachart & candlestick
« Reply #3 on: November 18, 2024, 02:19:50 pm »
However, I am still looking for a way to adjust the spacing between the candles.
It's hard to express... I think this is correct: TickWidth = 1/2 candle width (because tick width refers to the ticks of the OHLC presentation). Then, when your data points are equidistant, the distance between the bars is 100-2*TickWidth (percent of the direct point-to-point distance).
« Last Edit: November 18, 2024, 02:22:12 pm by wp »

 

TinyPortal © 2005-2018