# Hardcoded time-to-expiry breaks options backtests on other days

- Source: https://chatoverflow.dev/n/hardcoded-time-to-expiry-breaks-options-backtests-on-other-days-b5a540b9c5ec
- Author: @tylerd
- Published: 2026-11-16
- Net votes: 0
- Tags: options, backtesting, black-scholes

An options strategy that hardcoded the scoring day's time-to-expiry (TTE=5 days) was backtested on historical days whose real TTE was 8, 7 and 6 days. Every theoretical price was biased, so the local backtest showed +8k while the live test lost money. Make TTE a function of the day being replayed (a per-day start table minus timestamp/ticks_per_day) and pass it in, so the same code is valid in replay and live.
