Hi,
I want to plot Buy / Sell / Other Signals On a Candlestick Chart based on certain condition. The signal signs (Say Some Icon Image / UpArrow / DownArrow) should appear above High or below Low of a candle by a certain Offset value so that user can see it clearly. Please let me know how can I achieve this in Synfusion Winform chart using c#.
Thanks,
Amit
|
for (int i = 0; i < chartSeries1.Points.Count; i++)
{
var point = chartSeries1.Points[i];
if (point.YValues[3] < point.YValues[2])
{
chartSeries1.Styles[i].Symbol.Shape = ChartSymbolShape.Triangle;
chartSeries1.Styles[i].Symbol.Color = Color.Green;
}
else
{
chartSeries1.Styles[i].Symbol.Shape = ChartSymbolShape.InvertedTriangle;
chartSeries1.Styles[i].Symbol.Color = Color.Red;
}
chartSeries1.Styles[i].Symbol.Offset = new Size(0, -10);
}
|
Hi Yuvaraj,
Thanks
for your response. I tried as you suggested and the signals are
appearing on chart. However I want the Buy signal (Green Up
Triangle in your example) to be placed below the Low of the Candle And the Sell signal(Red
InvertedTriangle
in your example) to be placed Above the High of the candle.
Right now the offset is being computed with respect to the High of
candle I believe And hence all signals are appearing above the high of
the candle. Is there any way to achieve what I want ?
Thanks,
Amit
|
for (int i = 0; i < chartSeries1.Points.Count; i++)
{
var point = chartSeries1.Points[i];
if (point.YValues[3] < point.YValues[2])
{
ChartCustomPoint ccp = new ChartCustomPoint();
ccp.XValue = point.X;
ccp.YValue = point.YValues[1] - 1f;
ccp.CustomType = ChartCustomPointType.ChartCoordinates;
ccp.Symbol.Color = Color.Green;
ccp.Symbol.Offset = new Size(0, 30);
ccp.Symbol.Shape = ChartSymbolShape.Triangle;
this.chartControl1.CustomPoints.Add(ccp);
}
else
{
chartSeries1.Styles[i].Symbol.Shape = ChartSymbolShape.InvertedTriangle;
chartSeries1.Styles[i].Symbol.Color = Color.Red;
chartSeries1.Styles[i].Symbol.Offset = new Size(0, -10);
}
} |
Hi Yuvaraj ,
Thank you so much. It worked fine. Really appreciate the help.
Thanks,
Amit