Signal 7 — Roll Yield Carry
| Thuộc tính | Giá trị |
|---|---|
| Phân loại | Futures Term Structure |
| Khung thời gian | Weekly / Monthly |
| Paper gốc | Erb-Harvey (2006); Gorton-Rouwenhorst (2006) |
| Loại dữ liệu | Multi-contract futures curve |
| Hướng giao dịch | Carry harvest |
| Capacity | Trung bình–Cao |
Logic. Tính spread annualized giữa front-month và back-month contract: carry = (F_back − F_front) / F_front × (365 / days_diff). Contango (carry > 0 cho long position nghĩa là chi phí roll dương) → short carry. Backwardation (carry < 0) → long carry. Sort universe theo carry, long-short top/bottom.
Công thức.Roll Yield = (F_front − F_back) / F_back × annualization_factor
Code Python.
python
def roll_yield(front_price, back_price, days_between):
return (front_price - back_price) / back_price * (365.0 / days_between)
def carry_signal(curve_df):
"""curve_df: cols = ['front', 'back', 'days_between'] per asset."""
curve_df['carry'] = roll_yield(
curve_df['front'], curve_df['back'], curve_df['days_between']
)
ranks = curve_df['carry'].rank(pct=True)
curve_df['weight'] = np.where(
ranks > 0.7, 1.0,
np.where(ranks < 0.3, -1.0, 0.0)
)
return curve_dfQuantConnect setup. AddFuture("ES", Resolution.Daily) rồi enumerate chain.Contracts để lấy curve. Trên VN30F (chỉ một-hai contract active), pattern này hạn chế; thường dùng cho commodity futures (CL, NG, GC) trên CME qua QC.