Print Page  
TECHNICAL / VOLATILITY
PctAvg(samples,bars[,offset,min_samples,annualize])
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/0675.990.67%
07/21/0674.86
07/20/0675.481.64%
07/19/0676.07
07/18/0674.260.94%
07/17/0673.70
07/14/0673.57-2.53%
07/13/0674.24
07/12/0675.48-1.55%
07/11/0676.47
07/10/0676.67


PctAvg(5,2) = -0.165%, Annualized = -4.216%

Annualized formula: 100*(POWER(-0.165/100+1,365.2/14)-1)