Page 1 of 1

Gaps in data using Candle chart

Posted: Tue Jul 08, 2008 8:15 pm
by 14049416
We are using TeeChart for .NET v3.

We have a Candle chart and we are loading various increments of data (1, 5, 15 minute, etc.) candle data into a DataTable and binding it to the chart’s DataSource property. Since the markets close for the weekends there will be gaps in time. The issue we are having is this leaves huge gap in the chart where the missing data would have been.

Is there way to eliminate these gaps in time? What we want is to have the last data point of the week followed by the first data point when the markets open.

Thanks,
Kevin Gordon

Posted: Wed Jul 09, 2008 7:26 am
by narcis
Hi Kevin,

There's an example of that at Al Features\Welcome !\Chart styles\Financial\Candle (OHLC)\Axis Labels no Weekends in the features demo, available at TeeChart's program group.

Posted: Wed Jul 09, 2008 12:26 pm
by 14049416
Hi Narcís,

In the features demo I am looking at there is no
Al Features\Welcome !\Chart styles\Financial\Candle (OHLC)\Axis Labels no Weekends. There is an example candle chart at Welcome !\Chart styles\Financial\Candle (OHLC) and it states in the description above the chart "Weekend data can be removed using a sequential index for the X value." but it gives no example of doing this.

So are you saying instead of using a DateTime format for the X values to use an integer instead and handle the date presentation through the GetAxisDrawLabel event?

Do you have any real examples of doing this?

Thanks,
Kevin

Posted: Wed Jul 09, 2008 1:06 pm
by narcis
Hi Kevin,

It's strange, which TeeChart version are you using? This example has been in the demo for quite a long time. Anyway, the demo is Candle_AxisLabels.cs at "C:\Program Files\Steema Software\TeeChart for .NET v3\Examples\DemoProject\Series". I'm also going to send you the example.

Posted: Wed Jul 09, 2008 1:13 pm
by 14049416
:oops: Okay, I'm an idiot. I did find it. Sorry, yesterday was a long day for me... Thanks.

Posted: Wed Jul 09, 2008 1:21 pm
by narcis
Hi Kevin,

No problem :). If everything was that easy ... ! :wink:

Posted: Wed Jul 09, 2008 1:21 pm
by 14049416
Narcís,

Okay, I have looked at the code. In this example you guys are using the Add method to add the candle points. In our case we are binding the chart to a DataSource? So it looks like the we cannot have the XValues as a DateTime. We would have to have an integer column in the data table and work with the labeling manually.

Does that sound right?

Thanks,
Kevin

Posted: Thu Jul 10, 2008 2:08 pm
by 14049416
Narcís,

Am I correct in my last post or am I still missing somethings?

Thanks,
Kevin

Posted: Thu Jul 10, 2008 2:28 pm
by narcis
Hi Kevin,

Another option would be that you converted your values to DateTime usinge DateTime.FromOADate method.

Posted: Thu Jul 10, 2008 2:47 pm
by 14049416
Hi Narcís,

I tried using a double and DateTime.FromOADate but it still will leave gaps because of the break in time. It seems having a counter or in my case an identity column in my table is the only choice to avoid the gaps.

Might I recommend as an enhancement for a future release is that you provide a property that, if set, would allow the X-Axis to skip any missing dates and pickup on the next concurrent date? It appears to be somewhat common for the markets to close on weekends and is very confusing to the user to see large gaps, mostly noticeable when viewing candles with small increments such as 1, 5, and 15 minute charts.

Kevin

Posted: Fri Jul 11, 2008 9:47 am
by narcis
Hi Kevin,

This is already on the wish-list to be considered for inclusion in future releases.

In the meantime the only solution is manually looping your dataset and applying the same as in the demo.