Page 1 of 1

A problem with candle series

Posted: Tue Mar 06, 2012 6:32 am
by 16558750
Hi,

There is a problem in the attached image. The first data should be charted as a solid T shape, but the resulting vertical line turned out to shift 1 pixel downward that creates a disconnected gap. How can I fix that? thanks. (this one pixel gap gets even worse if I set Border.Visible := False)

Re: A problem with candle series

Posted: Wed Mar 07, 2012 1:09 pm
by narcis
Hi SSWang,

Could you please attach a simple example project we can run "as-is" to reproduce the problem here and let us know the exact TeeChart version you are using?

Thanks in advance.

Re: A problem with candle series

Posted: Thu Mar 08, 2012 6:34 am
by 16558750
NarcĂ­s wrote:Hi SSWang,

Could you please attach a simple example project we can run "as-is" to reproduce the problem here and let us know the exact TeeChart version you are using?

Thanks in advance.
I'm using following version with D2010:
===============================================
Release Notes 17th November 2011
TeeChart VCL version 2011
Build 2011.04.41118
===============================================

Please check the project's first data, thanks.

Re: A problem with candle series

Posted: Fri Mar 09, 2012 5:09 pm
by yeray
Hi,

The Candle series basically draws a line from High to Low values and a rectangle from Open to Close values. It assumes having a High&Low values both greater or smaller than both Open&Close has no sense.
https://en.wikipedia.org/wiki/Candlestick_chart

Re: A problem with candle series

Posted: Mon Mar 12, 2012 3:12 am
by 16558750
Yeray wrote:Hi,

The Candle series basically draws a line from High to Low values and a rectangle from Open to Close values. It assumes having a High&Low values both greater or smaller than both Open&Close has no sense.
https://en.wikipedia.org/wiki/Candlestick_chart
Yes, but what you have mentioned is not the case that I reported. Allow me to explain this by taking the first attached image from top of this thread for example. First, the "Open value"=637 equals to "Close value", which is quite common in stock pricing, makes the rectangle part of OHLC look like a horizontal line. Second, the "High value" is also 637, which indicates that the "Open value" is also the highest among its period. This is again, frequently seen in stock pricing. Now the problem comes: If the top end of vertical line of OHLC, which is "High value", is disconnected to horizontal line and leaving a gap, it tells a story that the Open and Close values are even higher than defined "High value". That makes no sense to OHLC. So the chart must draw a perfect T in this case (and a perfect vertical inverted T for opposit case). Please correct me if there are mistakes, thanks.

Re: A problem with candle series

Posted: Wed Mar 14, 2012 10:01 am
by yeray
Hi SSWang,

You are right. I misunderstood it.

A Candle with the same Open, Close and High values should be drawn as a perfect "T". But right now the is a pixel separating the horizontal and the vertical lines.
A Candle with the same Open, Close and Low values should be drawn as a perfect inverted "T". But right now the is an extra pixel drawn below the horizontal line.

I've added it to the defect list to be fixed asap (TV52016086). I've actually found a possible fix, but it should be studied if it could break something else.
However, feel free to apply the change to the sources if you are a source code customer.
In CandleCh.pas, in the TCandleSeries.DrawValue method, change this:

Code: Select all

           if View3D then
              VertLine3D(tmpX,yLow,yHigh,MiddleZ)
           else
              DoVertLine(tmpX,yLow,yHigh);
For this:

Code: Select all

           if View3D then
              VertLine3D(tmpX,yHigh,yLow,MiddleZ)
           else
              DoVertLine(tmpX,yHigh,yLow);

Re: A problem with candle series

Posted: Thu Jun 07, 2012 9:54 am
by narcis
Hi SSWang,

We decided to implement Yeray's fix suggestion for the next TeeChart VCL maintenance release.