Logo

SQL Server MovingVOLATILITY Function

Updated 2023-11-13 21:58:14.430000

Description

Use the scalar function MovingVOLATILITY to calculate the historical volatility based upon price or valuation data from column values in an ordered resultant table, without the need for a self-join. The volatility is calculated for each value from the first value in the window to the last value in the window. If the column values are presented to the functions out of order, an error message will be generated.

The historic volatility is calculated as the sample standard deviation of the natural logarithm of the returns multiplied by the square of the scaling factor supplied to the function.

Syntax

SELECT [westclintech].[wct].[MovingVOLATILITY](
  <@Price, float,>
 ,<@Scale, float,>
 ,<@Offset, int,>
 ,<@RowNum, int,>
 ,<@Id, tinyint,>
 ,<@Exact, bit,>)

Arguments

@Price

the price passed into the function. Generally, price is the end-of-day price for the security, commodity, currency, or index for which the volatility is being calculated. @Price is an expression of type float or of a type that can be implicitly converted to float.

@Scale

the scaling factor used in the calculation. @Scale is an expression of type float or of a type that can be implicitly converted to float.

@Offset

specifies the window size. The window size (or the number of rows included in the result) is the current row plus the @Offset. Since the volatility calculation is based in returns, the window-size needs to account for the initial price; in other words, 30 days of returns requires 31 days of prices. @Offset is an expression of type int or of a type that can be implicitly converted to int.

@RowNum

the number of the row within the group for which the sum is being calculated. If @RowNum for the current row in a set is less than or equal to the previous @RowNum and @RowNum is not equal to 1, an error message will be generated. @RowNum is an expression of type int or of a type that can be implicitly converted to int.

@Id

a unique identifier for the MovingVOLATILITY calculation. @Id allows you to specify multiple moving sums within a resultant table. @Id is an expression of type tinyint or of a type that can be implicitly converted to tinyint.

@Exact

a bit value which tells the function whether or not to return a NULL value if the number of rows in the window is smaller the @Offset value. If @Exact is 'True' and the number of rows in the window is less the @Offset then a NULL is returned. @Exact is an expression of type bit or of a type that can be implicitly converted to bit.

Return Type

float

Remarks

If @Id is NULL then @Id = 0.

To calculate the running volatility from the beginning of a dataset or partition, use the RunningVOLATILITY function.

If @RowNum is equal to 1, MovingVOLATILITY is equal to NULL.

@RowNum must be in ascending order.

There may be cases where the order in which the data are returned to the function and the order in which the results are returned are different, generally due to parallelism. You can use OPTION(MAXDOP 1) or OPTION(MAXDOP 1,FORCE ORDER) to help eliminate this problem.

Examples

In this example we calculate the 30-day moving volatility.

SELECT ticker,
       tdate,
       CAST(price as money) as price,
       wct.MovingVOLATILITY(   price,                              --@Price
                               252,                                --@Scale
                               30,                                 --@Offset
                               ROW_NUMBER() OVER (ORDER BY tdate), --@RowNum
                               NULL,                               --@Id
                               'True'                              --@Exact
                           ) as VOL
FROM
(
    VALUES
        ('IBM', '2013-12-27', 185.08),
        ('IBM', '2013-12-26', 185.35),
        ('IBM', '2013-12-24', 183.22),
        ('IBM', '2013-12-23', 182.23),
        ('IBM', '2013-12-20', 180.02),
        ('IBM', '2013-12-19', 180.22),
        ('IBM', '2013-12-18', 178.7),
        ('IBM', '2013-12-17', 175.76),
        ('IBM', '2013-12-16', 177.85),
        ('IBM', '2013-12-13', 172.8),
        ('IBM', '2013-12-12', 173.37),
        ('IBM', '2013-12-11', 175.2),
        ('IBM', '2013-12-10', 177.12),
        ('IBM', '2013-12-09', 177.46),
        ('IBM', '2013-12-06', 177.67),
        ('IBM', '2013-12-05', 176.08),
        ('IBM', '2013-12-04', 175.74),
        ('IBM', '2013-12-03', 176.08),
        ('IBM', '2013-12-02', 177.48),
        ('IBM', '2013-11-29', 179.68),
        ('IBM', '2013-11-27', 178.97),
        ('IBM', '2013-11-26', 177.31),
        ('IBM', '2013-11-25', 178.94),
        ('IBM', '2013-11-22', 181.3),
        ('IBM', '2013-11-21', 184.13),
        ('IBM', '2013-11-20', 185.19),
        ('IBM', '2013-11-19', 185.25),
        ('IBM', '2013-11-18', 184.47),
        ('IBM', '2013-11-15', 183.19),
        ('IBM', '2013-11-14', 182.21),
        ('IBM', '2013-11-13', 183.55),
        ('IBM', '2013-11-12', 183.07),
        ('IBM', '2013-11-11', 182.88),
        ('IBM', '2013-11-08', 179.99),
        ('IBM', '2013-11-07', 180),
        ('IBM', '2013-11-06', 179.19),
        ('IBM', '2013-11-05', 176.9),
        ('IBM', '2013-11-04', 179.31),
        ('IBM', '2013-11-01', 178.27),
        ('IBM', '2013-10-31', 178.25),
        ('IBM', '2013-10-30', 179.19),
        ('IBM', '2013-10-29', 181.15),
        ('IBM', '2013-10-28', 176.4),
        ('IBM', '2013-10-25', 175.91),
        ('IBM', '2013-10-24', 176.85),
        ('IBM', '2013-10-23', 174.83),
        ('IBM', '2013-10-22', 174.04),
        ('IBM', '2013-10-21', 171.94),
        ('IBM', '2013-10-18', 172.85),
        ('IBM', '2013-10-17', 173.9),
        ('IBM', '2013-10-16', 185.73),
        ('IBM', '2013-10-15', 183.67),
        ('IBM', '2013-10-14', 185.97),
        ('IBM', '2013-10-11', 185.17),
        ('IBM', '2013-10-10', 183.78),
        ('IBM', '2013-10-09', 180.35),
        ('IBM', '2013-10-08', 177.77),
        ('IBM', '2013-10-07', 181.04),
        ('IBM', '2013-10-04', 183.12),
        ('IBM', '2013-10-03', 182.88),
        ('IBM', '2013-10-02', 183.97),
        ('IBM', '2013-10-01', 185.38),
        ('IBM', '2013-09-30', 184.19)
) n (ticker, tdate, price);

