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

Message ListMessage List     Post MessagePost Message

  discontinuous datetime in real time chart
Posted by Wing on Jan-05-2017 11:32
Attachments:
Hi,

I draw the stock market data with chartdirector realtime chart. But there is a problem is that in some peroids of time such as 11:19:00-11:20:00 there is no trading, also no market data coming. But the xAxis is continuous from 00:00:00 to 23:59:59.  The chart will be drawed as below.

Is there any solution to make the xAxis skip the period of time in which there is no trading? So I can make the curve looks continuous.

Thank you.
qustion.png

  Re: discontinuous datetime in real time chart
Posted by Peter Kwan on Jan-06-2017 02:55
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

  Re: discontinuous datetime in real time chart
Posted by wing on Jan-07-2017 10:02
Thank you very much!

I'm trying to use Axis.addLabel API to solve my problem.