Sharpe, Sortino, VaR, CVaR, and max drawdown — each metric captures one slice of portfolio risk while hiding another. This guide explains what each measures, how to compute them in pandas, and where every single one will mislead you.
Pandas
-
Risk Metrics for Engineers: VaR, Sharpe, Sortino, and Max Drawdown -
Decoding Market Indicators with Code: OBV and the Golden Cross from Scratch Technical indicators look like chart-reading mysticism until you implement them — then they reveal themselves as small, deterministic functions over an OHLCV time series. This post takes two classics apart in Python: On-Balance Volume (the cumulative sum that turns volume into a running confirmation signal) and the Golden Cross (a moving-average crossover you can detect exactly with a sign change and a diff). Vectorized pandas implementations, the math behind each, the look-ahead-bias trap that makes naive backtests lie, and an honest accounting of why a lagging indicator is a description of the past, not a prediction of the future.