How to use function and period
Posted: Fri May 20, 2005 8:46 pm
Hi,
i plan to write a custom function, first or second order derivative. The forms are very close to Moving Average. I need to calculate a new value for each value based on its nearby values. Got a few questions here
What the range in the Calculate() mean? Are they the range controlled by period style or?
Ex. if i want to do average of nearby values
Old Data 1 2 3 4 5 6 7
New Data (1+2)/2 (1+2+3)/3 (2+3+4)/3 ...
New Value 1.5 2 3 ...
How exactly shall I write the Calculate()? and where shall I store all the new values?
Best regards
Fang
i plan to write a custom function, first or second order derivative. The forms are very close to Moving Average. I need to calculate a new value for each value based on its nearby values. Got a few questions here
What the range in the Calculate() mean? Are they the range controlled by period style or?
Ex. if i want to do average of nearby values
Old Data 1 2 3 4 5 6 7
New Data (1+2)/2 (1+2+3)/3 (2+3+4)/3 ...
New Value 1.5 2 3 ...
How exactly shall I write the Calculate()? and where shall I store all the new values?
Best regards
Fang