This produces the following result.

tickertdatepriceVOL
IBM2013-09-30184.19NULL
IBM2013-10-01185.38NULL
IBM2013-10-02183.97NULL
IBM2013-10-03182.88NULL
IBM2013-10-04183.12NULL
IBM2013-10-07181.04NULL
IBM2013-10-08177.77NULL
IBM2013-10-09180.35NULL
IBM2013-10-10183.78NULL
IBM2013-10-11185.17NULL
IBM2013-10-14185.97NULL
IBM2013-10-15183.67NULL
IBM2013-10-16185.73NULL
IBM2013-10-17173.90NULL
IBM2013-10-18172.85NULL
IBM2013-10-21171.94NULL
IBM2013-10-22174.04NULL
IBM2013-10-23174.83NULL
IBM2013-10-24176.85NULL
IBM2013-10-25175.91NULL
IBM2013-10-28176.40NULL
IBM2013-10-29181.15NULL
IBM2013-10-30179.19NULL
IBM2013-10-31178.25NULL
IBM2013-11-01178.27NULL
IBM2013-11-04179.31NULL
IBM2013-11-05176.90NULL
IBM2013-11-06179.19NULL
IBM2013-11-07180.00NULL
IBM2013-11-08179.99NULL
IBM2013-11-11182.880.259600756641362
IBM2013-11-12183.070.25886435068979
IBM2013-11-13183.550.258084881217436
IBM2013-11-14182.210.25838941695409
IBM2013-11-15183.190.258851361662631
IBM2013-11-18184.470.257272874238383
IBM2013-11-19185.250.25113141270427
IBM2013-11-20185.190.248098166203494
IBM2013-11-21184.130.242810179393185
IBM2013-11-22181.300.245804723406176
IBM2013-11-25178.940.247889849528801
IBM2013-11-26177.310.246782618938391
IBM2013-11-27178.970.24604234701296
IBM2013-11-29179.680.152062274334431
IBM2013-12-02177.480.155660954549234
IBM2013-12-03176.080.156753405261162
IBM2013-12-04175.740.153166929494441
IBM2013-12-05176.080.152731802077581
IBM2013-12-06177.670.151297530686739
IBM2013-12-09177.460.15046658789529
IBM2013-12-10177.120.15040745529138
IBM2013-12-11175.200.131153490377389
IBM2013-12-12173.370.13091290987267
IBM2013-12-13172.800.130493430608268
IBM2013-12-16177.850.15657740328222
IBM2013-12-17175.760.159130504552285
IBM2013-12-18178.700.161891633259364
IBM2013-12-19180.220.159420520640619
IBM2013-12-20180.020.158928812684109
IBM2013-12-23182.230.162812027777703
IBM2013-12-24183.220.156848086287117
IBM2013-12-26185.350.160341722727633
IBM2013-12-27185.080.160289637318093

In this example, we calculate the 30-day moving volatility for multiple securities.

SELECT ticker,
       tdate,
       CAST(price as money) as price,
       wct.MovingVOLATILITY(   price,                                            
                 --@Price
                               252,   --@Scale
                               30,    --@Offset
                               ROW_NUMBER() OVER (PARTITION BY ticker ORDER BY 
                                         ticker, tdate), --@RowNum
                               NULL,  --@Id
                               'True' --@Exact
                           ) as VOL
