Candle stick bars overlap

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Dierk Droth
Newbie
Newbie
Posts: 5
Joined: Fri Nov 05, 2004 5:00 am
Contact:

Candle stick bars overlap

Post by Dierk Droth » Fri Nov 05, 2004 10:35 am

Hi,

Just making my first steps with TeeCharts...

Here is my first problem:
My app will have a chart display for stocks, commodities ... So far I have not been able to manage that the displayed bars on a candle stick chart do NOT overlap. I would prefer having something like a min spacing - in pixels or so - between the bars.

Can someone please point me to the right direction.

Thanks

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Mon Nov 08, 2004 8:44 am

Hi.
a candle stick chart do NOT overlap. I would prefer
What's the total number of points you're trying to display on chart ? If it's more than 40-50, then I think the best approach is to use the chart paging and display data on severar chart pages. There are couple of examples of this feature available in TeeChart NET demo. The following examples displays 500 points with 50 points per chart page. You can easily navigate through all pages by using the Page Current, Next and Previous methods:

Code: Select all

tChart1.Page.MaxPointsPerPage = 50;
tChart1.Page.Current = 1; // move to 1st page
// alternatively, you can also use Page.Next and Page.Previous
// methods for navigation
Marjan Slatinek,
http://www.steema.com

Dierk Droth
Newbie
Newbie
Posts: 5
Joined: Fri Nov 05, 2004 5:00 am
Contact:

Post by Dierk Droth » Tue Nov 09, 2004 8:54 am

Hi,

Thanks for that hint. I'll give it a try. :-)

Regards

fnn
Newbie
Newbie
Posts: 5
Joined: Tue Mar 23, 2004 5:00 am

calc Candle.candlewidth for not overlapping

Post by fnn » Thu Nov 23, 2006 7:50 am

I tried to do below code onbeforedrawchart event:

Numpixels:=abs(scandle.CalcXPos(scandle.LastValueIndex)-scandle.CalcXPos(scandle.FirstValueIndex))+2;
PixelPerbar:=math.Max(1,trunc(Numpixels/NumBars+1)-Scandle.pen.width-2);
if pixelperbar>=20 then
Begin
scandle.CandleWidth:=20;
ENd
else
Scandle.CandleWidth:=trunc(pixelperbar);

in this example, candle does not overlap, but scandle.CandleWidth should be bigger as possible.

Just compare your chart with a stock charts software (i.e Metastock).

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Nov 23, 2006 11:44 am

Hi fnn,

I don't understand what's your point here. However you may be interested in checking a couple features:

1. Candle style, you'll find an example at All Features\Welcome !\Chart styles\Financial\Candle (OHLC)\Candle Custom colors.
2. OHLC compression function, there's an example at All Features\Welcome !\Functions\Financial\Compression OHLC in the features demo.

The features demo can be found at the program group created by TeeChart's installer.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply