Strategy Detail

CL / HO Crack Spread

Trades the simplified 1:1 crack spread (Heating Oil vs WTI Crude) as a mean-reversion ratio. Long the crack when refined product cheapens relative to crude, short when it richens, exit on z-score return to neutral.

What It Does

CL / HO Crack Spread runs on daily bars. On every session close where both legs printed at the same tick, the strategy:

  1. Computes the closing price ratio ratio = HO_close / CL_close.
  2. Pulls the prior lookback_days daily ratios (default 60), computes their mean and standard deviation.
  3. Computes today’s z-score: z = (today_ratio - mean) / stdev.
  4. If flat and z <= -entry_z (default 2.0): long the crack by buying HO and selling CL (the ratio is low; refined product is cheap relative to crude, refinery margins look compressed).
  5. If flat and z >= entry_z: short the crack by selling HO and buying CL (the ratio is high; refined product is rich relative to crude).
  6. If in a position and |z| <= exit_z (default 0.5): flatten both legs.

The strategy has no stops, no profit targets, no holding-period limit. The z-score crossing back through the exit band is the only exit. A spread that keeps stretching against the position is held until it eventually reverts or the backtest ends.

What the Crack Spread Actually Is

The “crack spread” is the textbook refinery-margin trade. CL (WTI crude) is the raw input a refinery buys, HO (Heating Oil, also called Ultra Low Sulfur Diesel) is one of the refined products it sells. The spread tracks the refinery’s gross margin on that conversion.

When crude rallies faster than refined products, margins compress and the spread tightens. When refined products outpace crude (cold winter pulling on distillate stocks, refinery outages cutting supply), margins expand and the spread widens. Real refinery hedges use a 3:2:1 crack — 3 CL barrels against 2 RBOB gasoline and 1 HO heating oil, matching the actual yield slate. This strategy is the simplified 1:1 version that uses just HO and CL.

A pair spread isolates the relative move. By design it has less directional exposure than a single-leg position: a parallel rally in both legs leaves the ratio unchanged. The trade pays off when the relationship between the two legs reverts, not when oil itself moves. The flip side is that when the relationship structurally changes (a major refinery goes offline for months, a regional supply shock reroutes flows), the spread can stretch beyond historical bands and stay there.

Notional Balance

CL is $1,000 per point on a 1,000 barrel contract. HO is $42,000 per point on a 42,000 gallon contract. At ~$80 crude and ~$3 heating oil that works out to roughly $80k of crude notional against $126k of heating oil notional per leg, so the default 1:1 sizing runs slightly HO-heavy rather than perfectly dollar-neutral. That asymmetry tends to follow the typical refinery direction: if you believe the long-crack trade has an edge, the slightly larger HO leg is a feature, not a bug. Users who want a tighter dollar balance can raise cl_quantity to 2; the strategy accepts any positive integer pair.

Presets

Five presets cover the canonical variants:

  • Classic Z=2 Both Sides: the default starting point. Trades both directions at 2-stdev entry, 0.5-stdev exit.
  • Tight Z=1.5 / Wide Z=2.5: narrower or wider entry bands. Tighter fires more often with more whipsaw; wider fires rarely but with cleaner setups.
  • Long Crack Only / Short Crack Only: directional variants. Long-crack is the classic refinery-margin trade and the more frequently studied side. Short-crack (reverse-crack) is rarer and tends to coincide with distillate squeezes.

Best In

  • Periods where refining economics are in their normal range and the crack mean-reverts on a few-week to few-month cycle.
  • Research where you want a market-neutral baseline against absolute oil price moves.
  • Studies of how refining margins behave across different lookback windows and seasonal regimes.

Where It Struggles

  • Refinery shutdowns. A large refinery going offline for unplanned maintenance can tighten distillate supply and push the crack wide for months. The rolling z-score does not anticipate this; trades sitting on the wrong side of the move sit in drawdown until reversion eventually arrives.
  • Regional supply shocks. Cold-snap winters, hurricane disruptions on the Gulf Coast, sanctions on refined product flows all break the historical relationship for stretches at a time.
  • Structural shifts in the diesel demand picture (trucking demand, regulatory changes around sulfur content) can drift the spread’s equilibrium away from its old mean.
  • Funding cost is not modeled. Real spread trades have margin on both legs and roll costs at each contract expiry.

What It Does Not Do

  • No stops, no targets, no time-based exit. A crack that never reverts to the exit band stays open.
  • No regime detection. The strategy keeps applying the same z-score rule whether refining margins are range-bound or in the middle of a structural shift.
  • No dynamic leg sizing. The ho_quantity:cl_quantity ratio is fixed per preset.
  • No 3:2:1 leg. This is the simplified 1:1 crack, not the full three-leg refinery hedge. The RBOB gasoline component of the real crack is not included.
  • No roll handling for the continuous front-month series. Backtests use whatever continuous series the data files provide; live trading would require an explicit roll rule.

Test this strategy

Run it on your contracts, timeframes, and parameters.