Page 1 of 1

Applying functions to scrollable charts.

Posted: Sun Aug 03, 2008 8:44 pm
by 10548832
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.

Posted: Tue Aug 05, 2008 3:33 pm
by Marc
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

Posted: Tue Aug 05, 2008 8:55 pm
by 10548832
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.