Data Retrieval from TCandleSeries/TVolume

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Satish
Newbie
Newbie
Posts: 37
Joined: Fri Mar 04, 2005 5:00 am

Data Retrieval from TCandleSeries/TVolume

Post by Satish » Sat Mar 19, 2005 8:15 pm

I need to access date, open,high,low,volume values (TCandleSeries) & date, volume (TVolume Series) and also from various functions for display purposes. Am having type compatibility problems.

Could somebody guide me to a routine/module as to how I could retrieve these and be able to display in say a stringgrid. I am unable to find any example which roughly corresponds to a data window for the above different series.

Will appreciate a quicjk response.

Satish

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

Post by Narcís » Mon Mar 21, 2005 3:13 pm

Hello Satish,

You can do something similar to:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var
  i,j: integer;
  sc, sv: String;
begin
  for i:=0 to Chart1.SeriesCount-1 do
    Chart1.Series[i].FillSampleValues();

  for j:=0 to Series1.Count -1 do
  begin
    sc:='Date: '+DateToStr(FloatToDateTime(Series1.DateValues[j]));
    sc:=sc+', Open: '+FloatToStr(Series1.OpenValues[j]);
    sc:=sc+', High: '+FloatToStr(Series1.HighValues[j]);
    sc:=sc+', Low: '+FloatToStr(Series1.LowValues[j]);
    sc:=sc+', Volume: '+FloatToStr(Series2.YValues[j]);

    sv:='Date: '+DateToStr(FloatToDateTime(Series2.XValues[j]));
    sv:=sv+', Volume: '+FloatToStr(Series2.YValues[j]);

    Memo1.Lines.Add(sc);
    Memo2.Lines.Add(sv);
  end;
end;
Where Series1 is a TCandleSeries and Series2 is a TVolumeSeries.

You may also be interested in using a TChartGrid component.
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

Satish
Newbie
Newbie
Posts: 37
Joined: Fri Mar 04, 2005 5:00 am

Post by Satish » Tue Mar 22, 2005 2:29 am

Thanks a lot - will try it out !!

Satish

Post Reply