
Maximum Drawdown in Python: Calculate Loss and Recovery Time
Calculate maximum drawdown in Python with pandas. Find peak, trough and recovery dates, handle unrecovered losses, and analyze historical market data.
16 posts on backtesting from the SiftingIO market data blog, spanning real-time and historical coverage across stocks, forex, crypto, commodities, and on-chain venues.

Calculate maximum drawdown in Python with pandas. Find peak, trough and recovery dates, handle unrecovered losses, and analyze historical market data.

Detect same-candle stop-loss and take-profit ambiguity in Python, compare fill assumptions, and see when finer OHLCV data can resolve the sequence.

Compare stock and crypto close-to-close returns on one session calendar. A tested pandas example handles DST, early closes and missing observations.

How cursor pagination works on a market data API, with request math, a Python loop, and a gap check for multi-year pulls of 1-minute OHLCV bars.

Weekly candle open and close times for forex, crypto, and US stocks, and how to rebuild either week convention from timestamped SiftingIO bars in pandas.

How to pull daily and intraday OHLCV stock bars from a REST API: request format, response fields, intervals, cursor pagination, history depth, and pitfalls.

July 2026 CPI matched consensus exactly and markets barely moved. Why consensus, actual, revisions, and exact timestamps are the calendar fields that matter.

1-minute OHLCV bars are the base timeframe. The exact rules for resampling minute bars into 5m, 15m, and 1h bars, with the alignment and gap traps to avoid.

Compare daily candle open and close times for forex, crypto and US stocks, including UTC vs New York cutoffs, daylight saving and regular trading sessions.

Pull historical OHLCV bars for gold, crude, and other commodities over REST, stream live prices over WebSocket, and handle the seam where they meet.

Five ways historical price data silently corrupts a backtest: adjustment method, venue-dependent highs and lows, gap policy, session cuts, and restated bars.

Forex OHLCV data explained: how FX candles are built from aggregated quotes, why daily bars depend on the day boundary you pick, and how to pull them by API.

Build a total-return series from as-traded prices, split factors, and cash dividends with reinvestment math, and see where the adjusted-close shortcut misleads a backtest.

How to pull scheduled US economic events from one endpoint and align them with OHLCV bars so a backtest knows when CPI, NFP, and FOMC actually hit.

What OHLCV data is, how bars are built from ticks, why two providers disagree on the same candle, adjusted vs unadjusted bars, and how to pull bars via API.

How to pull scheduled US economic events from one endpoint and align them with OHLCV bars so a backtest knows when CPI, NFP, and FOMC actually hit.