I am displaying a Candle series in a Chart window. Based on some algorithm, I would like to display some special symbol (say, up triangle, down triangle, arrow, etc.) on some elements of the series. The symbol may have to be displayed either above the candlestick or below it. How can I do this? Obviously, because the symbol is logically "tied" to certain candlesticks, they should not vanish when I zoom or scroll the chart.
- Rangarajan
Drawing special symbols on Candlestick chart
-
- Newbie
- Posts: 10
- Joined: Fri Dec 10, 2021 12:00 am
Re: Drawing special symbols on Candlestick chart
Hello Rangarajan,
You could use a
You could use a
TPointSeries
and use OnGetPointerStyle
to modify its pointers as you wish. Ie:Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
begin
//...
with TPointSeries(Chart1.AddSeries(TPointSeries)) do
begin
Pointer.Size:=6;
AddXY(candleSeries.XValue[2], candleSeries.HighValues[2]);
AddXY(candleSeries.XValue[6], candleSeries.LowValues[6]);
OnGetPointerStyle:=SeriesGetPointerStyle;
end;
end;
function TForm1.SeriesGetPointerStyle(Sender: TChartSeries;
ValueIndex: Integer): TSeriesPointerStyle;
begin
case ValueIndex of
0: Result:=psTriangle;
1: Result:=psDownTriangle;
end;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Newbie
- Posts: 10
- Joined: Fri Dec 10, 2021 12:00 am
Re: Drawing special symbols on Candlestick chart
Looks good, thanks. Let me try this.
- Rangarajan
- Rangarajan
-
- Newbie
- Posts: 10
- Joined: Fri Dec 10, 2021 12:00 am
Re: Drawing special symbols on Candlestick chart
Thanks again. It works as expected.
1) How would I handle the case where I need to draw vertical lines (in different colours) on candlestick chart, instead of symbols? The vertical lines need to span the entire height of the chart window without any specific Y values.
2) Is it possible to display arbitrary information when moving the mouse over each candlestick element? Or when clicking on a specific element?
- Rangarajan
1) How would I handle the case where I need to draw vertical lines (in different colours) on candlestick chart, instead of symbols? The vertical lines need to span the entire height of the chart window without any specific Y values.
2) Is it possible to display arbitrary information when moving the mouse over each candlestick element? Or when clicking on a specific element?
- Rangarajan
Re: Drawing special symbols on Candlestick chart
Hello Rangarajan,
This sounds like theRangarajan wrote: ↑Thu Feb 03, 2022 11:50 am1) How would I handle the case where I need to draw vertical lines (in different colours) on candlestick chart, instead of symbols? The vertical lines need to span the entire height of the chart window without any specific Y values.
TColorLineTool
. Take a look at the ColorLine example in the Features Demo shipped with the installation.
Have you seen theRangarajan wrote: ↑Thu Feb 03, 2022 11:50 am2) Is it possible to display arbitrary information when moving the mouse over each candlestick element? Or when clicking on a specific element?
MarksTipTool
?
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Newbie
- Posts: 10
- Joined: Fri Dec 10, 2021 12:00 am
Re: Drawing special symbols on Candlestick chart
Super! Thanks.
- Rangarajan
- Rangarajan