# Formula Library

> Every key trading formula in one place: returns, risk, position sizing, ratios, options, bonds, futures and forex, each with a link to a full lesson and calculator.

Source: https://learn.tradelabsai.com/reference/formula-library/  
Track: Reference · Level: Beginner · Updated: 2026-10-03  
Publisher: TradeLabs AI (https://tradelabsai.com). Education, not financial advice.  
Cite as: TradeLabs Learn, "Formula Library", https://learn.tradelabsai.com/reference/formula-library/

This page collects the formulas used throughout the school, grouped by topic. Each one links to the lesson that explains it with worked examples and, where available, to a calculator that does the maths for you. Formulas are written in plain text so they are easy to copy into a spreadsheet or code. Remember that formulas describe models; real markets add costs, slippage, gaps and fat tails that no formula fully captures.

## Returns and growth

```
Simple return = End value / Start value - 1
Log return = ln(End value / Start value)
CAGR = (End value / Start value) ^ (1 / Years) - 1
Gain needed to recover = 1 / (1 - Drawdown) - 1
```

Lessons: [Measuring Returns and CAGR](https://learn.tradelabsai.com/portfolio/measuring-returns-and-cagr/), [Maximum Drawdown](https://learn.tradelabsai.com/portfolio/maximum-drawdown/). Calculators: [Compound Growth and CAGR Calculator](https://learn.tradelabsai.com/tools/cagr-calculator/), [Drawdown Recovery Calculator](https://learn.tradelabsai.com/tools/drawdown-recovery-calculator/).

## Position sizing and trade maths

```
Position size = (Account × Risk %) / |Entry - Stop|
Reward to risk = |Target - Entry| / |Entry - Stop|
Break even win rate = 1 / (1 + Reward to risk)
Expectancy = Win rate × Average win - Loss rate × Average loss
Profit factor = Gross profit / Gross loss
Kelly fraction = p - (1 - p) / b
```

Lessons: [Position Sizing](https://learn.tradelabsai.com/risk/position-sizing/), [Risk/Reward Ratio](https://learn.tradelabsai.com/risk/risk-reward-ratio/), [Expectancy](https://learn.tradelabsai.com/risk/expectancy/), [Profit Factor](https://learn.tradelabsai.com/portfolio/profit-factor/), [Kelly Criterion](https://learn.tradelabsai.com/risk/kelly-criterion/). Calculators: [Position Size Calculator](https://learn.tradelabsai.com/tools/position-size-calculator/), [Risk/Reward Calculator](https://learn.tradelabsai.com/tools/risk-reward-calculator/), [Expectancy and Profit Factor Calculator](https://learn.tradelabsai.com/tools/expectancy-calculator/), [Kelly Criterion Calculator](https://learn.tradelabsai.com/tools/kelly-criterion-calculator/).

## Risk and performance ratios

```
Volatility (annual) = SD of periodic returns × √(Periods per year)
Sharpe ratio = (Return - Risk free rate) / Volatility
Sortino ratio = (Return - Target) / Downside deviation
Calmar ratio = Annual return / Maximum drawdown
Information ratio = Active return / Tracking error
Treynor ratio = (Return - Risk free rate) / Beta
Beta = Cov(asset, market) / Var(market)
Parametric VaR = z × Volatility × √(Days) × Portfolio value
```

Lessons: [Variance and Standard Deviation](https://learn.tradelabsai.com/math/variance-and-standard-deviation/), [Sharpe Ratio](https://learn.tradelabsai.com/portfolio/sharpe-ratio/), [Sortino Ratio](https://learn.tradelabsai.com/portfolio/sortino-ratio/), [Calmar and MAR Ratio](https://learn.tradelabsai.com/portfolio/calmar-and-mar-ratio/), [Information Ratio and Tracking Error](https://learn.tradelabsai.com/portfolio/information-ratio/), [Treynor Ratio](https://learn.tradelabsai.com/portfolio/treynor-ratio/), [Alpha and Beta](https://learn.tradelabsai.com/portfolio/alpha-and-beta/), [Value at Risk (VaR)](https://learn.tradelabsai.com/portfolio/value-at-risk/). Calculators: [Sharpe and Sortino Calculator](https://learn.tradelabsai.com/tools/sharpe-and-sortino-calculator/), [Correlation and Beta Calculator](https://learn.tradelabsai.com/tools/correlation-and-beta-calculator/), [Portfolio Volatility and VaR Calculator](https://learn.tradelabsai.com/tools/var-calculator/).

## Portfolio maths

```
Two asset variance = w1² σ1² + w2² σ2² + 2 w1 w2 ρ σ1 σ2
Diversified volatility = σ × √(ρ + (1 - ρ) / N)
Risk contribution = w_i × (Σw)_i / Portfolio volatility
```

Lessons: [Modern Portfolio Theory and the Efficient Frontier](https://learn.tradelabsai.com/portfolio/modern-portfolio-theory/), [Diversification](https://learn.tradelabsai.com/portfolio/diversification/), [Risk Contribution and Risk Decomposition](https://learn.tradelabsai.com/portfolio/risk-contribution/).

## Options

```
Call payoff at expiry = max(S - K, 0)
Put payoff at expiry = max(K - S, 0)
Put call parity: C - P = S × e^(-qT) - K × e^(-rT)
Black Scholes call = S e^(-qT) N(d1) - K e^(-rT) N(d2)
d1 = [ln(S/K) + (r - q + σ²/2) T] / (σ √T),  d2 = d1 - σ √T
Expected 1 SD move = S × Implied volatility × √T
```

Lessons: [Option Payoff Diagrams](https://learn.tradelabsai.com/options/option-payoff-diagrams/), [Put-Call Parity](https://learn.tradelabsai.com/options/put-call-parity/), [Black-Scholes Model](https://learn.tradelabsai.com/options/black-scholes-model/), [Implied Volatility (IV)](https://learn.tradelabsai.com/volatility/implied-volatility/). Calculators: [Option Payoff Calculator](https://learn.tradelabsai.com/tools/option-payoff-calculator/), [Black-Scholes and Greeks Calculator](https://learn.tradelabsai.com/tools/black-scholes-calculator/), [Implied Volatility Calculator](https://learn.tradelabsai.com/tools/implied-volatility-calculator/), [Binomial Option Pricing Calculator](https://learn.tradelabsai.com/tools/binomial-calculator/).

## Bonds and rates

```
Bond price = Σ C / (1 + y)^t + Face / (1 + y)^n
Modified duration = Macaulay duration / (1 + y)
Price change ≈ - Modified duration × Δy × Price + ½ × Convexity × Δy² × Price
DV01 = Modified duration × Price × 0.0001
```

Lessons: [How Bonds Work](https://learn.tradelabsai.com/bonds-credit/how-bonds-work/), [Yield to Maturity](https://learn.tradelabsai.com/bonds-credit/yield-to-maturity/), [Duration](https://learn.tradelabsai.com/bonds-credit/duration/), [Convexity](https://learn.tradelabsai.com/bonds-credit/convexity/), [DV01](https://learn.tradelabsai.com/bonds-credit/dv01/). Calculator: [Bond Price, Duration and DV01 Calculator](https://learn.tradelabsai.com/tools/bond-calculator/).

## Futures and forex

```
Futures fair value = Spot × e^((r - y) × T)
Futures P&L = Ticks × Tick value × Contracts
FX forward = Spot × (1 + r_quote × t) / (1 + r_base × t)
Pip value (USD quote) = Units × Pip size
```

Lessons: [Basis and Basis Trading](https://learn.tradelabsai.com/futures/basis-and-basis-trading/), [Tick Size and Tick Value](https://learn.tradelabsai.com/futures/tick-size-and-tick-value/), [Covered and Uncovered Interest Parity](https://learn.tradelabsai.com/forex/interest-rate-parity/), [Pips and Pipettes](https://learn.tradelabsai.com/forex/pips-and-pipettes/). Calculators: [Futures Basis and Forward Price Calculator](https://learn.tradelabsai.com/tools/futures-basis-calculator/), [Futures Tick Value Calculator](https://learn.tradelabsai.com/tools/futures-tick-value-calculator/), [FX Forward Points Calculator](https://learn.tradelabsai.com/tools/fx-forward-points-calculator/), [Pip Value Calculator](https://learn.tradelabsai.com/tools/pip-value-calculator/).

## Prediction markets

```
Implied probability = Contract price / Payout
Expected value per contract = Your probability × Payout - Price
```

A Polymarket share priced at $0.62 implies a 62% probability. If you believe the true chance is 70%, the expected value is 0.70 times $1 minus $0.62, or $0.08 per share, before fees. Lessons: [Reading Odds as Probabilities](https://learn.tradelabsai.com/prediction-markets/reading-odds-as-probabilities/), [Expected Value](https://learn.tradelabsai.com/math/expected-value/), [Prediction Market Strategies and Risks](https://learn.tradelabsai.com/prediction-markets/prediction-market-strategies/).

**Example: Using a formula end to end**
A trader with $20,000 risks 1% on a trade entering at $40 with a stop at $38 and a target at $45. Position size is $200 divided by $2, or 100 shares. Reward to risk is $5 divided by $2, or 2.5, so the break even win rate is 1 divided by 3.5, about 28.6%. If similar setups win 40% of the time, expectancy is 0.40 times $500 minus 0.60 times $200, or $80 per trade. Four formulas from this page turned an idea into a sized, evaluated trade.

## Using formulas safely

A formula is only as good as its inputs. Volatility, correlation and win rates estimated from short or calm periods can make risk look smaller than it is. When a formula feeds a real decision, such as position size or leverage, use conservative inputs, round sizes down and check the result against common sense. If a calculation says a tiny stop allows a huge position, the formula is working but the trade may still be a bad idea because of gaps and slippage. See [Slippage](https://learn.tradelabsai.com/markets/slippage/) and [Stress Testing and Scenario Analysis](https://learn.tradelabsai.com/portfolio/stress-testing/).

## Frequently asked questions

### What is the most important trading formula?

Position size, because it controls how much each trade can lose; it is the foundation of risk management.

### Can I copy these formulas into a spreadsheet?

Yes. They are written in plain text so they translate directly into spreadsheet or code formulas.

### Do formulas guarantee trading results?

No. They describe models and risk; real results depend on your edge, costs and market conditions.

Next, browse the key diagrams in the [Visual Library](https://learn.tradelabsai.com/reference/visual-library/).

## Continue learning

- Next lesson: [Visual Library](https://learn.tradelabsai.com/reference/visual-library/)
- Previous lesson: [Trading Glossary A to Z](https://learn.tradelabsai.com/reference/trading-glossary-a-to-z/)
- Related: [Trading Glossary A to Z](https://learn.tradelabsai.com/reference/trading-glossary-a-to-z/): A plain English trading glossary from A to Z. Short definitions of key terms in stocks, forex, futures, options, crypto and risk, each linked to a full lesson.
- Related: [Visual Library](https://learn.tradelabsai.com/reference/visual-library/): A visual library of the most useful trading diagrams: candlestick anatomy, support and resistance, trends, option payoffs, drawdowns and the order book.
- Related: [Position Size Calculator](https://learn.tradelabsai.com/tools/position-size-calculator/): Free position size calculator. Enter your account size, risk percentage, entry and stop to see how many shares, contracts or coins to trade.
- Related: [Black-Scholes Model](https://learn.tradelabsai.com/options/black-scholes-model/): The Black Scholes model prices European options from five inputs. Learn the formula, its assumptions, a step by step example and where the model breaks down.
- Related: [Sharpe Ratio](https://learn.tradelabsai.com/portfolio/sharpe-ratio/): The Sharpe ratio measures return per unit of risk. Learn the formula, how to annualise it, what counts as a good Sharpe ratio, its limitations and common mistakes.
