No. of Recommendations: 5
vol:[<lag_days>|<param_ref_1>],[<num_of_periods>|<param_ref_2>],[<period_length>|<param_ref_3>]
As shown, the function vol takes three arguments, each of which can be either a number or a parameter reference. The value of lag_days must be a non-negative integer, the values of num_of_periods and period_length must be positive integers, and
lag_days + num_of_periods * period_length
must not exceed the retrospective limit. For each investment, the function vol calculates the annualized standard deviation of the natural logarithms of total returns (obtained by dividing the investment's appropriate closing g-prices) over the num_of_periods number of disjoint consecutive periods consisting of period_length number of market days, with the most recent period ending lag_days number of market days prior to the current trading date; the result is assigned to the calling field.
For example, vol:3,52,5 calculates each investment's volatility using its last 52 disjointly measured 5-day total returns, with the most recent 5-day total return measured through the close of the market date 3 days prior to the close of the current trading date.
Note that if lag_days is zero, then volatility is measured through the close of the current trading date, which corresponds to the same g-prices at which trades take place.
By default, a meaningful volatility measurement is always calculated for every investment on every market date, regardless of how recently the stock associated with an investment may have begun trading. This is possible because GTR1 Linearization defines each investment's daily g-prices indefinitely into the past using the history of parent companies and, when the latter does not exist, interpolation. However, to filter out investments with inadequate actual pricing history for a conventional volatility computation, use the field function dsio or dspo.