TradeLabs AILearn

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.

Beginner3 min readUpdated 3 Oct 2026
Markdown
Lesson 2 of 5

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, Maximum Drawdown. Calculators: Compound Growth and CAGR Calculator, 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, Risk/Reward Ratio, Expectancy, Profit Factor, Kelly Criterion. Calculators: Position Size Calculator, Risk/Reward Calculator, Expectancy and Profit Factor Calculator, 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, Sharpe Ratio, Sortino Ratio, Calmar and MAR Ratio, Information Ratio and Tracking Error, Treynor Ratio, Alpha and Beta, Value at Risk (VaR). Calculators: Sharpe and Sortino Calculator, Correlation and Beta Calculator, Portfolio Volatility and 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, Diversification, Risk Contribution and Risk Decomposition.

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, Put-Call Parity, Black-Scholes Model, Implied Volatility (IV). Calculators: Option Payoff Calculator, Black-Scholes and Greeks Calculator, Implied Volatility Calculator, Binomial Option Pricing 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, Yield to Maturity, Duration, Convexity, DV01. Calculator: Bond Price, Duration and DV01 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, Tick Size and Tick Value, Covered and Uncovered Interest Parity, Pips and Pipettes. Calculators: Futures Basis and Forward Price Calculator, Futures Tick Value Calculator, FX Forward Points Calculator, 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, Expected Value, Prediction Market Strategies and Risks.

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 and Stress Testing and Scenario Analysis.

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.

Check your understanding

3 quick questions on this lesson. Get them all right to finish it.

Turn on JavaScript to take the quiz.

Finished this lesson?Sign in to save your progress across devices.
Next lessonVisual LibraryA visual library of the most useful trading diagrams: candlestick anatomy, support and resistance, trends, option payoffs, drawdowns and the order book.