FROM
(
    VALUES
        ('IBM', '2013-12-27', 185.08),
        ('IBM', '2013-12-26', 185.35),
        ('IBM', '2013-12-24', 183.22),
        ('IBM', '2013-12-23', 182.23),
        ('IBM', '2013-12-20', 180.02),
        ('IBM', '2013-12-19', 180.22),
        ('IBM', '2013-12-18', 178.7),
        ('IBM', '2013-12-17', 175.76),
        ('IBM', '2013-12-16', 177.85),
        ('IBM', '2013-12-13', 172.8),
        ('IBM', '2013-12-12', 173.37),
        ('IBM', '2013-12-11', 175.2),
        ('IBM', '2013-12-10', 177.12),
        ('IBM', '2013-12-09', 177.46),
        ('IBM', '2013-12-06', 177.67),
        ('IBM', '2013-12-05', 176.08),
        ('IBM', '2013-12-04', 175.74),
        ('IBM', '2013-12-03', 176.08),
        ('IBM', '2013-12-02', 177.48),
        ('IBM', '2013-11-29', 179.68),
        ('IBM', '2013-11-27', 178.97),
        ('IBM', '2013-11-26', 177.31),
        ('IBM', '2013-11-25', 178.94),
        ('IBM', '2013-11-22', 181.3),
        ('IBM', '2013-11-21', 184.13),
        ('IBM', '2013-11-20', 185.19),
        ('IBM', '2013-11-19', 185.25),
        ('IBM', '2013-11-18', 184.47),
        ('IBM', '2013-11-15', 183.19),
        ('IBM', '2013-11-14', 182.21),
        ('IBM', '2013-11-13', 183.55),
        ('IBM', '2013-11-12', 183.07),
        ('IBM', '2013-11-11', 182.88),
        ('IBM', '2013-11-08', 179.99),
        ('IBM', '2013-11-07', 180),
        ('IBM', '2013-11-06', 179.19),
        ('IBM', '2013-11-05', 176.9),
        ('IBM', '2013-11-04', 179.31),
        ('IBM', '2013-11-01', 178.27),
        ('IBM', '2013-10-31', 178.25),
        ('IBM', '2013-10-30', 179.19),
        ('IBM', '2013-10-29', 181.15),
        ('IBM', '2013-10-28', 176.4),
        ('IBM', '2013-10-25', 175.91),
        ('IBM', '2013-10-24', 176.85),
        ('IBM', '2013-10-23', 174.83),
        ('IBM', '2013-10-22', 174.04),
        ('IBM', '2013-10-21', 171.94),
        ('IBM', '2013-10-18', 172.85),
        ('IBM', '2013-10-17', 173.9),
        ('IBM', '2013-10-16', 185.73),
        ('IBM', '2013-10-15', 183.67),
        ('IBM', '2013-10-14', 185.97),
        ('IBM', '2013-10-11', 185.17),
        ('IBM', '2013-10-10', 183.78),
        ('IBM', '2013-10-09', 180.35),
        ('IBM', '2013-10-08', 177.77),
        ('IBM', '2013-10-07', 181.04),
        ('IBM', '2013-10-04', 183.12),
        ('IBM', '2013-10-03', 182.88),
        ('IBM', '2013-10-02', 183.97),
        ('IBM', '2013-10-01', 185.38),
        ('IBM', '2013-09-30', 184.19),
        ('FB', '2013-12-27', 55.44),
        ('FB', '2013-12-26', 57.73),
        ('FB', '2013-12-24', 57.96),
        ('FB', '2013-12-23', 57.77),
        ('FB', '2013-12-20', 55.12),
        ('FB', '2013-12-19', 55.05),
        ('FB', '2013-12-18', 55.57),
        ('FB', '2013-12-17', 54.86),
        ('FB', '2013-12-16', 53.81),
        ('FB', '2013-12-13', 53.32),
        ('FB', '2013-12-12', 51.83),
        ('FB', '2013-12-11', 49.38),
        ('FB', '2013-12-10', 50.25),
        ('FB', '2013-12-09', 48.84),
        ('FB', '2013-12-06', 47.94),
        ('FB', '2013-12-05', 48.34),
        ('FB', '2013-12-04', 48.62),
        ('FB', '2013-12-03', 46.73),
        ('FB', '2013-12-02', 47.06),
        ('FB', '2013-11-29', 47.01),
        ('FB', '2013-11-27', 46.49),
        ('FB', '2013-11-26', 45.89),
        ('FB', '2013-11-25', 44.82),
        ('FB', '2013-11-22', 46.23),
        ('FB', '2013-11-21', 46.7),
        ('FB', '2013-11-20', 46.43),
        ('FB', '2013-11-19', 46.36),
        ('FB', '2013-11-18', 45.83),
        ('FB', '2013-11-15', 49.01),
        ('FB', '2013-11-14', 48.99),
        ('FB', '2013-11-13', 48.71),
        ('FB', '2013-11-12', 46.61),
        ('FB', '2013-11-11', 46.2),
        ('FB', '2013-11-08', 47.53),
        ('FB', '2013-11-07', 47.56),
        ('FB', '2013-11-06', 49.12),
        ('FB', '2013-11-05', 50.11),
        ('FB', '2013-11-04', 48.22),
        ('FB', '2013-11-01', 49.75),
        ('FB', '2013-10-31', 50.21),
        ('FB', '2013-10-30', 49.01),
        ('FB', '2013-10-29', 49.4),
        ('FB', '2013-10-28', 50.23),
        ('FB', '2013-10-25', 51.95),
        ('FB', '2013-10-24', 52.45),
        ('FB', '2013-10-23', 51.9),
        ('FB', '2013-10-22', 52.68),
        ('FB', '2013-10-21', 53.85),
        ('FB', '2013-10-18', 54.22),
        ('FB', '2013-10-17', 52.21),
        ('FB', '2013-10-16', 51.14),
        ('FB', '2013-10-15', 49.5),
        ('FB', '2013-10-14', 49.51),
        ('FB', '2013-10-11', 49.11),
        ('FB', '2013-10-10', 49.05),
        ('FB', '2013-10-09', 46.77),
        ('FB', '2013-10-08', 47.14),
        ('FB', '2013-10-07', 50.52),
        ('FB', '2013-10-04', 51.04),
        ('FB', '2013-10-03', 49.18),
        ('FB', '2013-10-02', 50.28),
        ('FB', '2013-10-01', 50.42),
        ('FB', '2013-09-30', 50.23),
        ('ORCL', '2013-12-27', 37.98),
        ('ORCL', '2013-12-26', 37.69),
        ('ORCL', '2013-12-24', 37.32),
        ('ORCL', '2013-12-23', 36.93),
        ('ORCL', '2013-12-20', 36.37),
        ('ORCL', '2013-12-19', 36.6),
        ('ORCL', '2013-12-18', 34.6),
        ('ORCL', '2013-12-17', 33.63),
        ('ORCL', '2013-12-16', 33.54),
        ('ORCL', '2013-12-13', 33.23),
        ('ORCL', '2013-12-12', 33.6),
        ('ORCL', '2013-12-11', 34.56),
        ('ORCL', '2013-12-10', 34.8),
        ('ORCL', '2013-12-09', 35.6),
        ('ORCL', '2013-12-06', 35.48),
        ('ORCL', '2013-12-05', 34.85),
        ('ORCL', '2013-12-04', 35.07),
        ('ORCL', '2013-12-03', 35.07),
        ('ORCL', '2013-12-02', 35.08),
        ('ORCL', '2013-11-29', 35.29),
        ('ORCL', '2013-11-27', 35.29),
        ('ORCL', '2013-11-26', 34.93),
        ('ORCL', '2013-11-25', 34.78),
        ('ORCL', '2013-11-22', 34.83),
        ('ORCL', '2013-11-21', 34.94),
        ('ORCL', '2013-11-20', 34.75),
        ('ORCL', '2013-11-19', 34.76),
        ('ORCL', '2013-11-18', 34.93),
        ('ORCL', '2013-11-15', 34.92),
        ('ORCL', '2013-11-14', 34.38),
        ('ORCL', '2013-11-13', 35),
        ('ORCL', '2013-11-12', 34.7),
        ('ORCL', '2013-11-11', 34.37),
        ('ORCL', '2013-11-08', 34.35),
        ('ORCL', '2013-11-07', 34),
        ('ORCL', '2013-11-06', 34.07),
        ('ORCL', '2013-11-05', 33.5),
        ('ORCL', '2013-11-04', 33.71),
        ('ORCL', '2013-11-01', 33.53),
        ('ORCL', '2013-10-31', 33.5),
        ('ORCL', '2013-10-30', 33.53),
        ('ORCL', '2013-10-29', 33.71),
        ('ORCL', '2013-10-28', 33.14),
        ('ORCL', '2013-10-25', 33.15),
        ('ORCL', '2013-10-24', 33.07),
        ('ORCL', '2013-10-23', 32.7),
        ('ORCL', '2013-10-22', 32.9),
        ('ORCL', '2013-10-21', 32.95),
        ('ORCL', '2013-10-18', 32.9),
        ('ORCL', '2013-10-17', 32.87),
        ('ORCL', '2013-10-16', 33.02),
        ('ORCL', '2013-10-15', 32.75),
        ('ORCL', '2013-10-14', 33.28),
        ('ORCL', '2013-10-11', 33.26),
        ('ORCL', '2013-10-10', 32.99),
        ('ORCL', '2013-10-09', 32.19),
        ('ORCL', '2013-10-08', 32.37),
        ('ORCL', '2013-10-07', 32.84),
        ('ORCL', '2013-10-04', 33.21),
        ('ORCL', '2013-10-03', 33.12),
        ('ORCL', '2013-10-02', 33.56),
        ('ORCL', '2013-10-01', 33.38),
        ('ORCL', '2013-09-30', 33.05),
        ('MSFT', '2013-12-27', 37.29),
        ('MSFT', '2013-12-26', 37.44),
        ('MSFT', '2013-12-24', 37.08),
        ('MSFT', '2013-12-23', 36.62),
        ('MSFT', '2013-12-20', 36.8),
        ('MSFT', '2013-12-19', 36.25),
        ('MSFT', '2013-12-18', 36.58),
        ('MSFT', '2013-12-17', 36.52),
        ('MSFT', '2013-12-16', 36.89),
        ('MSFT', '2013-12-13', 36.69),
        ('MSFT', '2013-12-12', 37.22),
        ('MSFT', '2013-12-11', 37.61),
        ('MSFT', '2013-12-10', 38.11),
        ('MSFT', '2013-12-09', 38.71),
        ('MSFT', '2013-12-06', 38.36),
        ('MSFT', '2013-12-05', 38),
        ('MSFT', '2013-12-04', 38.94),
        ('MSFT', '2013-12-03', 38.31),
        ('MSFT', '2013-12-02', 38.45),
        ('MSFT', '2013-11-29', 38.13),
        ('MSFT', '2013-11-27', 37.6),
        ('MSFT', '2013-11-26', 37.35),
        ('MSFT', '2013-11-25', 37.64),
        ('MSFT', '2013-11-22', 37.57),
        ('MSFT', '2013-11-21', 37.4),
        ('MSFT', '2013-11-20', 37.08),
        ('MSFT', '2013-11-19', 36.74),
        ('MSFT', '2013-11-18', 36.92),
        ('MSFT', '2013-11-15', 37.56),
        ('MSFT', '2013-11-14', 37.73),
        ('MSFT', '2013-11-13', 37.87),
        ('MSFT', '2013-11-12', 37.08),
        ('MSFT', '2013-11-11', 37.31),
        ('MSFT', '2013-11-08', 37.5),
        ('MSFT', '2013-11-07', 37.22),
        ('MSFT', '2013-11-06', 37.89),
        ('MSFT', '2013-11-05', 36.36),
        ('MSFT', '2013-11-04', 35.67),
        ('MSFT', '2013-11-01', 35.26),
        ('MSFT', '2013-10-31', 35.14),
        ('MSFT', '2013-10-30', 35.27),
        ('MSFT', '2013-10-29', 35.25),
        ('MSFT', '2013-10-28', 35.3),
        ('MSFT', '2013-10-25', 35.46),
        ('MSFT', '2013-10-24', 33.47),
        ('MSFT', '2013-10-23', 33.51),
        ('MSFT', '2013-10-22', 34.32),
        ('MSFT', '2013-10-21', 34.73),
        ('MSFT', '2013-10-18', 34.7),
        ('MSFT', '2013-10-17', 34.66),
        ('MSFT', '2013-10-16', 34.38),
        ('MSFT', '2013-10-15', 34.23),
        ('MSFT', '2013-10-14', 34.19),
        ('MSFT', '2013-10-11', 33.87),
        ('MSFT', '2013-10-10', 33.51),
        ('MSFT', '2013-10-09', 32.82),
        ('MSFT', '2013-10-08', 32.76),
        ('MSFT', '2013-10-07', 33.05),
        ('MSFT', '2013-10-04', 33.62),
        ('MSFT', '2013-10-03', 33.61),
        ('MSFT', '2013-10-02', 33.66),
        ('MSFT', '2013-10-01', 33.33),
        ('MSFT', '2013-09-30', 33.03),
        ('AAPL', '2013-12-27', 560.09),
        ('AAPL', '2013-12-26', 563.9),
        ('AAPL', '2013-12-24', 567.67),
        ('AAPL', '2013-12-23', 570.09),
        ('AAPL', '2013-12-20', 549.02),
        ('AAPL', '2013-12-19', 544.46),
        ('AAPL', '2013-12-18', 550.77),
        ('AAPL', '2013-12-17', 554.99),
        ('AAPL', '2013-12-16', 557.5),
        ('AAPL', '2013-12-13', 554.43),
        ('AAPL', '2013-12-12', 560.54),
        ('AAPL', '2013-12-11', 561.36),
        ('AAPL', '2013-12-10', 565.55),
        ('AAPL', '2013-12-09', 566.43),
        ('AAPL', '2013-12-06', 560.02),
        ('AAPL', '2013-12-05', 567.9),
        ('AAPL', '2013-12-04', 565),
        ('AAPL', '2013-12-03', 566.32),
        ('AAPL', '2013-12-02', 551.23),
        ('AAPL', '2013-11-29', 556.07),
        ('AAPL', '2013-11-27', 545.96),
        ('AAPL', '2013-11-26', 533.4),
        ('AAPL', '2013-11-25', 523.74),
        ('AAPL', '2013-11-22', 519.8),
        ('AAPL', '2013-11-21', 521.14),
        ('AAPL', '2013-11-20', 515),
        ('AAPL', '2013-11-19', 519.55),
        ('AAPL', '2013-11-18', 518.63),
        ('AAPL', '2013-11-15', 524.99),
        ('AAPL', '2013-11-14', 528.16),
        ('AAPL', '2013-11-13', 520.63),
        ('AAPL', '2013-11-12', 520.01),
        ('AAPL', '2013-11-11', 519.05),
        ('AAPL', '2013-11-08', 520.56),
        ('AAPL', '2013-11-07', 512.49),
        ('AAPL', '2013-11-06', 520.92),
        ('AAPL', '2013-11-05', 522.4),
        ('AAPL', '2013-11-04', 523.69),
        ('AAPL', '2013-11-01', 517.01),
        ('AAPL', '2013-10-31', 519.67),
        ('AAPL', '2013-10-30', 521.85),
        ('AAPL', '2013-10-29', 513.68),
        ('AAPL', '2013-10-28', 526.8),
        ('AAPL', '2013-10-25', 522.91),
        ('AAPL', '2013-10-24', 528.82),
        ('AAPL', '2013-10-23', 521.91),
        ('AAPL', '2013-10-22', 516.85),
        ('AAPL', '2013-10-21', 518.33),
        ('AAPL', '2013-10-18', 505.94),
        ('AAPL', '2013-10-17', 501.57),
        ('AAPL', '2013-10-16', 498.2),
        ('AAPL', '2013-10-15', 495.79),
        ('AAPL', '2013-10-14', 493.16),
        ('AAPL', '2013-10-11', 489.95),
        ('AAPL', '2013-10-10', 486.8),
        ('AAPL', '2013-10-09', 483.77),
        ('AAPL', '2013-10-08', 478.15),
        ('AAPL', '2013-10-07', 484.92),
        ('AAPL', '2013-10-04', 480.23),
        ('AAPL', '2013-10-03', 480.6),
        ('AAPL', '2013-10-02', 486.72),
        ('AAPL', '2013-10-01', 485.13),
        ('AAPL', '2013-09-30', 473.98)
) n (ticker, tdate, price);

