Page 1 of 1

Data Retrieval from TCandleSeries/TVolume

Posted: Sat Mar 19, 2005 8:15 pm
by 9236155
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

Posted: Mon Mar 21, 2005 3:13 pm
by narcis
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.

Posted: Tue Mar 22, 2005 2:29 am
by 9236155
Thanks a lot - will try it out !!

Satish