divyavamsee / core-plot

Automatically exported from code.google.com/p/core-plot
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

CPTTradingRangePlot - Candle Stick , when compare the open and close Value #458

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.using CPTTradingRangePlot
2.run drawCandleStickInContext
3.if ( !isnan(open) && !isnan(close) ) 

What is the expected output? What do you see instead?
In the Candle Chart, the chart should not compare with itself.
The candlestick need to compare with the previous candle's open and close value
For eample:
when we have more than one candlestick in the chart,
we need to compare the current candlestick with the previous candlestick's Open 
and Close Value to justify the candlestick should use IncreaseFill or 
DecreaseFill.

Here is the rule
if( Current Close  > Previous CLOSE)
{
   color = RED;
}
else if( Current Close  <  Previous CLOSE)
{
   color = BLACK;
}
else if ( Current Close  ==  Previous CLOSE)
{
  color= Previous Candle stick color

}

What version of the product are you using? On what operating system?
1.0

Please provide any additional information below.

Original issue reported on code.google.com by nullmi...@gmail.com on 4 Sep 2012 at 2:36

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I took a closer look at this today and I now disagree that this is an issue. 
This is how I understand the algorithm:

A candlestick plot takes four data values: open, close, high, and low. The open 
and close are used to determine whether the candlestick is "increasing" or 
"decreasing". If the close is higher than the open it is "increasing", 
otherwise it is "decreasing". The open value (at least for real stock market 
data) might be equal to the previous close, but it doesn't have to be and often 
is not. An open value exactly equal to the close is a special case—the 
candlestick will just be a single horizontal line.

Core Plot allows you to set the increasing and decreasing fills and border line 
styles so you can use any color scheme desired.

Original comment by eskr...@mac.com on 6 Sep 2012 at 12:29

GoogleCodeExporter commented 9 years ago
We can not using one set of data "open, close, high, and low" to determine the 
candlestick is "increasing" or "decreasing", except the first day of the data( 
Because it has not previous data).

Increasing <--- it is not meaning TODAY's Close  > TODAY's OPEN, it is meaning 
TODAY's CLOSE > PREVIOUS's CLOSE.

But i personally edit the function "drawCandleStickInContext", i think we may 
be need to change as this one -->

-(void)drawCandleStickInContextNEWNEWNEW(CGContextRef)context x:(CGFloat)x 
open:(CGFloat)open close:(CGFloat)close high:(CGFloat)high low:(CGFloat)low 
alignPoints:(BOOL)alignPoints previousx:(CGFloat)previousx  
previousopen:(CGFloat)previousopen previousclose:(CGFloat)previousclose 
previoushigh:(CGFloat)previoushigh previouslow:(CGFloat)previouslow;

<--  Candle Stick should not be showing a Individual Value in each Candlestick. 
Every Candle Stick should be have a relationship with the previous one, like 
the following :

if( Current Close  > Previous CLOSE)
{
   color = RED;
}
else if( Current Close  <  Previous CLOSE)
{
   color = BLACK;
}
else if ( Current Close  ==  Previous CLOSE)
{
  color= Previous Candle stick color

}

Original comment by nullmi...@gmail.com on 6 Sep 2012 at 1:55

GoogleCodeExporter commented 9 years ago
Can you provide a reference for that algorithm? Everything I've found describes 
a candlestick plot the way Core Plot does it now--the day's open and close 
determine the color of the candle.

Original comment by eskr...@mac.com on 6 Sep 2012 at 10:42

GoogleCodeExporter commented 9 years ago
Closing this issue due to lack of information. The current implementation in 
Core Plot follows the normal practice for this type of plot.

Original comment by eskr...@mac.com on 4 Nov 2012 at 7:50