Hi Wing,
In your chart, there seems to be a no trading period of 110 seconds. I think it is because the other points very close together. However, if all data points are 2 minutes apart, then the 110 seconds time difference would look normal.
If your chart is plotting trading as it occurs, then there is always "no trading" between any two points. For example, even if two data points are 5 seconds apart, there is still no trading for 5 seconds. If we "skip" the no trading region, we must still leave a space between the two points otherwise the two points will overlap. What should be that space?
In common financial charts (such as the candlestick chart), there is a fixed spacing between two candlesticks, regardless of the time spacing, and non-trading hours are not plotted. For example, if the trading hours of a stock exchange is from 9:00am to 4:00pm, then after 4:00pm, the next candlestick will be 9:00am of the next trading day.
Note that for common financial charts, within "trading hours", we would plot a candlestick even if there is no actual transaction. In this case, the open/high/low/close values of the candlestick will be the same as the closing price of the previous candlestick, and the trading volume will be 0. It is because the price is assumed to always exists even if there is no trading.
If you would like to plot your current chart using the common financial charting style, you can just use integers 0, 1, 2, 3, 4, .... for the x-coordinates.
The actual data/time will be skipped randomly and are not predictable, so they are just treated as "labels" (just like "names"). They are for human reading only and has no meaning to the computer. We can add them back to the chart by using the Axis.addLabel
API.
Regards
Peter Kwan |