Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
DATA3888: Data Science Capstone
Overview
Volatility is one of the most prominent terms you'll hear on any trading oor
Volatility captures the amount of uctuation in prices
High volatility: periods of market turbulence and large price swings
Low volatility: more clam and quiet markets
Predicting volatility is essential
Example: Option price is directly related to the volatility of the underlying product
Purpose of this project
To build a model that predicts future volatility based on the provided stock data
Use communication strategies (e.g., educational shiny app, short videos, or infographics) to
provide traders with a rm understanding of the prediction methodology
2 / 37
Preliminary trading theory
Order book
There are buyers and sellers for any given nancial instrument
Intended buy orders: bid & Intended sell orders: ask
Order book is an electronic list of buy and sell orders for a specic security or nancial instrument
organized by price level
4 / 37
Trades
When someone wants to do a trade in a stock, they check the order book of the stock and nd
someone with counter-interest to trade with
Example: I want to buy 20 shares of a stock
Check the ask (aka offer) side of the book and lift 20 shares for a price of 148
"Lift the offer" means to buy the thing at the lowest price offered by the market
A
5 / 37
Market making
An actively traded (or liquid) nancial instrument has a dense order book
Consider a less liquid order book and I, again, want to buy 20 shares of the stock
I still want to buy at price 148, but there's nobody willing to sell at 148
My order will be sitting in the book
How about I insert an order to buy at 155?
6 / 37
Market making
The previous example shows that it's dicult to trade in an inecient market
This is why investors love liquidity
A market maker is a rm or individual who actively quotes two-sided markets in a security, providing
bids and offers along with the market size of each
Optiver is a market maker
As a market maker will show both bid and offer orders, an order book with the presence of market
maker will be more liquid, therefore a more ecient market will be provided to end investors to trade
freely without concern on executions
Making a market involves providing both a buy and a sell price for a nancial instrument
7 / 37
Order book statistics
Lots of statistics can be derived from raw order book data to reect market liquidity and stock
valuation
We'll introduce bid/ask spread and weighted average price (WAP)
You might come up with some of your own that are helpful in predicting the volatility
Bid/ask spread: computed based on the ratio of best offer price and best bid price
What does a BidAskSpread of 0.5 mean?
What about 0.02?
Can BidAskSpread be negative?
BidAskSpread = − 1
BestOffer
BestBid
8 / 37
Order book statistics
Weighted averege price (WAP)
A fair book-based valuation must take two factors into account: the level and the size of orders
and are the highest bid price and its size in the order book, respectively
and are the lowest ask price and its size in the order book, respectively
If two books have both bid and ask offers on the same price level and remember
, then (try to prove it):
WAP decreases in with xed
WAP increases in with xed
Intuition: more offers mean that there are more intended sellers in the book, and more sellers
imply a fact of more supply on the market resulting in a lower stock valuation
−100%
log(2.1/2) = log(1.05) = log(1 + 0.05) ≈ 0.05
log(1 + x) ≈ x x 12 / 37
Volatility
When we trade options, a valuable input to our models is the standard deviation of the stock's log
returns
The standard deviation will be different for log returns computed over longer or shorter intervals, for
this reason it is usually normalized to a 1-year period and the annualized standard deviation is called
volatility
Consider a 10-min xed time interval and assume that we sequentially observe log returns over
time, which are denoted as . The realised volatility for this 10-min interval is dened as
We implicitly assume that the log returns during the 10-min time interval have 0 mean for
simplicity.