This produces the following result.

tickertdatepriceVOL
AAPL2013-09-30473.98NULL
AAPL2013-10-01485.13NULL
AAPL2013-10-02486.72NULL
AAPL2013-10-03480.60NULL
AAPL2013-10-04480.23NULL
AAPL2013-10-07484.92NULL
AAPL2013-10-08478.15NULL
AAPL2013-10-09483.77NULL
AAPL2013-10-10486.80NULL
AAPL2013-10-11489.95NULL
AAPL2013-10-14493.16NULL
AAPL2013-10-15495.79NULL
AAPL2013-10-16498.20NULL
AAPL2013-10-17501.57NULL
AAPL2013-10-18505.94NULL
AAPL2013-10-21518.33NULL
AAPL2013-10-22516.85NULL
AAPL2013-10-23521.91NULL
AAPL2013-10-24528.82NULL
AAPL2013-10-25522.91NULL
AAPL2013-10-28526.80NULL
AAPL2013-10-29513.68NULL
AAPL2013-10-30521.85NULL
AAPL2013-10-31519.67NULL
AAPL2013-11-01517.01NULL
AAPL2013-11-04523.69NULL
AAPL2013-11-05522.40NULL
AAPL2013-11-06520.92NULL
AAPL2013-11-07512.49NULL
AAPL2013-11-08520.56NULL
AAPL2013-11-11519.050.182448898566812
AAPL2013-11-12520.010.172083895254781
AAPL2013-11-13520.630.172088922541504
AAPL2013-11-14528.160.169557381867762
AAPL2013-11-15524.990.171284793834041
AAPL2013-11-18518.630.175500927555936
AAPL2013-11-19519.550.168585936287561
AAPL2013-11-20515.000.169619590467246
AAPL2013-11-21521.140.17158174055262
AAPL2013-11-22519.800.171665850721973
AAPL2013-11-25523.740.171926757898195
AAPL2013-11-26533.400.178087844824715
AAPL2013-11-27545.960.187987250653775
AAPL2013-11-29556.070.19291247343686
AAPL2013-12-02551.230.195392658373822
AAPL2013-12-03566.320.198211747949849
AAPL2013-12-04565.000.19808360298352
AAPL2013-12-05567.900.19716095745469
AAPL2013-12-06560.020.200448611372548
AAPL2013-12-09566.430.198263046444197
AAPL2013-12-10565.550.198100660818933
AAPL2013-12-11561.360.182686310947391
AAPL2013-12-12560.540.178968180571978
AAPL2013-12-13554.430.182177169130701
AAPL2013-12-16557.500.181086060938817
AAPL2013-12-17554.990.179464900321255
AAPL2013-12-18550.770.181182396659916
AAPL2013-12-19544.460.184811075666558
AAPL2013-12-20549.020.177873957920341
AAPL2013-12-23570.090.202045192617558
AAPL2013-12-24567.670.202426988470211
AAPL2013-12-26563.900.204336339708499
AAPL2013-12-27560.090.206145940389823
FB2013-09-3050.23NULL
FB2013-10-0150.42NULL
FB2013-10-0250.28NULL
FB2013-10-0349.18NULL
FB2013-10-0451.04NULL
FB2013-10-0750.52NULL
FB2013-10-0847.14NULL
FB2013-10-0946.77NULL
FB2013-10-1049.05NULL
FB2013-10-1149.11NULL
FB2013-10-1449.51NULL
FB2013-10-1549.50NULL
FB2013-10-1651.14NULL
FB2013-10-1752.21NULL
FB2013-10-1854.22NULL
FB2013-10-2153.85NULL
FB2013-10-2252.68NULL
FB2013-10-2351.90NULL
FB2013-10-2452.45NULL
FB2013-10-2551.95NULL
FB2013-10-2850.23NULL
FB2013-10-2949.40NULL
FB2013-10-3049.01NULL
FB2013-10-3150.21NULL
FB2013-11-0149.75NULL
FB2013-11-0448.22NULL
FB2013-11-0550.11NULL
FB2013-11-0649.12NULL
FB2013-11-0747.56NULL
FB2013-11-0847.53NULL
FB2013-11-1146.200.413408370202952
FB2013-11-1246.610.414365401035481
FB2013-11-1348.710.435894949700045
FB2013-11-1448.990.431653934954346
FB2013-11-1549.010.416987639366383
FB2013-11-1845.830.458041915373724
FB2013-11-1946.360.414670400399728
FB2013-11-2046.430.414121926202439
FB2013-11-2146.700.389126146601151
FB2013-11-2246.230.389789146687931
FB2013-11-2544.820.397353542073473
FB2013-11-2645.890.404887818224236
FB2013-11-2746.490.393950906964857
FB2013-11-2947.010.389859680209728
FB2013-12-0247.060.370105984913441
FB2013-12-0346.730.370115858530058
FB2013-12-0448.620.387834189850461
FB2013-12-0548.340.386228074606856
FB2013-12-0647.940.384613467723489
FB2013-12-0948.840.389068143912512
FB2013-12-1050.250.386866728808467
FB2013-12-1149.380.387174385541323
FB2013-12-1251.830.410886254243779
FB2013-12-1353.320.413017561316782
FB2013-12-1653.810.412114218265737
FB2013-12-1754.860.40195314573859
FB2013-12-1855.570.389719506456651
FB2013-12-1955.050.385389246215378
FB2013-12-2055.120.370063133368606
FB2013-12-2357.770.389076800308892
FB2013-12-2457.960.374973997553309
FB2013-12-2657.730.376430695610467
FB2013-12-2755.440.384016812079829
IBM2013-09-30184.19NULL
IBM2013-10-01185.38NULL
IBM2013-10-02183.97NULL
IBM2013-10-03182.88NULL
IBM2013-10-04183.12NULL
IBM2013-10-07181.04NULL
IBM2013-10-08177.77NULL
IBM2013-10-09180.35NULL
IBM2013-10-10183.78NULL
IBM2013-10-11185.17NULL
IBM2013-10-14185.97NULL
IBM2013-10-15183.67NULL
IBM2013-10-16185.73NULL
IBM2013-10-17173.90NULL
IBM2013-10-18172.85NULL
IBM2013-10-21171.94NULL
IBM2013-10-22174.04NULL
IBM2013-10-23174.83NULL
IBM2013-10-24176.85NULL
IBM2013-10-25175.91NULL
IBM2013-10-28176.40NULL
IBM2013-10-29181.15NULL
IBM2013-10-30179.19NULL
IBM2013-10-31178.25NULL
IBM2013-11-01178.27NULL
IBM2013-11-04179.31NULL
IBM2013-11-05176.90NULL
IBM2013-11-06179.19NULL
IBM2013-11-07180.00NULL
IBM2013-11-08179.99NULL
IBM2013-11-11182.880.259600756641362
IBM2013-11-12183.070.25886435068979
IBM2013-11-13183.550.258084881217436
IBM2013-11-14182.210.25838941695409
IBM2013-11-15183.190.258851361662631
IBM2013-11-18184.470.257272874238383
IBM2013-11-19185.250.25113141270427
IBM2013-11-20185.190.248098166203494
IBM2013-11-21184.130.242810179393185
IBM2013-11-22181.300.245804723406176
IBM2013-11-25178.940.247889849528801
IBM2013-11-26177.310.246782618938391
IBM2013-11-27178.970.24604234701296
IBM2013-11-29179.680.152062274334431
IBM2013-12-02177.480.155660954549234
IBM2013-12-03176.080.156753405261162
IBM2013-12-04175.740.153166929494441
IBM2013-12-05176.080.152731802077581
IBM2013-12-06177.670.151297530686739
IBM2013-12-09177.460.15046658789529
IBM2013-12-10177.120.15040745529138
IBM2013-12-11175.200.131153490377389
IBM2013-12-12173.370.13091290987267
IBM2013-12-13172.800.130493430608268
IBM2013-12-16177.850.15657740328222
IBM2013-12-17175.760.159130504552285
IBM2013-12-18178.700.161891633259364
IBM2013-12-19180.220.159420520640619
IBM2013-12-20180.020.158928812684109
IBM2013-12-23182.230.162812027777703
IBM2013-12-24183.220.156848086287117
IBM2013-12-26185.350.160341722727633
IBM2013-12-27185.080.160289637318093
MSFT2013-09-3033.03NULL
MSFT2013-10-0133.33NULL
MSFT2013-10-0233.66NULL
MSFT2013-10-0333.61NULL
MSFT2013-10-0433.62NULL
MSFT2013-10-0733.05NULL
MSFT2013-10-0832.76NULL
MSFT2013-10-0932.82NULL
MSFT2013-10-1033.51NULL
MSFT2013-10-1133.87NULL
MSFT2013-10-1434.19NULL
MSFT2013-10-1534.23NULL
MSFT2013-10-1634.38NULL
MSFT2013-10-1734.66NULL
MSFT2013-10-1834.70NULL
MSFT2013-10-2134.73NULL
MSFT2013-10-2234.32NULL
MSFT2013-10-2333.51NULL
MSFT2013-10-2433.47NULL
MSFT2013-10-2535.46NULL
MSFT2013-10-2835.30NULL
MSFT2013-10-2935.25NULL
MSFT2013-10-3035.27NULL
MSFT2013-10-3135.14NULL
MSFT2013-11-0135.26NULL
MSFT2013-11-0435.67NULL
MSFT2013-11-0536.36NULL
MSFT2013-11-0637.89NULL
MSFT2013-11-0737.22NULL
MSFT2013-11-0837.50NULL
MSFT2013-11-1137.310.254950380754112
MSFT2013-11-1237.080.256181821008676
MSFT2013-11-1337.870.260609811856037
MSFT2013-11-1437.730.261088903767016
MSFT2013-11-1537.560.262029725657673
MSFT2013-11-1836.920.262089613468521
MSFT2013-11-1936.740.26070530174271
MSFT2013-11-2037.080.261092730265093
MSFT2013-11-2137.400.256650902151733
MSFT2013-11-2237.570.255805679120139
MSFT2013-11-2537.640.255215135927795
MSFT2013-11-2637.350.257129548246975
MSFT2013-11-2737.600.257329564017454
MSFT2013-11-2938.130.258909236195725
MSFT2013-12-0238.450.259260740509458
MSFT2013-12-0338.310.259976144055881
MSFT2013-12-0438.940.25853796720115
MSFT2013-12-0538.000.259063106130924
MSFT2013-12-0638.360.258973608663078
MSFT2013-12-0938.710.204833360753929
MSFT2013-12-1038.110.210778618295736
MSFT2013-12-1137.610.215426672867916
MSFT2013-12-1237.220.218466590217453
MSFT2013-12-1336.690.222925338094543
MSFT2013-12-1636.890.22315833165144
MSFT2013-12-1736.520.223499790309627
MSFT2013-12-1836.580.216646945703847
MSFT2013-12-1936.250.179805278869911
MSFT2013-12-2036.800.179064974608653
MSFT2013-12-2336.620.177929915549888
MSFT2013-12-2437.080.181497152287328
MSFT2013-12-2637.440.182768111571843
MSFT2013-12-2737.290.172163656133405
ORCL2013-09-3033.05NULL
ORCL2013-10-0133.38NULL
ORCL2013-10-0233.56NULL
ORCL2013-10-0333.12NULL
ORCL2013-10-0433.21NULL
ORCL2013-10-0732.84NULL
ORCL2013-10-0832.37NULL
ORCL2013-10-0932.19NULL
ORCL2013-10-1032.99NULL
ORCL2013-10-1133.26NULL
ORCL2013-10-1433.28NULL
ORCL2013-10-1532.75NULL
ORCL2013-10-1633.02NULL
ORCL2013-10-1732.87NULL
ORCL2013-10-1832.90NULL
ORCL2013-10-2132.95NULL
ORCL2013-10-2232.90NULL
ORCL2013-10-2332.70NULL
ORCL2013-10-2433.07NULL
ORCL2013-10-2533.15NULL
ORCL2013-10-2833.14NULL
ORCL2013-10-2933.71NULL
ORCL2013-10-3033.53NULL
ORCL2013-10-3133.50NULL
ORCL2013-11-0133.53NULL
ORCL2013-11-0433.71NULL
ORCL2013-11-0533.50NULL
ORCL2013-11-0634.07NULL
ORCL2013-11-0734.00NULL
ORCL2013-11-0834.35NULL
ORCL2013-11-1134.370.150189552419081
ORCL2013-11-1234.700.150003854614319
ORCL2013-11-1335.000.151056836715572
ORCL2013-11-1434.380.155524872821249
ORCL2013-11-1534.920.160960193098425
ORCL2013-11-1834.930.156351173876592
ORCL2013-11-1934.760.149932066659868
ORCL2013-11-2034.750.148269358199017
ORCL2013-11-2134.940.13321556186422
ORCL2013-11-2234.830.132644327249953
ORCL2013-11-2534.780.132900547285873
ORCL2013-11-2634.930.122245849244905
ORCL2013-11-2735.290.123265455440989
ORCL2013-11-2935.290.121790241831743
ORCL2013-12-0235.080.124115407570261
ORCL2013-12-0335.070.124303653522474
ORCL2013-12-0435.070.123999332335981
ORCL2013-12-0534.850.124113192575353
ORCL2013-12-0635.480.129747978388065
ORCL2013-12-0935.600.129782418776215
ORCL2013-12-1034.800.148701750006502
ORCL2013-12-1134.560.143225579124709
ORCL2013-12-1233.600.165344904639033
ORCL2013-12-1333.230.168462795758679
ORCL2013-12-1633.540.170707200458498
ORCL2013-12-1733.630.170154787941637
ORCL2013-12-1834.600.187985873953149
ORCL2013-12-1936.600.243149504428376
ORCL2013-12-2036.370.244133722672318
ORCL2013-12-2336.930.245997226333116
ORCL2013-12-2437.320.247034049568057
ORCL2013-12-2637.690.247109898714265
ORCL2013-12-2737.980.246930768592208

