Time Relative Functions

Time-Relative Functions
Name Description
chg Absolute change. Examples:
  • chg(x) : change in value since the beginning of data
  • chg(x,"Nov 30, 2008") : change in value since November 30, 2008
  • chg(x,"-1m") : change in value since 1 month of previous data

Note that in cases where the interval is potentially ambiguous, you can specify reldate() or date().

pctchg Percent Change. Same syntax as chg(x) or chg(x,interval).
ratchg Rate of Change. Same syntax as chg(x) or chg(x,interval).
mavg Moving Average. Same syntax as chg(x) or chg(x,interval).
wmavg Weighted Moving Average. Same syntax as chg(x) or chg(x,interval).
expwma Exponential Weighted Moving Average. Same syntax as chg(x) or chg(x,interval).