Sizing Calculator
Std Deviation
Parkinson (σ)
Correlation (ρ)
Requires both tickers
How This Works
This tool is designed for sizing positions in a pair trade.
Price data is pulled from Bybit linear perpetuals via their public REST API. The 7-day window uses 15-minute candles (672 data points), the 30-day window uses 1-hour candles (720 data points), and the 90-day window uses 4-hour candles (540 data points).
Standard Deviation uses closing prices only: r = (closeᵢ − closeᵢ₋₁) / closeᵢ₋₁, σ = √(Σ(rᵢ − r̄)² / n). The sizing ratio is σA / σB where A is the more volatile asset. Each interval's percentage return is calculated from consecutive closes. The mean of all returns is subtracted from each, the differences are squared and averaged, and the square root gives sigma (the typical magnitude of price movement per interval).
Parkinson Volatility uses high and low prices per candle: σ = √( (1/n) × Σ (ln(Highᵢ / Lowᵢ))² / (4 × ln(2)) ). The sizing ratio is parkA / parkB. Rather than just using closing prices, Parkinson uses high and low prices. I would recommend using Parkinson Volatility for your pair trades, if you are familiar with it.
Correlation (ρ) measures how consistently two assets move in the same direction: ρ = Cov(rA, rB) / (σA × σB). A value near +1 means they almost always move together, 0 means no relationship, and -1 means they move exactly opposite.
Choose timeframe based on your expected holding period.
yro