In this example, we use the same data as in the previous example, except that the data are no longer in 3rd normal form. The closing prices for each of the 5 tickers are now stored in columns with each each date containing a 5 columns, one for each ticker. We can use the @Id variable to calculate the 5 moving volatilities in a single select. Additionally, we will only return the non-null values.

SELECT *
FROM
(
    SELECT tdate,
           wct.MovingVOLATILITY(AAPL, 252, 30, ROW_NUMBER() OVER (ORDER BY tdate)
                     , 0, 'True') as AAPL,
           wct.MovingVOLATILITY(FB, 252, 30, ROW_NUMBER() OVER (ORDER BY tdate), 
                     1, 'True') as FB,
           wct.MovingVOLATILITY(IBM, 252, 30, ROW_NUMBER() OVER (ORDER BY tdate),
                     2, 'True') as IBM,
           wct.MovingVOLATILITY(MSFT, 252, 30, ROW_NUMBER() OVER (ORDER BY tdate)
                     , 3, 'True') as MSFT,
           wct.MovingVOLATILITY(ORCL, 252, 30, ROW_NUMBER() OVER (ORDER BY tdate)
                     , 4, 'True') as ORCL
    FROM
    (
        VALUES
            ('2013-09-30', 473.98, 50.23, 184.19, 33.03, 33.05),
            ('2013-10-01', 485.13, 50.42, 185.38, 33.33, 33.38),
            ('2013-10-02', 486.72, 50.28, 183.97, 33.66, 33.56),
            ('2013-10-03', 480.6, 49.18, 182.88, 33.61, 33.12),
            ('2013-10-04', 480.23, 51.04, 183.12, 33.62, 33.21),
            ('2013-10-07', 484.92, 50.52, 181.04, 33.05, 32.84),
            ('2013-10-08', 478.15, 47.14, 177.77, 32.76, 32.37),
            ('2013-10-09', 483.77, 46.77, 180.35, 32.82, 32.19),
            ('2013-10-10', 486.8, 49.05, 183.78, 33.51, 32.99),
            ('2013-10-11', 489.95, 49.11, 185.17, 33.87, 33.26),
            ('2013-10-14', 493.16, 49.51, 185.97, 34.19, 33.28),
            ('2013-10-15', 495.79, 49.5, 183.67, 34.23, 32.75),
            ('2013-10-16', 498.2, 51.14, 185.73, 34.38, 33.02),
            ('2013-10-17', 501.57, 52.21, 173.9, 34.66, 32.87),
            ('2013-10-18', 505.94, 54.22, 172.85, 34.7, 32.9),
            ('2013-10-21', 518.33, 53.85, 171.94, 34.73, 32.95),
            ('2013-10-22', 516.85, 52.68, 174.04, 34.32, 32.9),
            ('2013-10-23', 521.91, 51.9, 174.83, 33.51, 32.7),
            ('2013-10-24', 528.82, 52.45, 176.85, 33.47, 33.07),
            ('2013-10-25', 522.91, 51.95, 175.91, 35.46, 33.15),
            ('2013-10-28', 526.8, 50.23, 176.4, 35.3, 33.14),
            ('2013-10-29', 513.68, 49.4, 181.15, 35.25, 33.71),
            ('2013-10-30', 521.85, 49.01, 179.19, 35.27, 33.53),
            ('2013-10-31', 519.67, 50.21, 178.25, 35.14, 33.5),
            ('2013-11-01', 517.01, 49.75, 178.27, 35.26, 33.53),
            ('2013-11-04', 523.69, 48.22, 179.31, 35.67, 33.71),
            ('2013-11-05', 522.4, 50.11, 176.9, 36.36, 33.5),
            ('2013-11-06', 520.92, 49.12, 179.19, 37.89, 34.07),
            ('2013-11-07', 512.49, 47.56, 180, 37.22, 34),
            ('2013-11-08', 520.56, 47.53, 179.99, 37.5, 34.35),
            ('2013-11-11', 519.05, 46.2, 182.88, 37.31, 34.37),
            ('2013-11-12', 520.01, 46.61, 183.07, 37.08, 34.7),
            ('2013-11-13', 520.63, 48.71, 183.55, 37.87, 35),
            ('2013-11-14', 528.16, 48.99, 182.21, 37.73, 34.38),
            ('2013-11-15', 524.99, 49.01, 183.19, 37.56, 34.92),
            ('2013-11-18', 518.63, 45.83, 184.47, 36.92, 34.93),
            ('2013-11-19', 519.55, 46.36, 185.25, 36.74, 34.76),
            ('2013-11-20', 515, 46.43, 185.19, 37.08, 34.75),
            ('2013-11-21', 521.14, 46.7, 184.13, 37.4, 34.94),
            ('2013-11-22', 519.8, 46.23, 181.3, 37.57, 34.83),
            ('2013-11-25', 523.74, 44.82, 178.94, 37.64, 34.78),
            ('2013-11-26', 533.4, 45.89, 177.31, 37.35, 34.93),
            ('2013-11-27', 545.96, 46.49, 178.97, 37.6, 35.29),
            ('2013-11-29', 556.07, 47.01, 179.68, 38.13, 35.29),
            ('2013-12-02', 551.23, 47.06, 177.48, 38.45, 35.08),
            ('2013-12-03', 566.32, 46.73, 176.08, 38.31, 35.07),
            ('2013-12-04', 565, 48.62, 175.74, 38.94, 35.07),
            ('2013-12-05', 567.9, 48.34, 176.08, 38, 34.85),
            ('2013-12-06', 560.02, 47.94, 177.67, 38.36, 35.48),
            ('2013-12-09', 566.43, 48.84, 177.46, 38.71, 35.6),
            ('2013-12-10', 565.55, 50.25, 177.12, 38.11, 34.8),
            ('2013-12-11', 561.36, 49.38, 175.2, 37.61, 34.56),
            ('2013-12-12', 560.54, 51.83, 173.37, 37.22, 33.6),
            ('2013-12-13', 554.43, 53.32, 172.8, 36.69, 33.23),
            ('2013-12-16', 557.5, 53.81, 177.85, 36.89, 33.54),
            ('2013-12-17', 554.99, 54.86, 175.76, 36.52, 33.63),
            ('2013-12-18', 550.77, 55.57, 178.7, 36.58, 34.6),
            ('2013-12-19', 544.46, 55.05, 180.22, 36.25, 36.6),
            ('2013-12-20', 549.02, 55.12, 180.02, 36.8, 36.37),
            ('2013-12-23', 570.09, 57.77, 182.23, 36.62, 36.93),
            ('2013-12-24', 567.67, 57.96, 183.22, 37.08, 37.32),
            ('2013-12-26', 563.9, 57.73, 185.35, 37.44, 37.69),
            ('2013-12-27', 560.09, 55.44, 185.08, 37.29, 37.98)
    ) n (tdate, AAPL, FB, IBM, MSFT, ORCL)
) p
WHERE AAPL IS NOT NULL
      AND FB IS NOT NULL
      AND IBM IS NOT NULL
      AND MSFT IS NOT NULL
      AND ORCL IS NOT NULL;

