v0.8.6 - Adj Close column (yfinance-style)
New Features
- Adjusted Close column (closes #12):
Ticker.history()now acceptsauto_adjust=Trueto include a yfinance-styleAdj Closecolumn. The column is computed by backward-applying each ex-dividend's(close - amount) / closefactor to all prior closes, on top of the existing split adjustment. The result is a total-return price series — what you'd have if every dividend were reinvested on its ex-date.
import borsapy as bp
stock = bp.Ticker('THYAO')
df = stock.history(period='5y', auto_adjust=True)
df[['Close', 'Adj Close']].tail()Parameter semantics
auto_adjust |
Close |
Adj Close |
|---|---|---|
False (default) |
split-adjusted (unchanged) | not present |
True |
split-adjusted (unchanged) | split + dividend adjusted |
Default behaviour is unchanged — back-compat preserved.
Technical Changes
borsapy/ticker.py: new pure_compute_adj_close()helper + wiring inTicker.history()- 10 new unit tests in
tests/test_ticker.pycovering empty frames, missingAmountcolumn, zero/negative amounts, out-of-range dividends, multiple compounding ex-dates, tz-aware/naive index mismatches, and zero-close guards