HighLowPen in Candle Series

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
msd48
Newbie
Newbie
Posts: 14
Joined: Mon Oct 15, 2007 12:00 am

HighLowPen in Candle Series

Post by msd48 » Thu Aug 28, 2008 7:24 am

Hi!

How can I set the color of HighLowPen according to the UpCloseColor (or DownCloseColor) in a TCandleSeries ?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Aug 28, 2008 9:21 am

Hi msd48,

You can use candle's OnGetPointerStyle event like this:

Code: Select all

function TForm1.Series1GetPointerStyle(Sender: TChartSeries;
  ValueIndex: Integer): TSeriesPointerStyle;
begin
  Series1.HighLowPen.Color := Series1.DownCloseColor;

  if (ValueIndex>0) then
  begin
    if Series1.CloseValues[ValueIndex] > Series1.CloseValues[ValueIndex-1] then
      Series1.HighLowPen.Color := Series1.UpCloseColor;
  end;

  result:=psRectangle;
end;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

msd48
Newbie
Newbie
Posts: 14
Joined: Mon Oct 15, 2007 12:00 am

Post by msd48 » Fri Aug 29, 2008 5:51 am

Hi Narcís,

Thanks for help.
Question is closed.

Post Reply