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

Message ListMessage List     Post MessagePost Message

  How to adjust the width of candlestick in realtime chart?
Posted by Isabel on May-24-2019 03:58
Attachments:
For the example 'Realtime Chart with Zoom/Scroll and Track Line", I modified it so a single candlestick could move up and down every second with the data provided and it could draw a new candlestick every minute.

But the issue is that the width of each candlestick is too thin. Is it possible to increase the width of the candlestick or I have to change the scale of x-axis? If so, how am I supposed to change it?

Thanks in advance!
question.png

  Re: How to adjust the width of candlestick in realtime chart?
Posted by Peter Kwan on May-24-2019 12:31
Hi Isabel,

The issue is mainly due to the x-coordinate system. In a standard financial chart, the x-coordinate is usually considered to be the trading session number, which is just 0, 1, 2, 3 ..... The date/time labels are only for human reading (they are treated as "names").

It is because in a financial chart, the date/time labels can skip "randomly". For example, in a daily chart, it only includes trading days. It excludes national holidays and days due to natural phenomena such as hurricane or typhoon. On the other hand, the candlesticks are always equally spaced. So the candlesticks are actually positioned by the trading session number (the array index in programming), but not the date/time.

The date/time can also skip in a per minute chart. If the chart spans two days, the non-trading hours can be skipped. In some stock exchanges, there are lunch hours, and that period can be skipped too.

There is some brief description on how to zoom/scroll a financial chart:

https://www.chartdir.com/forum/download_thread.php?bn=chartdir_support&pattern=FinanceChart+zoom+scroll&thread=1467686966#N1467721784

Are you using C++ on Qt or MFC? I can provide a short example to you.

Regards
Peter Kwan

  Re: How to adjust the width of candlestick in realtime chart?
Posted by Isabel on Jun-12-2019 00:45
Hi Peter,


Thank you so much for your answer. I was using c++ on Qt and I have solved the issue by adjusting the x-axis. I modified the parameters passed to function 'setDateScale' and I could control the visible candlesticks on chart after that.


Thanks,
Isabel