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!
Re: How to adjust the width of candlestick in realtime chart?
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:
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.