Skip to main content

Module history

Module history 

Source
Expand description

§Dated daily history for research

The live fetcher (fetcher.rs) throws timestamps away because the live analyzers only ever look at “the latest bar”. A backtest cannot do that: to split train from test honestly we need to know when every bar happened. This module downloads long daily histories from Yahoo, keeps the date, and stores dividend-and-split adjusted OHLC so that a $1 dividend never looks like a $1 crash to the indicator.

File format (data/history/SYMBOL.csv):

date,open,high,low,close,volume
2004-01-02,10.21,10.40,10.11,10.33,123400

The extra date column is ignored by fetcher::load_ohlcv_csv, so these files also work with every older tool in the crate.

Structs§

DatedBar
One daily bar plus the calendar date it closed on.

Functions§

fetch_daily
Download range (e.g. "25y" or "max") of daily bars for symbol.
fetch_price_scale
How many real dollars one adjusted dollar was worth on each date.
load
Read a file written by save.
load_scale
save
Write bars as date,open,high,low,close,volume.
save_scale
Save / load date,scale files written for fetch_price_scale.