docs(b1): note gd QQQ-alignment choice vs foxhunt original
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,10 @@ def daily_returns(qqq: dict[str, float], multistrat_closes: dict[str, dict[str,
|
||||
w_equity: float = 0.70) -> list[tuple[str, float]]:
|
||||
ms = dict(multistrat.book_series(multistrat_closes))
|
||||
qdates = sorted(qqq)
|
||||
# Intentional alignment choice vs foxhunt original: foxhunt samples QQQ on the book's date grid;
|
||||
# this port computes QQQ returns on QQQ's own consecutive dates then intersects with the book dates.
|
||||
# Identical on a clean shared trading calendar; on a data hole this drops the gap day's move rather
|
||||
# than bridging it as a mislabelled 1-day return.
|
||||
qret = {qdates[i]: qqq[qdates[i]] / qqq[qdates[i - 1]] - 1.0 for i in range(1, len(qdates))}
|
||||
common = sorted(set(ms) & set(qret))
|
||||
return [(d, w_equity * qret[d] + (1.0 - w_equity) * ms[d]) for d in common]
|
||||
|
||||
Reference in New Issue
Block a user