# Strategy Library

## Volatility Effect in Stocks

### Method

#### Universe Selection

To construct the investment universe which consists of US large cap stocks, first in coarse universe selection, we exclude stocks without fundamental data and the price is below 5. A universe of 100 stocks is selected based on the dollar volume. In fine universe selection, we pick 50 stocks from the coarse universe with the highest market cap.

#### Calculate the Volatility

We create `SymbolData`

class and use `RollingWindow`

to store the price data for symbols returned by fine universe.
The lookback period is 252 trading days. First, we request history data to initialize the RollingWindow for the added symbols and update it's value with the closing price every day in OnData().

The standard deviation is the typical statistic used to measure volatility. It is defined as the square root of the average variance of the data from its mean. We use the closing price series in RollingWindow to calculate the volatility.

#### Trading stocks

The trading logic is we go long 5 stocks with the lowest volatility and liquidate stocks in the portfolio which does not in the lowest volatility list. The portfolio is rebalanced at the first trading day each month.

You can also see our Documentation and Videos. You can also get in touch with us via Chat.

Did you find this page helpful?