Full Description
Calculates the average of the percentage moves of the selected period (expressed in bars, or trading days). This function returns N/A if the number of samples you requested are not found (for example a recent IPO. To override this behavior you can enter the # of minimum samples you allow with 'min_samples'. When 'min_samples' the function always returns a value when at least 2 samples are found.
Parameters
samples: number of pct moves
bars: the length in bars for the pct move period
offset: offset in bars
min_samples: min number of samples required, otherwise NA is returned
annualize: when true the average is annualized
Annualizing Avg Returns
First we calculate the number of calendar days of the entire period. We then annualize average returns as follows:
Annual Return = 100 * (Power( AvgPct/100+1, 365.25/days)-1)
Example
for IBM the PctAvg of the past 5 samples of the 2-bar returns:
Date |
Close |
2-Day Return |
07/24/06 | 75.99 | 0.67% |
07/21/06 | 74.86 | |
07/20/06 | 75.48 | 1.64% |
07/19/06 | 76.07 | |
07/18/06 | 74.26 | 0.94% |
07/17/06 | 73.70 | |
07/14/06 | 73.57 | -2.53% |
07/13/06 | 74.24 | |
07/12/06 | 75.48 | -1.55% |
07/11/06 | 76.47 |
07/10/06 | 76.67 |
PctAvg(5,2) = -0.165%, Annualized = -4.216%
Annualized formula: 100*(POWER(-0.165/100+1,365.2/14)-1)