Guides
- pandas read_csv MemoryError on a large file: why it happens and how to fix it
read_csv holds parser buffers and the finished DataFrame at once, so peak memory is well above the final frame's size. - pandas rolling window running out of memory on tick data
Rolling statistics over tens of millions of ticks blow up when you chain them, call .apply, or roll over a DatetimeIndex with a large time window. - Plot an interactive drawdown (underwater) curve in Python
Drawdown is the distance from the running equity peak. Here's the 8-line Plotly version, and a one-line tearsheet. - Free historical BTC order book data (CSV) from Binance's archive
data.binance.vision publishes daily book-depth snapshots and every trade for each USD-M perpetual. No API key needed. - Download Binance funding rate history (CSV) for any perpetual
Monthly fundingRate files on data.binance.vision cover every USD-M perp since listing. - Include funding costs in a crypto perpetual futures backtest
At 0.01% per 8 hours, a constant 1x long pays about 11% a year in funding. It belongs in the backtest. - Rolling Sharpe ratio in Python, annualised correctly for 24/7 crypto
Crypto trades 365 days a year. Annualising with 252 understates crypto volatility and Sharpe by about 17%. - Download free BTC tick data and analyse it in one command
Binance's public archive has daily files of every BTCUSDT perpetual trade. Here's how to read one, and a one-command report.