Function Series under Program Control

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

Function Series under Program Control

Post by Satish » Wed Apr 27, 2005 12:39 pm

I am trying to generate a function series under program control, program stub given below:-

Chart1.AddSeries(TLineSeries);
lastseries:=Chart1.SeriesCount-1;
Chart1.Series[lastseries].ParentChart:=Chart1;
Chart1.Series[lastseries].SetFunction(TMovingAverageFunction.Create(Self));
// connect function series to datasource: in this case to first series
Chart1.Series[lastseries].DataSource:=Series2;
// How do I specify it to use close values of Series1 (Candleseries) ??
// Set additional EMA function properties:
With (Chart1.Series[lastseries].FunctionType as TMovingAverageFunction) do
begin
Period :=20;
end;
Chart1.Series[lastseries].CheckDataSource;
....

Series1 is a Candle Series. How does one specify that the values to use for the Moving Average are CLose values of CandleSeries ? I t is pretty easy in the Chart Editor but am unable to find the right syntax to do it inside the progra.

Will appreciate help/suggestions.

Satish

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Thu Apr 28, 2005 11:57 am

Hi, Satish.
How does one specify that the values to use for the Moving Average are CLose values of CandleSeries ?
It's relatively simple:

Code: Select all

Chart1.Series[lastseries].YValues.ValueSource := 'Close';
...
Marjan Slatinek,
http://www.steema.com

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

Post by Satish » Thu Apr 28, 2005 4:00 pm

Narcis,

Thanks a lot - you really have saved me a lot of effort . U guys are great !!

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 » Fri Apr 29, 2005 7:32 am

Hi Satish,

Thank you very much for your kind words but here the credit goes for Marjan :wink: .
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

Post Reply