Applying functions to scrollable charts.

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Phineas
Newbie
Newbie
Posts: 18
Joined: Wed Apr 09, 2008 12:00 am

Applying functions to scrollable charts.

Post by Phineas » Sun Aug 03, 2008 8:44 pm

Applying functions to scrollable charts.

I have a financial candle chart implemented as follows. The entire data for 3000 days is stored in a Delphi type. I display 250 records at a time in Series1, a scrollable chart.

However, should I apply a 21 day Moving Average TFunction, then I can only apply it to the 250 records in series1. The MA displays incorrectly as it needed to be applied over the entire 3000 records.

I was wondering how others have solved this problem. Should I create an invisible dummy series containing ALL 3000 records, apply the MA to that series and then clone the appropriate 250 records to my scrollable series1 with each movement of the scroll bar?

Would that work? Is there a better way? Any help would be appreciated.

Marc
Site Admin
Site Admin
Posts: 1258
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Post by Marc » Tue Aug 05, 2008 3:33 pm

Hello,

An option would be to use the the inactive Series approach on which to base the function though that might negate any efficiencies gained via the sampled data approach you're using .. and may be an argument for making all the Series data available to the Chart from the outset. Another option would be to pre-calculate the function data (not necessarily via TeeChart) and store the points alongside your dataset to show as selected.

Regards,
Marc Meumann
Steema Support

Phineas
Newbie
Newbie
Posts: 18
Joined: Wed Apr 09, 2008 12:00 am

Post by Phineas » Tue Aug 05, 2008 8:55 pm

Thanks for that Marc. I'll do a rewrite and get rid of the Delphi types, making all the Series data available to the Chart from the outset.

Post Reply