N.C.
Back to projects

Strategy engine, broker integration, risk automation, dashboard

Oil Spread Lock Trader

A Python algo-trading system that runs a hedged Brent–WTI spread strategy live through MetaTrader 5, with hard risk limits and a real-time web dashboard.

Trading terminal preview with live Brent and WTI price lines, a convergence indicator, account equity and hedged lock positions.

Challenge

Trading the Brent–WTI crude spread by hand means watching two markets at once, hedging exposure, and reacting to every move before risk gets away from you. A script can place the orders, but the real work is disciplined execution: knowing when a pair is safe to bank, when a floating leg has to be closed, and never letting a bad day run past a hard limit.

Solution

Oil Spread Lock Trader opens two hedged "lock" pairs on the crude spread that net to zero exposure, banks the first profitable pair, then manages the remaining unhedged leg to its exit. A grid layer opens a fresh lock every $0.10 of spread movement, capped for risk. Everything runs live against a MetaTrader 5 demo account with real prices, fills and profit tracking.

  • Strategy engine that opens hedged convergence and divergence pairs, banks the profitable side, and manages the floating remainder.
  • Risk controls with a max floating-loss force-close, a latching daily-loss circuit breaker, and max-hold-time review flags on every open leg.
  • Broker-agnostic core with a spot-only symbol allowlist enforced as a hard safety boundary, so no futures can slip in.
  • A self-contained web dashboard that streams account equity and margin, positions grouped by lock with subtotals, and a dual-line price chart with a clear converging or diverging indicator.

Outcome

The system turns a manual spread trade into disciplined, automated execution. It is honest by design: the "lock" mechanic has no statistical edge on its own, it is a single spread trade minus costs, so the value sits entirely in the execution discipline and the risk automation around it. The project is under active development and runs on a live demo account today.