RunningVOLATILITY
Updated 2023-11-14 15:47:50.397000
Syntax
SELECT [westclintech].[wct].[RunningVOLATILITY](
<@Price, float,>
,<@Scale, float,>
,<@RowNum, int,>
,<@Id, tinyint,>)
Description
Use the scalar function RunningVOLATILITY 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 set to the last value in the set. 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.
Arguments
@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.
@Id
a unique identifier for the RunningVOLATILITY 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.
@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.
@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.
Return Type
float
Remarks
If @Id is NULL then @Id = 0.
To calculate the moving volatility over a window in a dataset or partition, use the MovingVOLATILITY function.
If @RowNum is equal to 1, RunningVOLATILITY 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 running volatility from the 2013-09-30 to 2013-12-27.
SELECT ticker,
tdate,
CAST(price as money) as price,
wct.RunningVOLATILITY( price, --@Price
252, --@Scale
ROW_NUMBER() OVER (ORDER BY tdate), --@RowNum
NULL --@Id
) 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.
{"columns":[{"field":"ticker"},{"field":"tdate","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"price","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"VOL"}],"rows":[{"ticker":"IBM","tdate":"2013-09-30","price":"184.19","VOL":"NULL"},{"ticker":"IBM","tdate":"2013-10-01","price":"185.38","VOL":"NULL"},{"ticker":"IBM","tdate":"2013-10-02","price":"183.97","VOL":"0.157991601318105"},{"ticker":"IBM","tdate":"2013-10-03","price":"182.88","VOL":"0.121985295333914"},{"ticker":"IBM","tdate":"2013-10-04","price":"183.12","VOL":"0.103819114248728"},{"ticker":"IBM","tdate":"2013-10-07","price":"181.04","VOL":"0.1144147399885"},{"ticker":"IBM","tdate":"2013-10-08","price":"177.77","VOL":"0.1401579805873"},{"ticker":"IBM","tdate":"2013-10-09","price":"180.35","VOL":"0.1767404717407"},{"ticker":"IBM","tdate":"2013-10-10","price":"183.78","VOL":"0.204482795103378"},{"ticker":"IBM","tdate":"2013-10-11","price":"185.17","VOL":"0.195693582420282"},{"ticker":"IBM","tdate":"2013-10-14","price":"185.97","VOL":"0.185445051011276"},{"ticker":"IBM","tdate":"2013-10-15","price":"183.67","VOL":"0.187265588559365"},{"ticker":"IBM","tdate":"2013-10-16","price":"185.73","VOL":"0.186049678915767"},{"ticker":"IBM","tdate":"2013-10-17","price":"173.90","VOL":"0.342742937950233"},{"ticker":"IBM","tdate":"2013-10-18","price":"172.85","VOL":"0.329369740776868"},{"ticker":"IBM","tdate":"2013-10-21","price":"171.94","VOL":"0.317403106677901"},{"ticker":"IBM","tdate":"2013-10-22","price":"174.04","VOL":"0.313744375771333"},{"ticker":"IBM","tdate":"2013-10-23","price":"174.83","VOL":"0.30536711027807"},{"ticker":"IBM","tdate":"2013-10-24","price":"176.85","VOL":"0.301214200365808"},{"ticker":"IBM","tdate":"2013-10-25","price":"175.91","VOL":"0.292941050832951"},{"ticker":"IBM","tdate":"2013-10-28","price":"176.40","VOL":"0.285725276959642"},{"ticker":"IBM","tdate":"2013-10-29","price":"181.15","VOL":"0.295741935323325"},{"ticker":"IBM","tdate":"2013-10-30","price":"179.19","VOL":"0.29062633554224"},{"ticker":"IBM","tdate":"2013-10-31","price":"178.25","VOL":"0.284254243424246"},{"ticker":"IBM","tdate":"2013-11-01","price":"178.27","VOL":"0.278050768878414"},{"ticker":"IBM","tdate":"2013-11-04","price":"179.31","VOL":"0.273148784591888"},{"ticker":"IBM","tdate":"2013-11-05","price":"176.90","VOL":"0.27042556572641"},{"ticker":"IBM","tdate":"2013-11-06","price":"179.19","VOL":"0.268806191182128"},{"ticker":"IBM","tdate":"2013-11-07","price":"180.00","VOL":"0.264302413631107"},{"ticker":"IBM","tdate":"2013-11-08","price":"179.99","VOL":"0.259549647060813"},{"ticker":"IBM","tdate":"2013-11-11","price":"182.88","VOL":"0.259600756641362"},{"ticker":"IBM","tdate":"2013-11-12","price":"183.07","VOL":"0.255263347230854"},{"ticker":"IBM","tdate":"2013-11-13","price":"183.55","VOL":"0.251236693474519"},{"ticker":"IBM","tdate":"2013-11-14","price":"182.21","VOL":"0.248083217211755"},{"ticker":"IBM","tdate":"2013-11-15","price":"183.19","VOL":"0.2447863673686"},{"ticker":"IBM","tdate":"2013-11-18","price":"184.47","VOL":"0.241915934806432"},{"ticker":"IBM","tdate":"2013-11-19","price":"185.25","VOL":"0.238690800797804"},{"ticker":"IBM","tdate":"2013-11-20","price":"185.19","VOL":"0.235355683781686"},{"ticker":"IBM","tdate":"2013-11-21","price":"184.13","VOL":"0.232647822225072"},{"ticker":"IBM","tdate":"2013-11-22","price":"181.30","VOL":"0.232914395369242"},{"ticker":"IBM","tdate":"2013-11-25","price":"178.94","VOL":"0.232107235776856"},{"ticker":"IBM","tdate":"2013-11-26","price":"177.31","VOL":"0.230138018432581"},{"ticker":"IBM","tdate":"2013-11-27","price":"178.97","VOL":"0.228695714503832"},{"ticker":"IBM","tdate":"2013-11-29","price":"179.68","VOL":"0.226236229264604"},{"ticker":"IBM","tdate":"2013-12-02","price":"177.48","VOL":"0.225349326156618"},{"ticker":"IBM","tdate":"2013-12-03","price":"176.08","VOL":"0.223402266012121"},{"ticker":"IBM","tdate":"2013-12-04","price":"175.74","VOL":"0.220916846781547"},{"ticker":"IBM","tdate":"2013-12-05","price":"176.08","VOL":"0.218609398878077"},{"ticker":"IBM","tdate":"2013-12-06","price":"177.67","VOL":"0.217468996906325"},{"ticker":"IBM","tdate":"2013-12-09","price":"177.46","VOL":"0.215194000212408"},{"ticker":"IBM","tdate":"2013-12-10","price":"177.12","VOL":"0.213002692451954"},{"ticker":"IBM","tdate":"2013-12-11","price":"175.20","VOL":"0.21205763372289"},{"ticker":"IBM","tdate":"2013-12-12","price":"173.37","VOL":"0.211011420807653"},{"ticker":"IBM","tdate":"2013-12-13","price":"172.80","VOL":"0.209024171994707"},{"ticker":"IBM","tdate":"2013-12-16","price":"177.85","VOL":"0.216955191401418"},{"ticker":"IBM","tdate":"2013-12-17","price":"175.76","VOL":"0.216263294117974"},{"ticker":"IBM","tdate":"2013-12-18","price":"178.70","VOL":"0.217458654239988"},{"ticker":"IBM","tdate":"2013-12-19","price":"180.22","VOL":"0.216339442752101"},{"ticker":"IBM","tdate":"2013-12-20","price":"180.02","VOL":"0.214438701845782"},{"ticker":"IBM","tdate":"2013-12-23","price":"182.23","VOL":"0.214170134187367"},{"ticker":"IBM","tdate":"2013-12-24","price":"183.22","VOL":"0.212657208109115"},{"ticker":"IBM","tdate":"2013-12-26","price":"185.35","VOL":"0.212202038649472"},{"ticker":"IBM","tdate":"2013-12-27","price":"185.08","VOL":"0.21047900944155"}]}
In this example, we calculate the running volatility for multiple securities.
SELECT ticker,
tdate,
CAST(price as money) as price,
wct.RunningVOLATILITY( price,
--@Price
252,
--@Scale
ROW_NUMBER() OVER (PARTITION BY ticker ORDER BY
ticker, tdate), --@RowNum
NULL
--@Id
) 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.
{"columns":[{"field":"ticker"},{"field":"tdate","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"price","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"VOL"}],"rows":[{"ticker":"AAPL","tdate":"2013-09-30","price":"473.98","VOL":"NULL"},{"ticker":"AAPL","tdate":"2013-10-01","price":"485.13","VOL":"NULL"},{"ticker":"AAPL","tdate":"2013-10-02","price":"486.72","VOL":"0.224271090600065"},{"ticker":"AAPL","tdate":"2013-10-03","price":"480.60","VOL":"0.285595548859782"},{"ticker":"AAPL","tdate":"2013-10-04","price":"480.23","VOL":"0.237084900781644"},{"ticker":"AAPL","tdate":"2013-10-07","price":"484.92","VOL":"0.210356013380844"},{"ticker":"AAPL","tdate":"2013-10-08","price":"478.15","VOL":"0.223531451606084"},{"ticker":"AAPL","tdate":"2013-10-09","price":"483.77","VOL":"0.213078771862708"},{"ticker":"AAPL","tdate":"2013-10-10","price":"486.80","VOL":"0.198152326707184"},{"ticker":"AAPL","tdate":"2013-10-11","price":"489.95","VOL":"0.186085489735147"},{"ticker":"AAPL","tdate":"2013-10-14","price":"493.16","VOL":"0.176024763494547"},{"ticker":"AAPL","tdate":"2013-10-15","price":"495.79","VOL":"0.167117075670665"},{"ticker":"AAPL","tdate":"2013-10-16","price":"498.20","VOL":"0.159377876724916"},{"ticker":"AAPL","tdate":"2013-10-17","price":"501.57","VOL":"0.153017708043086"},{"ticker":"AAPL","tdate":"2013-10-18","price":"505.94","VOL":"0.148154178443564"},{"ticker":"AAPL","tdate":"2013-10-21","price":"518.33","VOL":"0.163681793295629"},{"ticker":"AAPL","tdate":"2013-10-22","price":"516.85","VOL":"0.161961570226251"},{"ticker":"AAPL","tdate":"2013-10-23","price":"521.91","VOL":"0.157702562105636"},{"ticker":"AAPL","tdate":"2013-10-24","price":"528.82","VOL":"0.155537178833955"},{"ticker":"AAPL","tdate":"2013-10-25","price":"522.91","VOL":"0.163789677373325"},{"ticker":"AAPL","tdate":"2013-10-28","price":"526.80","VOL":"0.159619478834349"},{"ticker":"AAPL","tdate":"2013-10-29","price":"513.68","VOL":"0.188068722816282"},{"ticker":"AAPL","tdate":"2013-10-30","price":"521.85","VOL":"0.187939213793648"},{"ticker":"AAPL","tdate":"2013-10-31","price":"519.67","VOL":"0.185791257925522"},{"ticker":"AAPL","tdate":"2013-11-01","price":"517.01","VOL":"0.184101659389185"},{"ticker":"AAPL","tdate":"2013-11-04","price":"523.69","VOL":"0.18258564582163"},{"ticker":"AAPL","tdate":"2013-11-05","price":"522.40","VOL":"0.180022101389953"},{"ticker":"AAPL","tdate":"2013-11-06","price":"520.92","VOL":"0.177666471057637"},{"ticker":"AAPL","tdate":"2013-11-07","price":"512.49","VOL":"0.184198773746174"},{"ticker":"AAPL","tdate":"2013-11-08","price":"520.56","VOL":"0.184793776282328"},{"ticker":"AAPL","tdate":"2013-11-11","price":"519.05","VOL":"0.182448898566812"},{"ticker":"AAPL","tdate":"2013-11-12","price":"520.01","VOL":"0.179413859536272"},{"ticker":"AAPL","tdate":"2013-11-13","price":"520.63","VOL":"0.176568489038223"},{"ticker":"AAPL","tdate":"2013-11-14","price":"528.16","VOL":"0.176632767341278"},{"ticker":"AAPL","tdate":"2013-11-15","price":"524.99","VOL":"0.175768975036049"},{"ticker":"AAPL","tdate":"2013-11-18","price":"518.63","VOL":"0.177900006327752"},{"ticker":"AAPL","tdate":"2013-11-19","price":"519.55","VOL":"0.175352929726722"},{"ticker":"AAPL","tdate":"2013-11-20","price":"515.00","VOL":"0.175417509647309"},{"ticker":"AAPL","tdate":"2013-11-21","price":"521.14","VOL":"0.174791013713095"},{"ticker":"AAPL","tdate":"2013-11-22","price":"519.80","VOL":"0.172956766676484"},{"ticker":"AAPL","tdate":"2013-11-25","price":"523.74","VOL":"0.17122031232006"},{"ticker":"AAPL","tdate":"2013-11-26","price":"533.40","VOL":"0.173534056442168"},{"ticker":"AAPL","tdate":"2013-11-27","price":"545.96","VOL":"0.178535535312193"},{"ticker":"AAPL","tdate":"2013-11-29","price":"556.07","VOL":"0.180087476749503"},{"ticker":"AAPL","tdate":"2013-12-02","price":"551.23","VOL":"0.180460442787382"},{"ticker":"AAPL","tdate":"2013-12-03","price":"566.32","VOL":"0.186918087070296"},{"ticker":"AAPL","tdate":"2013-12-04","price":"565.00","VOL":"0.185414766083349"},{"ticker":"AAPL","tdate":"2013-12-05","price":"567.90","VOL":"0.183413052330087"},{"ticker":"AAPL","tdate":"2013-12-06","price":"560.02","VOL":"0.185988179879154"},{"ticker":"AAPL","tdate":"2013-12-09","price":"566.43","VOL":"0.184911834132172"},{"ticker":"AAPL","tdate":"2013-12-10","price":"565.55","VOL":"0.18338595456892"},{"ticker":"AAPL","tdate":"2013-12-11","price":"561.36","VOL":"0.18317290765486"},{"ticker":"AAPL","tdate":"2013-12-12","price":"560.54","VOL":"0.18167312583229"},{"ticker":"AAPL","tdate":"2013-12-13","price":"554.43","VOL":"0.182557458425315"},{"ticker":"AAPL","tdate":"2013-12-16","price":"557.50","VOL":"0.180911821574914"},{"ticker":"AAPL","tdate":"2013-12-17","price":"554.99","VOL":"0.179949862331222"},{"ticker":"AAPL","tdate":"2013-12-18","price":"550.77","VOL":"0.17969270355442"},{"ticker":"AAPL","tdate":"2013-12-19","price":"544.46","VOL":"0.180568123604884"},{"ticker":"AAPL","tdate":"2013-12-20","price":"549.02","VOL":"0.179400394730715"},{"ticker":"AAPL","tdate":"2013-12-23","price":"570.09","VOL":"0.192092068662242"},{"ticker":"AAPL","tdate":"2013-12-24","price":"567.67","VOL":"0.191057332118658"},{"ticker":"AAPL","tdate":"2013-12-26","price":"563.90","VOL":"0.190475164684819"},{"ticker":"AAPL","tdate":"2013-12-27","price":"560.09","VOL":"0.189901899033866"},{"ticker":"FB","tdate":"2013-09-30","price":"50.23","VOL":"NULL"},{"ticker":"FB","tdate":"2013-10-01","price":"50.42","VOL":"NULL"},{"ticker":"FB","tdate":"2013-10-02","price":"50.28","VOL":"0.0735909403320345"},{"ticker":"FB","tdate":"2013-10-03","price":"49.18","VOL":"0.21372716386867"},{"ticker":"FB","tdate":"2013-10-04","price":"51.04","VOL":"0.391578925365895"},{"ticker":"FB","tdate":"2013-10-07","price":"50.52","VOL":"0.353864396216867"},{"ticker":"FB","tdate":"2013-10-08","price":"47.14","VOL":"0.555272404098915"},{"ticker":"FB","tdate":"2013-10-09","price":"46.77","VOL":"0.507151192773698"},{"ticker":"FB","tdate":"2013-10-10","price":"49.05","VOL":"0.570678322191235"},{"ticker":"FB","tdate":"2013-10-11","price":"49.11","VOL":"0.534281803337772"},{"ticker":"FB","tdate":"2013-10-14","price":"49.51","VOL":"0.506537694162177"},{"ticker":"FB","tdate":"2013-10-15","price":"49.50","VOL":"0.480580605322842"},{"ticker":"FB","tdate":"2013-10-16","price":"51.14","VOL":"0.483870696606763"},{"ticker":"FB","tdate":"2013-10-17","price":"52.21","VOL":"0.470928852008138"},{"ticker":"FB","tdate":"2013-10-18","price":"54.22","VOL":"0.475936400052069"},{"ticker":"FB","tdate":"2013-10-21","price":"53.85","VOL":"0.461389696597704"},{"ticker":"FB","tdate":"2013-10-22","price":"52.68","VOL":"0.458080123607665"},{"ticker":"FB","tdate":"2013-10-23","price":"51.90","VOL":"0.448852700952121"},{"ticker":"FB","tdate":"2013-10-24","price":"52.45","VOL":"0.436643260698796"},{"ticker":"FB","tdate":"2013-10-25","price":"51.95","VOL":"0.426578483320681"},{"ticker":"FB","tdate":"2013-10-28","price":"50.23","VOL":"0.433841652776117"},{"ticker":"FB","tdate":"2013-10-29","price":"49.40","VOL":"0.426777613108773"},{"ticker":"FB","tdate":"2013-10-30","price":"49.01","VOL":"0.417191302857349"},{"ticker":"FB","tdate":"2013-10-31","price":"50.21","VOL":"0.416118490473473"},{"ticker":"FB","tdate":"2013-11-01","price":"49.75","VOL":"0.40805911065836"},{"ticker":"FB","tdate":"2013-11-04","price":"48.22","VOL":"0.411289680407328"},{"ticker":"FB","tdate":"2013-11-05","price":"50.11","VOL":"0.421856397340002"},{"ticker":"FB","tdate":"2013-11-06","price":"49.12","VOL":"0.418091141033746"},{"ticker":"FB","tdate":"2013-11-07","price":"47.56","VOL":"0.420982309480531"},{"ticker":"FB","tdate":"2013-11-08","price":"47.53","VOL":"0.413414726634288"},{"ticker":"FB","tdate":"2013-11-11","price":"46.20","VOL":"0.413408370202952"},{"ticker":"FB","tdate":"2013-11-12","price":"46.61","VOL":"0.407808527594948"},{"ticker":"FB","tdate":"2013-11-13","price":"48.71","VOL":"0.421850218058507"},{"ticker":"FB","tdate":"2013-11-14","price":"48.99","VOL":"0.415618117817277"},{"ticker":"FB","tdate":"2013-11-15","price":"49.01","VOL":"0.409284732830668"},{"ticker":"FB","tdate":"2013-11-18","price":"45.83","VOL":"0.440789708660948"},{"ticker":"FB","tdate":"2013-11-19","price":"46.36","VOL":"0.436049727901166"},{"ticker":"FB","tdate":"2013-11-20","price":"46.43","VOL":"0.430061359858497"},{"ticker":"FB","tdate":"2013-11-21","price":"46.70","VOL":"0.424700478381667"},{"ticker":"FB","tdate":"2013-11-22","price":"46.23","VOL":"0.419592812289521"},{"ticker":"FB","tdate":"2013-11-25","price":"44.82","VOL":"0.420459563671933"},{"ticker":"FB","tdate":"2013-11-26","price":"45.89","VOL":"0.420314036577719"},{"ticker":"FB","tdate":"2013-11-27","price":"46.49","VOL":"0.416821504492747"},{"ticker":"FB","tdate":"2013-11-29","price":"47.01","VOL":"0.413023783761765"},{"ticker":"FB","tdate":"2013-12-02","price":"47.06","VOL":"0.408240489554877"},{"ticker":"FB","tdate":"2013-12-03","price":"46.73","VOL":"0.403788802021793"},{"ticker":"FB","tdate":"2013-12-04","price":"48.62","VOL":"0.410786334412208"},{"ticker":"FB","tdate":"2013-12-05","price":"48.34","VOL":"0.406466128989073"},{"ticker":"FB","tdate":"2013-12-06","price":"47.94","VOL":"0.402485128343155"},{"ticker":"FB","tdate":"2013-12-09","price":"48.84","VOL":"0.400736005841239"},{"ticker":"FB","tdate":"2013-12-10","price":"50.25","VOL":"0.401945870464066"},{"ticker":"FB","tdate":"2013-12-11","price":"49.38","VOL":"0.399797257238259"},{"ticker":"FB","tdate":"2013-12-12","price":"51.83","VOL":"0.410152262710804"},{"ticker":"FB","tdate":"2013-12-13","price":"53.32","VOL":"0.410668241058772"},{"ticker":"FB","tdate":"2013-12-16","price":"53.81","VOL":"0.407144480328883"},{"ticker":"FB","tdate":"2013-12-17","price":"54.86","VOL":"0.405203257279515"},{"ticker":"FB","tdate":"2013-12-18","price":"55.57","VOL":"0.402212057196699"},{"ticker":"FB","tdate":"2013-12-19","price":"55.05","VOL":"0.399300456156596"},{"ticker":"FB","tdate":"2013-12-20","price":"55.12","VOL":"0.395782944403901"},{"ticker":"FB","tdate":"2013-12-23","price":"57.77","VOL":"0.403397610908762"},{"ticker":"FB","tdate":"2013-12-24","price":"57.96","VOL":"0.399968754375222"},{"ticker":"FB","tdate":"2013-12-26","price":"57.73","VOL":"0.396832399932739"},{"ticker":"FB","tdate":"2013-12-27","price":"55.44","VOL":"0.402895731629006"},{"ticker":"IBM","tdate":"2013-09-30","price":"184.19","VOL":"NULL"},{"ticker":"IBM","tdate":"2013-10-01","price":"185.38","VOL":"NULL"},{"ticker":"IBM","tdate":"2013-10-02","price":"183.97","VOL":"0.157991601318105"},{"ticker":"IBM","tdate":"2013-10-03","price":"182.88","VOL":"0.121985295333914"},{"ticker":"IBM","tdate":"2013-10-04","price":"183.12","VOL":"0.103819114248728"},{"ticker":"IBM","tdate":"2013-10-07","price":"181.04","VOL":"0.1144147399885"},{"ticker":"IBM","tdate":"2013-10-08","price":"177.77","VOL":"0.1401579805873"},{"ticker":"IBM","tdate":"2013-10-09","price":"180.35","VOL":"0.1767404717407"},{"ticker":"IBM","tdate":"2013-10-10","price":"183.78","VOL":"0.204482795103378"},{"ticker":"IBM","tdate":"2013-10-11","price":"185.17","VOL":"0.195693582420282"},{"ticker":"IBM","tdate":"2013-10-14","price":"185.97","VOL":"0.185445051011276"},{"ticker":"IBM","tdate":"2013-10-15","price":"183.67","VOL":"0.187265588559365"},{"ticker":"IBM","tdate":"2013-10-16","price":"185.73","VOL":"0.186049678915767"},{"ticker":"IBM","tdate":"2013-10-17","price":"173.90","VOL":"0.342742937950233"},{"ticker":"IBM","tdate":"2013-10-18","price":"172.85","VOL":"0.329369740776868"},{"ticker":"IBM","tdate":"2013-10-21","price":"171.94","VOL":"0.317403106677901"},{"ticker":"IBM","tdate":"2013-10-22","price":"174.04","VOL":"0.313744375771333"},{"ticker":"IBM","tdate":"2013-10-23","price":"174.83","VOL":"0.30536711027807"},{"ticker":"IBM","tdate":"2013-10-24","price":"176.85","VOL":"0.301214200365808"},{"ticker":"IBM","tdate":"2013-10-25","price":"175.91","VOL":"0.292941050832951"},{"ticker":"IBM","tdate":"2013-10-28","price":"176.40","VOL":"0.285725276959642"},{"ticker":"IBM","tdate":"2013-10-29","price":"181.15","VOL":"0.295741935323325"},{"ticker":"IBM","tdate":"2013-10-30","price":"179.19","VOL":"0.29062633554224"},{"ticker":"IBM","tdate":"2013-10-31","price":"178.25","VOL":"0.284254243424246"},{"ticker":"IBM","tdate":"2013-11-01","price":"178.27","VOL":"0.278050768878414"},{"ticker":"IBM","tdate":"2013-11-04","price":"179.31","VOL":"0.273148784591888"},{"ticker":"IBM","tdate":"2013-11-05","price":"176.90","VOL":"0.27042556572641"},{"ticker":"IBM","tdate":"2013-11-06","price":"179.19","VOL":"0.268806191182128"},{"ticker":"IBM","tdate":"2013-11-07","price":"180.00","VOL":"0.264302413631107"},{"ticker":"IBM","tdate":"2013-11-08","price":"179.99","VOL":"0.259549647060813"},{"ticker":"IBM","tdate":"2013-11-11","price":"182.88","VOL":"0.259600756641362"},{"ticker":"IBM","tdate":"2013-11-12","price":"183.07","VOL":"0.255263347230854"},{"ticker":"IBM","tdate":"2013-11-13","price":"183.55","VOL":"0.251236693474519"},{"ticker":"IBM","tdate":"2013-11-14","price":"182.21","VOL":"0.248083217211755"},{"ticker":"IBM","tdate":"2013-11-15","price":"183.19","VOL":"0.2447863673686"},{"ticker":"IBM","tdate":"2013-11-18","price":"184.47","VOL":"0.241915934806432"},{"ticker":"IBM","tdate":"2013-11-19","price":"185.25","VOL":"0.238690800797804"},{"ticker":"IBM","tdate":"2013-11-20","price":"185.19","VOL":"0.235355683781686"},{"ticker":"IBM","tdate":"2013-11-21","price":"184.13","VOL":"0.232647822225072"},{"ticker":"IBM","tdate":"2013-11-22","price":"181.30","VOL":"0.232914395369242"},{"ticker":"IBM","tdate":"2013-11-25","price":"178.94","VOL":"0.232107235776856"},{"ticker":"IBM","tdate":"2013-11-26","price":"177.31","VOL":"0.230138018432581"},{"ticker":"IBM","tdate":"2013-11-27","price":"178.97","VOL":"0.228695714503832"},{"ticker":"IBM","tdate":"2013-11-29","price":"179.68","VOL":"0.226236229264604"},{"ticker":"IBM","tdate":"2013-12-02","price":"177.48","VOL":"0.225349326156618"},{"ticker":"IBM","tdate":"2013-12-03","price":"176.08","VOL":"0.223402266012121"},{"ticker":"IBM","tdate":"2013-12-04","price":"175.74","VOL":"0.220916846781547"},{"ticker":"IBM","tdate":"2013-12-05","price":"176.08","VOL":"0.218609398878077"},{"ticker":"IBM","tdate":"2013-12-06","price":"177.67","VOL":"0.217468996906325"},{"ticker":"IBM","tdate":"2013-12-09","price":"177.46","VOL":"0.215194000212408"},{"ticker":"IBM","tdate":"2013-12-10","price":"177.12","VOL":"0.213002692451954"},{"ticker":"IBM","tdate":"2013-12-11","price":"175.20","VOL":"0.21205763372289"},{"ticker":"IBM","tdate":"2013-12-12","price":"173.37","VOL":"0.211011420807653"},{"ticker":"IBM","tdate":"2013-12-13","price":"172.80","VOL":"0.209024171994707"},{"ticker":"IBM","tdate":"2013-12-16","price":"177.85","VOL":"0.216955191401418"},{"ticker":"IBM","tdate":"2013-12-17","price":"175.76","VOL":"0.216263294117974"},{"ticker":"IBM","tdate":"2013-12-18","price":"178.70","VOL":"0.217458654239988"},{"ticker":"IBM","tdate":"2013-12-19","price":"180.22","VOL":"0.216339442752101"},{"ticker":"IBM","tdate":"2013-12-20","price":"180.02","VOL":"0.214438701845782"},{"ticker":"IBM","tdate":"2013-12-23","price":"182.23","VOL":"0.214170134187367"},{"ticker":"IBM","tdate":"2013-12-24","price":"183.22","VOL":"0.212657208109115"},{"ticker":"IBM","tdate":"2013-12-26","price":"185.35","VOL":"0.212202038649472"},{"ticker":"IBM","tdate":"2013-12-27","price":"185.08","VOL":"0.21047900944155"},{"ticker":"MSFT","tdate":"2013-09-30","price":"33.03","VOL":"NULL"},{"ticker":"MSFT","tdate":"2013-10-01","price":"33.33","VOL":"NULL"},{"ticker":"MSFT","tdate":"2013-10-02","price":"33.66","VOL":"0.00909945101198763"},{"ticker":"MSFT","tdate":"2013-10-03","price":"33.61","VOL":"0.100413740807231"},{"ticker":"MSFT","tdate":"2013-10-04","price":"33.62","VOL":"0.0929039814232559"},{"ticker":"MSFT","tdate":"2013-10-07","price":"33.05","VOL":"0.172704008464697"},{"ticker":"MSFT","tdate":"2013-10-08","price":"32.76","VOL":"0.16496637923671"},{"ticker":"MSFT","tdate":"2013-10-09","price":"32.82","VOL":"0.151810388040649"},{"ticker":"MSFT","tdate":"2013-10-10","price":"33.51","VOL":"0.186038465405536"},{"ticker":"MSFT","tdate":"2013-10-11","price":"33.87","VOL":"0.180258404799758"},{"ticker":"MSFT","tdate":"2013-10-14","price":"34.19","VOL":"0.173161316297753"},{"ticker":"MSFT","tdate":"2013-10-15","price":"34.23","VOL":"0.164638099338941"},{"ticker":"MSFT","tdate":"2013-10-16","price":"34.38","VOL":"0.157061406259348"},{"ticker":"MSFT","tdate":"2013-10-17","price":"34.66","VOL":"0.151836148905988"},{"ticker":"MSFT","tdate":"2013-10-18","price":"34.70","VOL":"0.146280696627879"},{"ticker":"MSFT","tdate":"2013-10-21","price":"34.73","VOL":"0.141380283329524"},{"ticker":"MSFT","tdate":"2013-10-22","price":"34.32","VOL":"0.149348503047182"},{"ticker":"MSFT","tdate":"2013-10-23","price":"33.51","VOL":"0.17648721369219"},{"ticker":"MSFT","tdate":"2013-10-24","price":"33.47","VOL":"0.171388315917496"},{"ticker":"MSFT","tdate":"2013-10-25","price":"35.46","VOL":"0.266205233746523"},{"ticker":"MSFT","tdate":"2013-10-28","price":"35.30","VOL":"0.260758230410505"},{"ticker":"MSFT","tdate":"2013-10-29","price":"35.25","VOL":"0.254685710035094"},{"ticker":"MSFT","tdate":"2013-10-30","price":"35.27","VOL":"0.248695297981262"},{"ticker":"MSFT","tdate":"2013-10-31","price":"35.14","VOL":"0.243979969242079"},{"ticker":"MSFT","tdate":"2013-11-01","price":"35.26","VOL":"0.238628420047195"},{"ticker":"MSFT","tdate":"2013-11-04","price":"35.67","VOL":"0.235283525148774"},{"ticker":"MSFT","tdate":"2013-11-05","price":"36.36","VOL":"0.235905078374151"},{"ticker":"MSFT","tdate":"2013-11-06","price":"37.89","VOL":"0.258171079125072"},{"ticker":"MSFT","tdate":"2013-11-07","price":"37.22","VOL":"0.262514261741813"},{"ticker":"MSFT","tdate":"2013-11-08","price":"37.50","VOL":"0.257959595816974"},{"ticker":"MSFT","tdate":"2013-11-11","price":"37.31","VOL":"0.254950380754112"},{"ticker":"MSFT","tdate":"2013-11-12","price":"37.08","VOL":"0.252361424843963"},{"ticker":"MSFT","tdate":"2013-11-13","price":"37.87","VOL":"0.25298730614803"},{"ticker":"MSFT","tdate":"2013-11-14","price":"37.73","VOL":"0.249976816419"},{"ticker":"MSFT","tdate":"2013-11-15","price":"37.56","VOL":"0.247257570736894"},{"ticker":"MSFT","tdate":"2013-11-18","price":"36.92","VOL":"0.250006421033669"},{"ticker":"MSFT","tdate":"2013-11-19","price":"36.74","VOL":"0.247331957441656"},{"ticker":"MSFT","tdate":"2013-11-20","price":"37.08","VOL":"0.24441827639571"},{"ticker":"MSFT","tdate":"2013-11-21","price":"37.40","VOL":"0.241503405501464"},{"ticker":"MSFT","tdate":"2013-11-22","price":"37.57","VOL":"0.238326247744306"},{"ticker":"MSFT","tdate":"2013-11-25","price":"37.64","VOL":"0.235278737797096"},{"ticker":"MSFT","tdate":"2013-11-26","price":"37.35","VOL":"0.233914475011621"},{"ticker":"MSFT","tdate":"2013-11-27","price":"37.60","VOL":"0.231219373329762"},{"ticker":"MSFT","tdate":"2013-11-29","price":"38.13","VOL":"0.229972362005404"},{"ticker":"MSFT","tdate":"2013-12-02","price":"38.45","VOL":"0.227599588301816"},{"ticker":"MSFT","tdate":"2013-12-03","price":"38.31","VOL":"0.225624993419381"},{"ticker":"MSFT","tdate":"2013-12-04","price":"38.94","VOL":"0.225174218939492"},{"ticker":"MSFT","tdate":"2013-12-05","price":"38.00","VOL":"0.231967729440119"},{"ticker":"MSFT","tdate":"2013-12-06","price":"38.36","VOL":"0.229961622354126"},{"ticker":"MSFT","tdate":"2013-12-09","price":"38.71","VOL":"0.227955449372869"},{"ticker":"MSFT","tdate":"2013-12-10","price":"38.11","VOL":"0.229555795763475"},{"ticker":"MSFT","tdate":"2013-12-11","price":"37.61","VOL":"0.230038376124558"},{"ticker":"MSFT","tdate":"2013-12-12","price":"37.22","VOL":"0.229554485482657"},{"ticker":"MSFT","tdate":"2013-12-13","price":"36.69","VOL":"0.230213432071093"},{"ticker":"MSFT","tdate":"2013-12-16","price":"36.89","VOL":"0.228153270737405"},{"ticker":"MSFT","tdate":"2013-12-17","price":"36.52","VOL":"0.227516586364405"},{"ticker":"MSFT","tdate":"2013-12-18","price":"36.58","VOL":"0.225439106141073"},{"ticker":"MSFT","tdate":"2013-12-19","price":"36.25","VOL":"0.224586468963242"},{"ticker":"MSFT","tdate":"2013-12-20","price":"36.80","VOL":"0.224360044116301"},{"ticker":"MSFT","tdate":"2013-12-23","price":"36.62","VOL":"0.222856719616219"},{"ticker":"MSFT","tdate":"2013-12-24","price":"37.08","VOL":"0.222052453655894"},{"ticker":"MSFT","tdate":"2013-12-26","price":"37.44","VOL":"0.220754663739106"},{"ticker":"MSFT","tdate":"2013-12-27","price":"37.29","VOL":"0.219279343527289"},{"ticker":"ORCL","tdate":"2013-09-30","price":"33.05","VOL":"NULL"},{"ticker":"ORCL","tdate":"2013-10-01","price":"33.38","VOL":"NULL"},{"ticker":"ORCL","tdate":"2013-10-02","price":"33.56","VOL":"0.0511565598296228"},{"ticker":"ORCL","tdate":"2013-10-03","price":"33.12","VOL":"0.194524893385894"},{"ticker":"ORCL","tdate":"2013-10-04","price":"33.21","VOL":"0.15962693079071"},{"ticker":"ORCL","tdate":"2013-10-07","price":"32.84","VOL":"0.163932835979515"},{"ticker":"ORCL","tdate":"2013-10-08","price":"32.37","VOL":"0.169562026007422"},{"ticker":"ORCL","tdate":"2013-10-09","price":"32.19","VOL":"0.155305745732859"},{"ticker":"ORCL","tdate":"2013-10-10","price":"32.99","VOL":"0.21431115182054"},{"ticker":"ORCL","tdate":"2013-10-11","price":"33.26","VOL":"0.205313209118141"},{"ticker":"ORCL","tdate":"2013-10-14","price":"33.28","VOL":"0.193571835461169"},{"ticker":"ORCL","tdate":"2013-10-15","price":"32.75","VOL":"0.200370410678046"},{"ticker":"ORCL","tdate":"2013-10-16","price":"33.02","VOL":"0.195485030209003"},{"ticker":"ORCL","tdate":"2013-10-17","price":"32.87","VOL":"0.188197940692586"},{"ticker":"ORCL","tdate":"2013-10-18","price":"32.90","VOL":"0.180903070498614"},{"ticker":"ORCL","tdate":"2013-10-21","price":"32.95","VOL":"0.174486249795735"},{"ticker":"ORCL","tdate":"2013-10-22","price":"32.90","VOL":"0.168650690800606"},{"ticker":"ORCL","tdate":"2013-10-23","price":"32.70","VOL":"0.164822064740397"},{"ticker":"ORCL","tdate":"2013-10-24","price":"33.07","VOL":"0.165962090777967"},{"ticker":"ORCL","tdate":"2013-10-25","price":"33.15","VOL":"0.161519400284209"},{"ticker":"ORCL","tdate":"2013-10-28","price":"33.14","VOL":"0.157219945521419"},{"ticker":"ORCL","tdate":"2013-10-29","price":"33.71","VOL":"0.164062931940689"},{"ticker":"ORCL","tdate":"2013-10-30","price":"33.53","VOL":"0.161520549212189"},{"ticker":"ORCL","tdate":"2013-10-31","price":"33.50","VOL":"0.157890374452793"},{"ticker":"ORCL","tdate":"2013-11-01","price":"33.53","VOL":"0.154423039447922"},{"ticker":"ORCL","tdate":"2013-11-04","price":"33.71","VOL":"0.151923027704309"},{"ticker":"ORCL","tdate":"2013-11-05","price":"33.50","VOL":"0.150458464663653"},{"ticker":"ORCL","tdate":"2013-11-06","price":"34.07","VOL":"0.155764497416513"},{"ticker":"ORCL","tdate":"2013-11-07","price":"34.00","VOL":"0.153150637637205"},{"ticker":"ORCL","tdate":"2013-11-08","price":"34.35","VOL":"0.152832044576634"},{"ticker":"ORCL","tdate":"2013-11-11","price":"34.37","VOL":"0.150189552419081"},{"ticker":"ORCL","tdate":"2013-11-12","price":"34.70","VOL":"0.14952695793235"},{"ticker":"ORCL","tdate":"2013-11-13","price":"35.00","VOL":"0.148415028337516"},{"ticker":"ORCL","tdate":"2013-11-14","price":"34.38","VOL":"0.155857645320068"},{"ticker":"ORCL","tdate":"2013-11-15","price":"34.92","VOL":"0.158398514829021"},{"ticker":"ORCL","tdate":"2013-11-18","price":"34.93","VOL":"0.15609269226205"},{"ticker":"ORCL","tdate":"2013-11-19","price":"34.76","VOL":"0.154792958378235"},{"ticker":"ORCL","tdate":"2013-11-20","price":"34.75","VOL":"0.152691551288764"},{"ticker":"ORCL","tdate":"2013-11-21","price":"34.94","VOL":"0.150983119369056"},{"ticker":"ORCL","tdate":"2013-11-22","price":"34.83","VOL":"0.149444734053735"},{"ticker":"ORCL","tdate":"2013-11-25","price":"34.78","VOL":"0.147681465369976"},{"ticker":"ORCL","tdate":"2013-11-26","price":"34.93","VOL":"0.146016866459654"},{"ticker":"ORCL","tdate":"2013-11-27","price":"35.29","VOL":"0.145865045489117"},{"ticker":"ORCL","tdate":"2013-11-29","price":"35.29","VOL":"0.14416765527668"},{"ticker":"ORCL","tdate":"2013-12-02","price":"35.08","VOL":"0.143605575139531"},{"ticker":"ORCL","tdate":"2013-12-03","price":"35.07","VOL":"0.142017343854959"},{"ticker":"ORCL","tdate":"2013-12-04","price":"35.07","VOL":"0.140464403577833"},{"ticker":"ORCL","tdate":"2013-12-05","price":"34.85","VOL":"0.140034298943158"},{"ticker":"ORCL","tdate":"2013-12-06","price":"35.48","VOL":"0.143777496046051"},{"ticker":"ORCL","tdate":"2013-12-09","price":"35.60","VOL":"0.142337053959356"},{"ticker":"ORCL","tdate":"2013-12-10","price":"34.80","VOL":"0.15102648981496"},{"ticker":"ORCL","tdate":"2013-12-11","price":"34.56","VOL":"0.150549994024614"},{"ticker":"ORCL","tdate":"2013-12-12","price":"33.60","VOL":"0.162202594528557"},{"ticker":"ORCL","tdate":"2013-12-13","price":"33.23","VOL":"0.16254416848462"},{"ticker":"ORCL","tdate":"2013-12-16","price":"33.54","VOL":"0.162220989652853"},{"ticker":"ORCL","tdate":"2013-12-17","price":"33.63","VOL":"0.160794505922403"},{"ticker":"ORCL","tdate":"2013-12-18","price":"34.60","VOL":"0.170125829254427"},{"ticker":"ORCL","tdate":"2013-12-19","price":"36.60","VOL":"0.204897995628464"},{"ticker":"ORCL","tdate":"2013-12-20","price":"36.37","VOL":"0.203792242270183"},{"ticker":"ORCL","tdate":"2013-12-23","price":"36.93","VOL":"0.203982009515225"},{"ticker":"ORCL","tdate":"2013-12-24","price":"37.32","VOL":"0.203016695028237"},{"ticker":"ORCL","tdate":"2013-12-26","price":"37.69","VOL":"0.201947497604015"},{"ticker":"ORCL","tdate":"2013-12-27","price":"37.98","VOL":"0.200593310017029"}]}
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 colums with each each date containing a 5 columns, one for each ticker. We can use the @Id variable to calculate the 5 running volatilities in a single select.
SELECT tdate,
wct.RunningVOLATILITY(AAPL, 252, ROW_NUMBER() OVER (ORDER BY tdate), 0) as
AAPL,
wct.RunningVOLATILITY(FB, 252, ROW_NUMBER() OVER (ORDER BY tdate), 1) as
FB,
wct.RunningVOLATILITY(IBM, 252, ROW_NUMBER() OVER (ORDER BY tdate), 2) as
IBM,
wct.RunningVOLATILITY(MSFT, 252, ROW_NUMBER() OVER (ORDER BY tdate), 3) as
MSFT,
wct.RunningVOLATILITY(ORCL, 252, ROW_NUMBER() OVER (ORDER BY tdate), 4) 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);
This produces the following result.
{"columns":[{"field":"tdate","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"AAPL"},{"field":"FB"},{"field":"IBM"},{"field":"MSFT"},{"field":"ORCL"}],"rows":[{"tdate":"2013-09-30","AAPL":"NULL","FB":"NULL","IBM":"NULL","MSFT":"NULL","ORCL":"NULL"},{"tdate":"2013-10-01","AAPL":"NULL","FB":"NULL","IBM":"NULL","MSFT":"NULL","ORCL":"NULL"},{"tdate":"2013-10-02","AAPL":"0.224271090600065","FB":"0.0735909403320345","IBM":"0.157991601318105","MSFT":"0.00909945101198763","ORCL":"0.0511565598296228"},{"tdate":"2013-10-03","AAPL":"0.285595548859782","FB":"0.21372716386867","IBM":"0.121985295333914","MSFT":"0.100413740807231","ORCL":"0.194524893385894"},{"tdate":"2013-10-04","AAPL":"0.237084900781644","FB":"0.391578925365895","IBM":"0.103819114248728","MSFT":"0.0929039814232559","ORCL":"0.15962693079071"},{"tdate":"2013-10-07","AAPL":"0.210356013380844","FB":"0.353864396216867","IBM":"0.1144147399885","MSFT":"0.172704008464697","ORCL":"0.163932835979515"},{"tdate":"2013-10-08","AAPL":"0.223531451606084","FB":"0.555272404098915","IBM":"0.1401579805873","MSFT":"0.16496637923671","ORCL":"0.169562026007422"},{"tdate":"2013-10-09","AAPL":"0.213078771862708","FB":"0.507151192773698","IBM":"0.1767404717407","MSFT":"0.151810388040649","ORCL":"0.155305745732859"},{"tdate":"2013-10-10","AAPL":"0.198152326707184","FB":"0.570678322191235","IBM":"0.204482795103378","MSFT":"0.186038465405536","ORCL":"0.21431115182054"},{"tdate":"2013-10-11","AAPL":"0.186085489735147","FB":"0.534281803337772","IBM":"0.195693582420282","MSFT":"0.180258404799758","ORCL":"0.205313209118141"},{"tdate":"2013-10-14","AAPL":"0.176024763494547","FB":"0.506537694162177","IBM":"0.185445051011276","MSFT":"0.173161316297753","ORCL":"0.193571835461169"},{"tdate":"2013-10-15","AAPL":"0.167117075670665","FB":"0.480580605322842","IBM":"0.187265588559365","MSFT":"0.164638099338941","ORCL":"0.200370410678046"},{"tdate":"2013-10-16","AAPL":"0.159377876724916","FB":"0.483870696606763","IBM":"0.186049678915767","MSFT":"0.157061406259348","ORCL":"0.195485030209003"},{"tdate":"2013-10-17","AAPL":"0.153017708043086","FB":"0.470928852008138","IBM":"0.342742937950233","MSFT":"0.151836148905988","ORCL":"0.188197940692586"},{"tdate":"2013-10-18","AAPL":"0.148154178443564","FB":"0.475936400052069","IBM":"0.329369740776868","MSFT":"0.146280696627879","ORCL":"0.180903070498614"},{"tdate":"2013-10-21","AAPL":"0.163681793295629","FB":"0.461389696597704","IBM":"0.317403106677901","MSFT":"0.141380283329524","ORCL":"0.174486249795735"},{"tdate":"2013-10-22","AAPL":"0.161961570226251","FB":"0.458080123607665","IBM":"0.313744375771333","MSFT":"0.149348503047182","ORCL":"0.168650690800606"},{"tdate":"2013-10-23","AAPL":"0.157702562105636","FB":"0.448852700952121","IBM":"0.30536711027807","MSFT":"0.17648721369219","ORCL":"0.164822064740397"},{"tdate":"2013-10-24","AAPL":"0.155537178833955","FB":"0.436643260698796","IBM":"0.301214200365808","MSFT":"0.171388315917496","ORCL":"0.165962090777967"},{"tdate":"2013-10-25","AAPL":"0.163789677373325","FB":"0.426578483320681","IBM":"0.292941050832951","MSFT":"0.266205233746523","ORCL":"0.161519400284209"},{"tdate":"2013-10-28","AAPL":"0.159619478834349","FB":"0.433841652776117","IBM":"0.285725276959642","MSFT":"0.260758230410505","ORCL":"0.157219945521419"},{"tdate":"2013-10-29","AAPL":"0.188068722816282","FB":"0.426777613108773","IBM":"0.295741935323325","MSFT":"0.254685710035094","ORCL":"0.164062931940689"},{"tdate":"2013-10-30","AAPL":"0.187939213793648","FB":"0.417191302857349","IBM":"0.29062633554224","MSFT":"0.248695297981262","ORCL":"0.161520549212189"},{"tdate":"2013-10-31","AAPL":"0.185791257925522","FB":"0.416118490473473","IBM":"0.284254243424246","MSFT":"0.243979969242079","ORCL":"0.157890374452793"},{"tdate":"2013-11-01","AAPL":"0.184101659389185","FB":"0.40805911065836","IBM":"0.278050768878414","MSFT":"0.238628420047195","ORCL":"0.154423039447922"},{"tdate":"2013-11-04","AAPL":"0.18258564582163","FB":"0.411289680407328","IBM":"0.273148784591888","MSFT":"0.235283525148774","ORCL":"0.151923027704309"},{"tdate":"2013-11-05","AAPL":"0.180022101389953","FB":"0.421856397340002","IBM":"0.27042556572641","MSFT":"0.235905078374151","ORCL":"0.150458464663653"},{"tdate":"2013-11-06","AAPL":"0.177666471057637","FB":"0.418091141033746","IBM":"0.268806191182128","MSFT":"0.258171079125072","ORCL":"0.155764497416513"},{"tdate":"2013-11-07","AAPL":"0.184198773746174","FB":"0.420982309480531","IBM":"0.264302413631107","MSFT":"0.262514261741813","ORCL":"0.153150637637205"},{"tdate":"2013-11-08","AAPL":"0.184793776282328","FB":"0.413414726634288","IBM":"0.259549647060813","MSFT":"0.257959595816974","ORCL":"0.152832044576634"},{"tdate":"2013-11-11","AAPL":"0.182448898566812","FB":"0.413408370202952","IBM":"0.259600756641362","MSFT":"0.254950380754112","ORCL":"0.150189552419081"},{"tdate":"2013-11-12","AAPL":"0.179413859536272","FB":"0.407808527594948","IBM":"0.255263347230854","MSFT":"0.252361424843963","ORCL":"0.14952695793235"},{"tdate":"2013-11-13","AAPL":"0.176568489038223","FB":"0.421850218058507","IBM":"0.251236693474519","MSFT":"0.25298730614803","ORCL":"0.148415028337516"},{"tdate":"2013-11-14","AAPL":"0.176632767341278","FB":"0.415618117817277","IBM":"0.248083217211755","MSFT":"0.249976816419","ORCL":"0.155857645320068"},{"tdate":"2013-11-15","AAPL":"0.175768975036049","FB":"0.409284732830668","IBM":"0.2447863673686","MSFT":"0.247257570736894","ORCL":"0.158398514829021"},{"tdate":"2013-11-18","AAPL":"0.177900006327752","FB":"0.440789708660948","IBM":"0.241915934806432","MSFT":"0.250006421033669","ORCL":"0.15609269226205"},{"tdate":"2013-11-19","AAPL":"0.175352929726722","FB":"0.436049727901166","IBM":"0.238690800797804","MSFT":"0.247331957441656","ORCL":"0.154792958378235"},{"tdate":"2013-11-20","AAPL":"0.175417509647309","FB":"0.430061359858497","IBM":"0.235355683781686","MSFT":"0.24441827639571","ORCL":"0.152691551288764"},{"tdate":"2013-11-21","AAPL":"0.174791013713095","FB":"0.424700478381667","IBM":"0.232647822225072","MSFT":"0.241503405501464","ORCL":"0.150983119369056"},{"tdate":"2013-11-22","AAPL":"0.172956766676484","FB":"0.419592812289521","IBM":"0.232914395369242","MSFT":"0.238326247744306","ORCL":"0.149444734053735"},{"tdate":"2013-11-25","AAPL":"0.17122031232006","FB":"0.420459563671933","IBM":"0.232107235776856","MSFT":"0.235278737797096","ORCL":"0.147681465369976"},{"tdate":"2013-11-26","AAPL":"0.173534056442168","FB":"0.420314036577719","IBM":"0.230138018432581","MSFT":"0.233914475011621","ORCL":"0.146016866459654"},{"tdate":"2013-11-27","AAPL":"0.178535535312193","FB":"0.416821504492747","IBM":"0.228695714503832","MSFT":"0.231219373329762","ORCL":"0.145865045489117"},{"tdate":"2013-11-29","AAPL":"0.180087476749503","FB":"0.413023783761765","IBM":"0.226236229264604","MSFT":"0.229972362005404","ORCL":"0.14416765527668"},{"tdate":"2013-12-02","AAPL":"0.180460442787382","FB":"0.408240489554877","IBM":"0.225349326156618","MSFT":"0.227599588301816","ORCL":"0.143605575139531"},{"tdate":"2013-12-03","AAPL":"0.186918087070296","FB":"0.403788802021793","IBM":"0.223402266012121","MSFT":"0.225624993419381","ORCL":"0.142017343854959"},{"tdate":"2013-12-04","AAPL":"0.185414766083349","FB":"0.410786334412208","IBM":"0.220916846781547","MSFT":"0.225174218939492","ORCL":"0.140464403577833"},{"tdate":"2013-12-05","AAPL":"0.183413052330087","FB":"0.406466128989073","IBM":"0.218609398878077","MSFT":"0.231967729440119","ORCL":"0.140034298943158"},{"tdate":"2013-12-06","AAPL":"0.185988179879154","FB":"0.402485128343155","IBM":"0.217468996906325","MSFT":"0.229961622354126","ORCL":"0.143777496046051"},{"tdate":"2013-12-09","AAPL":"0.184911834132172","FB":"0.400736005841239","IBM":"0.215194000212408","MSFT":"0.227955449372869","ORCL":"0.142337053959356"},{"tdate":"2013-12-10","AAPL":"0.18338595456892","FB":"0.401945870464066","IBM":"0.213002692451954","MSFT":"0.229555795763475","ORCL":"0.15102648981496"},{"tdate":"2013-12-11","AAPL":"0.18317290765486","FB":"0.399797257238259","IBM":"0.21205763372289","MSFT":"0.230038376124558","ORCL":"0.150549994024614"},{"tdate":"2013-12-12","AAPL":"0.18167312583229","FB":"0.410152262710804","IBM":"0.211011420807653","MSFT":"0.229554485482657","ORCL":"0.162202594528557"},{"tdate":"2013-12-13","AAPL":"0.182557458425315","FB":"0.410668241058772","IBM":"0.209024171994707","MSFT":"0.230213432071093","ORCL":"0.16254416848462"},{"tdate":"2013-12-16","AAPL":"0.180911821574914","FB":"0.407144480328883","IBM":"0.216955191401418","MSFT":"0.228153270737405","ORCL":"0.162220989652853"},{"tdate":"2013-12-17","AAPL":"0.179949862331222","FB":"0.405203257279515","IBM":"0.216263294117974","MSFT":"0.227516586364405","ORCL":"0.160794505922403"},{"tdate":"2013-12-18","AAPL":"0.17969270355442","FB":"0.402212057196699","IBM":"0.217458654239988","MSFT":"0.225439106141073","ORCL":"0.170125829254427"},{"tdate":"2013-12-19","AAPL":"0.180568123604884","FB":"0.399300456156596","IBM":"0.216339442752101","MSFT":"0.224586468963242","ORCL":"0.204897995628464"},{"tdate":"2013-12-20","AAPL":"0.179400394730715","FB":"0.395782944403901","IBM":"0.214438701845782","MSFT":"0.224360044116301","ORCL":"0.203792242270183"},{"tdate":"2013-12-23","AAPL":"0.192092068662242","FB":"0.403397610908762","IBM":"0.214170134187367","MSFT":"0.222856719616219","ORCL":"0.203982009515225"},{"tdate":"2013-12-24","AAPL":"0.191057332118658","FB":"0.399968754375222","IBM":"0.212657208109115","MSFT":"0.222052453655894","ORCL":"0.203016695028237"},{"tdate":"2013-12-26","AAPL":"0.190475164684819","FB":"0.396832399932739","IBM":"0.212202038649472","MSFT":"0.220754663739106","ORCL":"0.201947497604015"},{"tdate":"2013-12-27","AAPL":"0.189901899033866","FB":"0.402895731629006","IBM":"0.21047900944155","MSFT":"0.219279343527289","ORCL":"0.200593310017029"}]}