Math 5440: Week 9 Assignment
Due Date: March 31, 2023 at 10am
Exercise 1 Creating Synthetic Alphas
Consider a synthetic signal
αt =a(Rt −RT)+b(Wt −WT)
for parameters a and b, where R and W are assumed to be two independent Wiener processes with volatility σR and σW , respectively. We call Rt − RT the signal’s realized alpha, and the synthetic alpha is constructed by adding noise to the realized alpha.
1. Compute the correlation ρ between αt and Rt − RT for given a, b.
2. Pickvaluesofa,bsuchthatαt =E[Rt−RT|αt]andρ=0.05.
3. Load the binned stock data using
\l pathToHdbFolder\columbiaHdb
Load in memory the table for the date 2019.01.03. For each stock, let S = (St)0≤t≤T be its mid prices during the trading day and define the end-of-day return starting at t by
Rt:=ST−1, RT=0. St
Calculate Rt and treat (Rt)0≤t≤T as a realization of a Wiener process (that starts with RT = 0 and propagates backward in time). Estimate σR by the volatility of the returns over 10-second bins. (Why this is a reasonable estimate of σR?)
The following function simulates n independent samples, each of which is a sum of twelve random numbers uniformly generated in [0, 1]. Its distribution is close to a standard normal distribution. You can treat the samples as if they are truly drawn from a standard Gaussian distribution.
u12: {[n] -6f+sum n cut (12*n)?1f}
Computer Science Tutoring
Simulate a Wiener process W with volatility σW = σS, and then calculate the synthetic alpha αt and αt′. When calculating αt′, you can use the approximation
α t′ ≈ 1 ( α t − α t − ∆ t ) ∆t
for ∆t = 10mins. In the first ten minutes of the day, we can assume α t′ = 0 .
Exercise 2 Simulating Trading Strategies
Given a trading signal αt, αt′ and a standard OW price impact model, this exercise implements the corresponding optimal trading strategy. Let αt,αt′ stem from the previous exercise. Furthermore, assume the price impact model
with log(2)/β = 60 minutes.
1. Simulate the target impact state for the optimal trading strategy.
2. Given an impact state, simulate the corresponding trades.
3. For each stock, compute the final order size as a percent of adv. Provide a scatter-plot of alpha strength against optimal order size across the whole universe of stocks and the full year of 2019. Here, alpha strength means the alpha at the beginning of the day, i.e., α0.
The following is a bonus problem. It is not mandatory, but we will award two extra points to students who solve it.
Exercise 3 (Bonus 2pts) Backtesting Trading Strategies
Assume given the same alpha signals, the price impact model, and the previously computed optimal trading strategy.
1. Simulate a VWAP strategy for an order of the same size as the opti- mal trading strategy.
2. Backtest the trading costs and P&L of the optimal and the VWAP strategy across all stocks and dates.
3. Provide summary statistics: average P&L, sharpe ratio, and alpha- impact ratios. Then, repeat the analysis bucketing by vol.
dIt =−βItdt+0.8· σ dQt adv
浙大学霸代写 加微信 cstutorcs