Expand description
§Live: SD on today’s data, for the runner and the website feed
The backtests read years of saved history. The live tools (sd_live,
sd_feed) need the same SD, the same strategies and the same costs, on
bars fetched this afternoon. This module fetches them once per day into
a cache, computes SD exactly as the backtests do (side from market
weather included), and builds the option-pricing inputs.
Nothing here decides anything; it only assembles the inputs.
Structs§
- Live
Data - Live
Symbol - One symbol, ready for strategies.
- Options
Client - A Yahoo session (cookie + crumb) for the options endpoint.
- Real
Quote - What the option market actually charged for an at-the-money straddle.
Constants§
Functions§
- apply_
real_ iv - Fetch today’s real ATM quotes (one-month and one-week expiries), add them to the log, and make every logged date use the real implied vol instead of the proxy. Returns today’s one-month and one-week quotes.
- bars
- Fetch (or reuse today’s cached copy of)
symbol’s last three years. - cache_
dir - Default cache directory:
~/.cache/sd-live. - iv_
log_ path ~/.local/state/sd-live/iv_log.json: every real quote seen, by symbol.- load
- Fetch the universe (or
symbols) and compute SD for every bar.