QuantWeftYuxiao Ma
中文
On this page

    Project 5 — Exercises

    These constructed exercises inherit the limited c5/ALIGN acceptance and the later whole-share boundary. This BIL17B bilingual teaching candidate awaits independent acceptance. Complete answers are in solutions.md; reference implementation: projects/project05/solutions_code.py. Code exercises use the teaching constructed panel in src/p05_constructed.py. It demonstrates methods, not market evidence. Real-price research remains blocked; see report Section 2.

    Prerequisites: Chapters 16–17 (stationarity and cointegration), Chapters 29 and 31 (accounting and walk-forward evaluation), and Chapters 35–36 (costs, execution, and IS).

    P5-01 — Hedge units, hand calculation. Training regression log⁡TRy=α+βlog⁡TRx+e\log TR_y=\alpha+\beta\log TR_x+e gives β=1.2\beta=1.2. Signal-close prices are Py=80P_y=80 and Px=50P_x=50. For this simplified share-sizing exercise, assume no split or dividend between the signal close and entry, and enter at those prices; do not separately model overnight price changes or execution costs. Take a long-spread position with target gross exposure USD 1,000,000. Using wy=1/(1+∣β∣)w_y=1/(1+|\beta|) and wx=−β/(1+∣β∣)w_x=-\beta/(1+|\beta|), calculate dollar exposures, share quantities truncated toward zero, absolute and signed share ratios, and net dollar exposure. Why is the share ratio different from β\beta? Does it still equal ∣β∣Py/Px|\beta|P_y/P_x exactly after rounding? In a level regression Py=a+bPx+eP_y=a+bP_x+e, what are the units of bb?

    P5-02 — Corporate actions, hand calculation. This is a corporate-action scenario independent of the P5-01 entry: before the events, the account already holds 5,681 shares of yy and is short 10,909 shares of xx, with preceding closes of 80 and 50. At the next opening, yy splits 2:1 and xx goes ex-dividend by USD 0.30 per share. State both share and cash changes. Then apply TRt/TRt−1=rt(Ct+Dt)/Ct−1TR_t/TR_{t-1}=r_t(C_t+D_t)/C_{t-1}: yy previously closed at 80 and closes post-split at 40.6; xx previously closed at 50 and closes ex-dividend at 49.9. What happens if vendor-adjusted prices are also used for execution?

    P5-03 — Financing and borrow, hand calculation. Return to the original P5-01 entry, not the post-split/dividend P5-02 account. Initial cash is USD 1,000,000 with no holdings; ignore entry fees. This constructed cash model allows all short-sale proceeds to earn interest. Initial NAV is therefore also USD 1,000,000; gross target exposure alone would not establish it. Find post-entry cash. Friday 16:00 to Monday 09:30 lasts 65.5 hours in UTC or over a weekend without a DST change. Assume DFF 5.33% is known at interval start; this is a problem input, not a new historical rate check. The cash credit rate is DFF minus 25 bp; annual borrow is 25 bp; value the short at the available Friday close of USD 50. Under ACT/360, calculate days, interest, borrow charge, and ending cash.

    P5-04 — IS across partial fills on two days, hand calculation. An exit sells Q=−10,000Q=-10{,}000 shares. The decision price, in post-event signal-close units, is 41.00. Day 1 opens at 40.80 and fills only 6,000 shares, with a 2 bp half-spread and 5 bp impact. Day 2 opens at 40.50 and fills the remaining 4,000, with the same 2 bp half-spread and 4 bp impact. Commission is USD 0.005 per share. Use Chapter 36’s single-arrival convention to calculate delay, execution, fees, and total IS; cross-check the direct-dollar method. Examine this specific error: retain the original full-QQ first-arrival delay, reanchor day-2 execution to its opening price, and add F2F_2 times “day-2 open minus decision price” as delay. How much is overcounted? If first-day delay is allocated only to F1F_1, is reanchoring necessarily wrong?

    P5-05 — Correlation is not cointegration, code. For constructed TA/TB, calculate level correlation, daily-return correlation, and EG pp in each 504-day formation window. Why can high correlation not replace a cointegration test?

    P5-06 — Leakage diagnostics, code. Multiply every price after the first formation endpoint by 1.5. Re-estimate that window’s Formation and compare β\beta. Then substitute the full-sample spread mean for the formation mean. Explain the leakage and its effect on z-scores. Run leakage_checks() in solutions_code.py: what does each of its three channels rule out, and why does passing not prove that all leakage is absent?

    P5-07 — Critical values, code. For first-window CA/CB OLS residuals, report the EG statistic, its 5% critical value, and the ordinary ADF 5% critical value. Which determines the conclusion? How does the conclusion change if the ordinary ADF cutoff is used incorrectly?

    P5-08 — Selection and multiple testing, code and interpretation. Run the three constructed pairs under v2, EG p<0.05p<0.05 and β>0\beta>0, with screened and ungated sleeves. How many tests are performed, how many pass EG, and how many are selected by v2? If all nulls hold, how many p<0.05p<0.05 outcomes are expected? Compare excess Sharpe, closed-episode win rate, holding days, and turnover. Explain the bias from showing only selected or profitable pairs. Why is IA_IB window 5 excluded? Can negative β\beta be hedged with same-direction legs? What can and cannot be learned from the difference between old v1 screened Sharpe 0.39 and v2? What changes with a 252-day formation window?

    P5-09 — Partial fills and leg risk, code. Set W0=109W_0=10^9 and the opening-fill budget to 1% of ADV20. Compare matched and independent: partial-fill rows, exit-retry rows, and the largest first-fill deviation “actual share ratio / ordered share ratio − 1.” What does cancellation of an entry remainder imply for PnL? Why can cancellation of an exit remainder not be treated as closing the position? What sample, capacity, and whole-share-domain limits constrain daily retries? Why can full-day volume not determine a 09:30 fill?

    P5-10 — Research judgment. Real-price data are blocked by licensing. Write a report conclusion stating what is and is not supported, where authorized data would enter the pipeline, what must be rerun, and which results would lead to “the evidence does not support the strategy.”

    Search the course

    Enter a search term.