Greetings,
Is there a way to make a Candle Stick HighLowPen.Color the same as the Stick color.
example ...
You can see that the HigLowPen's color is the same as the rest of the candle.
I looked at this example "Welcome !\Chart styles\Financial\Candle (OHLC)\Candle HighLow pen" but it only covers changing ALL the HigLowPen's to one color.
Failing that .. I guess I'll have to color each HigLowPen individually .. any suggestions on where is the best place to do this ... or do I need to do a separate iteration through the Candle series once its drawn ...
Cheers Phil.
Candle HighLowPen coloring.
Candle HighLowPen coloring.
--------------------
Cheers Phil.
Cheers Phil.
Re: Candle HighLowPen coloring.
Hi Phil,
You could use GetPointerStyle event to change the series Pen.Color before drawing each point:
You could use GetPointerStyle event to change the series Pen.Color before drawing each point:
Code: Select all
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
Steema.TeeChart.Styles.Candle Candle1 = new Steema.TeeChart.Styles.Candle(tChart1.Chart);
Candle1.FillSampleValues(10);
Candle1.CandleWidth = 15;
Candle1.UpCloseColor = Color.Green;
Candle1.GetPointerStyle += new Steema.TeeChart.Styles.CustomPoint.GetPointerStyleEventHandler(series1_GetPointerStyle);
}
void series1_GetPointerStyle(Steema.TeeChart.Styles.CustomPoint series, Steema.TeeChart.Styles.GetPointerStyleEventArgs e)
{
series.Pointer.Pen.Color = e.Color;
}
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Candle HighLowPen coloring.
Greetings .. back again ... did you miss me? no ?? oh well
On the topic of Coloring candles ... with your kind support I have them looking pretty much as I want them .. And happily whatever color the candle is, so is the PointerStyle color ... perfect ...
However ... the candle coloring happens thanks to the
Now when the close price == the open price we like to color our candles grey ... is there a way to color random candles ?
I tried this but just got multicolored Candles ... very pretty .. not so usable
On the topic of Coloring candles ... with your kind support I have them looking pretty much as I want them .. And happily whatever color the candle is, so is the PointerStyle color ... perfect ...
However ... the candle coloring happens thanks to the
Code: Select all
myCandle.Style = CandleStyles.CandleStick;
myCandle.UpCloseColor = Color.Green;
myCandle.DownCloseColor = Color.Red;
I tried this but just got multicolored Candles ... very pretty .. not so usable
Code: Select all
for (int index = 0; index < dataList.Count; index++)
{
double open = Convert.ToDouble(dataList[index].Open);
double high = Convert.ToDouble(dataList[index].High);
double low = Convert.ToDouble(dataList[index].Low);
double close = Convert.ToDouble(dataList[index].Close);
DateTime idate = dataList[index].Date;
// Labels for the X axis.
labels.Add(idate.ToShortDateString());
/// Color the pointers for the Candles
Color pointerColor;
if (open > close) pointerColor = Color.Red;
else if (close > open) pointerColor = Color.Green;
else pointerColor = Color.DarkGray;
myCandle.Colors[index] = pointerColor;
// Add the data to the Series.
myCandle.Add(index, open, high, low, close);
}
--------------------
Cheers Phil.
Cheers Phil.
Re: Candle HighLowPen coloring.
Hi Phil,
If I understood well, you should use again the GetPointer event:
If I understood well, you should use again the GetPointer event:
Code: Select all
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
Steema.TeeChart.Styles.Candle Candle1 = new Steema.TeeChart.Styles.Candle(tChart1.Chart);
Candle1.CandleWidth = 15;
Candle1.Style = Steema.TeeChart.Styles.CandleStyles.CandleStick;
Candle1.UpCloseColor = Color.Green;
Candle1.DownCloseColor = Color.Red;
//testing values
Candle1.FillSampleValues(10);
Candle1.CloseValues[2] = Candle1.OpenValues[2];
Candle1.GetPointerStyle += new Steema.TeeChart.Styles.CustomPoint.GetPointerStyleEventHandler(series1_GetPointerStyle);
}
void series1_GetPointerStyle(Steema.TeeChart.Styles.CustomPoint series, Steema.TeeChart.Styles.GetPointerStyleEventArgs e)
{
if (series is Steema.TeeChart.Styles.Candle)
{
Steema.TeeChart.Styles.Candle candle = series as Steema.TeeChart.Styles.Candle;
if (candle.CloseValues[e.ValueIndex] == candle.OpenValues[e.ValueIndex])
e.Color = Color.Gray;
}
series.Pointer.Pen.Color = e.Color;
}
Snarkle wrote:Greetings .. back again ... did you miss me? no ?? oh well
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |