Skip to content
All strategies

Strategies

MSFT/ORCL Log-Price Cointegration with Price-Corrected Share Hedging

Outcome: Abandoned

MsftOrclLogCointegrationPriceCorrectedHedge

Outcome Summary

After three iterations, the MSFT/ORCL strategy reached backtesting with synchronized opposing legs, price-corrected hedging, and frozen coefficients. Its 11 completed baskets produced -$970.54 net PnL, a -0.971% return, and Sharpe -0.045. Actual execution occurred at session opens despite the hypothesis specifying completed closes. Backtest review abandoned this baseline adaptation before optimization because evidence was sparse and economics unfavorable, without claiming to falsify cointegration strategies generally.

Hypothesis

Derived by the Research Lead from 43zombiegit's 'Cointegration and hedge ratio': operationalize the question about regression coefficients and trade quantities as a two-stock pairs experiment. The source discusses hedge-ratio interpretation but supplies no executable strategy. Research Lead choices are MSFT/ORCL, daily bars, rolling log-price cointegration estimation, residual reversal entries, frozen trade-level coefficients, and explicit exits. Regress log PRICE LEVELS rather than log returns: return regression estimates return exposure, not a cointegrating relationship. Convert the log-price coefficient into dollar exposure and then shares; never interpret it directly as a share ratio. Trade both spread directions using USEQ margin, with market orders at completed daily closes. No next-session-open execution is required. This tests a software-sector relationship without claiming that these stocks are already known to be cointegrated.

Preserve the source's stock-market setting rather than substitute crypto. The experiment adds paired long/short exposure to a corpus that is 80.9% long-only and 63.0% single-symbol. It differs from the listed duopoly frozen-versus-rolling experiment by testing a software pair with one prescribed estimation scheme and explicit log-coefficient-to-share conversion, rather than comparing hedge estimators. Corpus concentration is empty, so no instrument-level underrepresentation is asserted. Daily equity history supports substantially longer validation than sub-hourly Hyperliquid history; the failed LTC/BCH 15-minute return-spread experiment is not repeated.

Decline optimization of this MSFT/ORCL operationalization: the few executed baskets lose after modeled costs, and no verified code repair or demonstrated viable parameter region supports developer iteration. This rejects this baseline adaptation, not the source author's hedge-ratio discussion or cointegration strategies generally; it does not establish statistical falsification of the mechanism.

Implementation

Daily MSFT/ORCL log-price residual reversal on USEQ. Fits preceding synchronized formation sessions, screens residual cointegration, freezes coefficients during each basket, converts beta-weighted dollar exposures to whole shares, and exits both legs on convergence, divergence, holding limits or excessive missing sessions.

Addresses the reported Layer-1 failure by removing src.data.market_calendar and replacing only its daily-session counting dependency with standard-library date arithmetic and cached repository XNYS closure rules covering this pair's shared history. Exact timestamp alignment, regression, continuous residual signal, sizing, frozen coefficients and trading decisions remain unchanged. Verification remains with the pipeline; no measured evidence yet supports abandoning the mechanism. The required outbox file could not be written because the workspace is read-only; the complete task-bound JSON is returned here.

Verification Results

The sandbox contains only two completed baskets (four closed leg positions); its positive performance does not establish an edge. Assess basket-level economics over full history.

Backtest Review

Sharpe
-0.05
Total return
-0.97%
Max drawdown
4.96%
Trades
22
Win rate
50.0%
Profit factor
0.88

All 11 completed baskets contain synchronized opposing MSFT/ORCL legs; the code uses price-corrected share hedging and frozen trade-level coefficients.

Both input audits pass, accounting reconciles, and no positions remain open.

Only 11 baskets completed over approximately 37 evaluated years. Five won; aggregate net PnL was -$970.54 and basket-level profit factor was 0.756.

Reported per-leg average return is -0.414%, versus the USEQ reference floor of +0.05%; total return is -0.971% and Sharpe is -0.045. These are unfavorable baseline economics, not proof that the broader mechanism cannot work.

QA's sample-size concern is borne out: full history still provides little basket-level evidence for an 11-parameter optimization.

Actual trades execute at session opens, whereas the hypothesis specifies completed-close execution. This result evaluates the platform's next-open adaptation.

Benchmark comparison is inapplicable because benchmark_meaningful is false.

Iteration History

Verification failed (Layer 1.5 — hypothesis/config consistency) [class=hypothesis_mismatch]: - optimization_plan fixes bar_interval at 1-DAY

Verification failed (Layer 1 — static analysis): - Banned import: src.data.market_calendar — strategies may only import the framework bases and helpers (src.strategies.base_template, src.strategies.rolling_options_template, src.strategies.polymarket_series_template, src.strategies.helpers); collectors, the database, the backtest engine and the registry are outside the sandbox. (line 11)

Outcome Summary

Correct hedge sizing alone did not establish a viable edge; future work needs sufficient basket-level evidence and execution aligned with the hypothesis.

Backtest review declined optimization because the sparse baskets lost after modeled costs, with no verified code repair or demonstrated viable parameter region supporting another iteration. Optimization and subsequent analyst, risk, and promotion stages were not reached.

Trade daily MSFT/ORCL spread reversals using rolling log-price cointegration, price-corrected share hedging, and coefficients frozen during each trade.

The backtest returned -0.971% with Sharpe -0.045 and 22 closed leg positions representing 11 completed baskets over approximately 37 evaluated years. Five baskets won, aggregate net PnL was -$970.54, and basket-level profit factor was 0.756.

Analysis

Cointegration and hedge ratio

Backtest and paper results are hypothetical. Trading involves risk of loss.