This produces the following result.

tdateAAPLFBIBMMSFTORCL
2013-11-110.1824488985668120.4134083702029520.2596007566413620.2549503807541120.150189552419081
2013-11-120.1720838952547810.4143654010354810.258864350689790.2561818210086760.150003854614319
2013-11-130.1720889225415040.4358949497000450.2580848812174360.2606098118560370.151056836715572
2013-11-140.1695573818677620.4316539349543460.258389416954090.2610889037670160.155524872821249
2013-11-150.1712847938340410.4169876393663830.2588513616626310.2620297256576730.160960193098425
2013-11-180.1755009275559360.4580419153737240.2572728742383830.2620896134685210.156351173876592
2013-11-190.1685859362875610.4146704003997280.251131412704270.260705301742710.149932066659868
2013-11-200.1696195904672460.4141219262024390.2480981662034940.2610927302650930.148269358199017
2013-11-210.171581740552620.3891261466011510.2428101793931850.2566509021517330.13321556186422
2013-11-220.1716658507219730.3897891466879310.2458047234061760.2558056791201390.132644327249953
2013-11-250.1719267578981950.3973535420734730.2478898495288010.2552151359277950.132900547285873
2013-11-260.1780878448247150.4048878182242360.2467826189383910.2571295482469750.122245849244905
2013-11-270.1879872506537750.3939509069648570.246042347012960.2573295640174540.123265455440989
2013-11-290.192912473436860.3898596802097280.1520622743344310.2589092361957250.121790241831743
2013-12-020.1953926583738220.3701059849134410.1556609545492340.2592607405094580.124115407570261
2013-12-030.1982117479498490.3701158585300580.1567534052611620.2599761440558810.124303653522474
2013-12-040.198083602983520.3878341898504610.1531669294944410.258537967201150.123999332335981
2013-12-050.197160957454690.3862280746068560.1527318020775810.2590631061309240.124113192575353
2013-12-060.2004486113725480.3846134677234890.1512975306867390.2589736086630780.129747978388065
2013-12-090.1982630464441970.3890681439125120.150466587895290.2048333607539290.129782418776215
2013-12-100.1981006608189330.3868667288084670.150407455291380.2107786182957360.148701750006502
2013-12-110.1826863109473910.3871743855413230.1311534903773890.2154266728679160.143225579124709
2013-12-120.1789681805719780.4108862542437790.130912909872670.2184665902174530.165344904639033
2013-12-130.1821771691307010.4130175613167820.1304934306082680.2229253380945430.168462795758679
2013-12-160.1810860609388170.4121142182657370.156577403282220.223158331651440.170707200458498
2013-12-170.1794649003212550.401953145738590.1591305045522850.2234997903096270.170154787941637
2013-12-180.1811823966599160.3897195064566510.1618916332593640.2166469457038470.187985873953149
2013-12-190.1848110756665580.3853892462153780.1594205206406190.1798052788699110.243149504428376
2013-12-200.1778739579203410.3700631333686060.1589288126841090.1790649746086530.244133722672318
2013-12-230.2020451926175580.3890768003088920.1628120277777030.1779299155498880.245997226333116
2013-12-240.2024269884702110.3749739975533090.1568480862871170.1814971522873280.247034049568057
2013-12-260.2043363397084990.3764306956104670.1603417227276330.1827681115718430.247109898714265
2013-12-270.2061459403898230.3840168120798290.1602896373180930.1721636561334050.246930768592208