finance-business · personal-investing · risk-behaviour

Margin Loan Leverage Calculator

Simulate 100 monthly price paths for a position bought partly with a margin loan inside a seeded, reproducible workbook, and see the chance of a margin call within the horizon, how far the value can fall today before a call, the share price that triggers one, the leverage and what the loan costs a year, with a price fall, no change and a rise compared with and without the loan. Margin is checked at each month end. Estimates for education, not advice.

Last updated

Calculator overview

Inputs and outputs

This summary comes from the calculator's published input and output contract.

Inputs

Random seed
When omitted Blank
About this input

The starting number of the workbook's random-number generator, a whole number from 1 to 2,147,483,646. The same seed and inputs always give the same result, so passing a result's seed again reproduces it. Leave blank for 42, the seed of the published examples. The web page does not show this input: each Simulate press first sets it to the last result's next seed.

Default Not set Range 1 to 2147483646
Value of the securities in the account today (required)
About this input

The market value of the securities in the margin account today, including those bought with the loan.

Unit currency Default 100000 Range 1 to 1000000000000
Price move for the scenarios (up and down)
When omitted Blank
About this input

The price move used for the three fixed scenarios: down by this much, flat, and up by this much over the horizon. Leave blank for 20 percent.

Unit % Default Not set Range 0 to 0.9
Volatility (standard deviation of yearly returns) (required)
About this input

How much yearly returns swing around the average, as a standard deviation. Broad stock funds are often assumed at 15 to 20 percent, single stocks at 30 percent or more. Monthly swings are this figure scaled to a month.

Unit % Default 0.25 Range 0 to 1
Price of one share today (single holding only)
When omitted Blank
About this input

For a single holding, the price of one share today, used to show the call price per share. Leave blank for a portfolio of several holdings; the fall that triggers a call is shown either way.

Unit currency Default Not set Range 0.01 to 1000000
Months to look ahead (required)
About this input

How many months ahead to simulate, from 1 to 36.

Unit months Default 12 Range 1 to 36
Expected yearly return (average) (required)
About this input

The average yearly return you assume for the securities, including dividends kept in the account, as an arithmetic mean.

Unit % Default 0.07 Range -0.2 to 0.3
Yearly interest rate on the loan (required)
About this input

The yearly rate the broker charges on the loan. A twelfth of it is added to the loan each month.

Unit % Default 0.08 Range 0 to 0.3
Maintenance margin (minimum equity share) (required)
About this input

The smallest share of the position that must be your own equity. When equity falls below it at a month end, the path counts as called. Many brokers use 25 to 30 percent for diversified stocks and more for single or volatile ones.

Unit % Default 0.3 Range 0.1 to 0.9
Margin loan (amount borrowed) (required)
About this input

What you owe the broker today (the debit balance). Interest is added to it each month; you make no payments in this model. Enter 0 for a cash account.

Unit currency Default 50000 Range 0 to 1000000000000

Outputs

Next seed in the same stream
About this output

A new seed from the same generator, the start of the next unused stretch of its sequence: a run with it draws fresh futures that share no draw with these. On the web page each Simulate press first enters it as the seed, except the first press after a worked example or Reset.

No unit declared
Chance of a margin call within the horizon: more than 1 in 10
About this output

The share of simulated paths in which equity falls below the maintenance margin at some month end within the horizon. Checking only at month ends understates the chance a daily check would catch.

Unit %
Share price that triggers a margin call Conditional
About this output

The share price at which equity would fall to the maintenance margin today: the loan divided by the number of shares times one minus the maintenance margin. Shown only when a share price is entered.

Unit currency
Model Status
About this output

Whether the inputs describe a plan the workbook can simulate, any result to notice, or OK. The NOT VALID and CHECK reasons are listed in the methodology.

No unit declared
Sampling error of the chance of a call
About this output

About how far, in percentage points, this chance of a margin call could sit from the chance that a very large number of futures would give: the 95 percent margin of a share estimated from this many futures, at its widest. 9.8 points at 100 futures. Two runs with different seeds are two such estimates, so the 95 percent range of their difference is wider, about 1.4 times this margin (13.9 points at 100 futures).

Unit percentage points
Workbook self-check
About this output

PASS when the workbook's model consistency checks hold for this result: the generator states in range, every grid complete and every future counted, and every statistic consistent and in order. FAIL means the result should not be trusted; please report it.

No unit declared
Futures simulated
About this output

The number of futures this result simulated: always 100.

Unit trials
Scenarios at the horizon
About this output

The account at the horizon if the price fell by the scenario move, stayed flat, or rose by it, after the interest the loan has added, beside the same move without a loan.

No unit declared
Seed used
About this output

The seed this result used: the seed supplied, or 42 when left blank. Pass it again with the same inputs to reproduce this result exactly.

No unit declared
Interest on the loan over the next year
About this output

The interest the loan adds over the next 12 months, compounded monthly at a twelfth of the yearly rate.

Unit currency/yr
Median equity at the horizon, paths not called
About this output

The middle equity at the horizon among the paths that were never called. Paths that were called are left out, so this figure describes the survivors only.

Unit currency
Yearly return needed to cover the interest
About this output

The yearly return the securities must earn just to pay a year of interest, so that your equity ends the year where it started.

Unit %
Month by month
About this output

Month by month: the share of paths called so far, the 10th, 50th and 90th percentiles of the position value, the position value below which the account is called, and the loan with its interest.

No unit declared
10th-percentile equity at the horizon, paths not called
About this output

The 10th percentile of the equity at the horizon among the paths that were never called: a tenth of those paths end with less. Paths that were called are left out.

Unit currency
Leverage (position value over your equity)
About this output

The position value divided by your equity. 2 means every 1 percent move in the securities moves your equity by about 2 percent.

Unit x
Fall in value today that triggers a margin call
About this output

How far the position value can fall today, before any interest is added, until equity falls to the maintenance margin.

Unit %
90th-percentile equity at the horizon, paths not called
About this output

The 90th percentile of the equity at the horizon among the paths that were never called: a tenth of those paths end with more. Paths that were called are left out.

Unit currency
Equity at the horizon at the average return
About this output

The equity at the horizon if the securities grew at exactly the average return with no ups and downs, minus the loan with its interest. It can be negative.

Unit currency
This page is provided by LogicCommons for informational purposes only. Results are model outputs computed from the inputs you supply and are not financial, investment, tax, accounting, or legal advice, and no advisory relationship is created. Verify all inputs and results independently before relying on them in any decision.

LogicCommons is in beta. If a result, label, or reference looks wrong, tell us here; we read every message.

Methodology

Purpose and model boundary

This calculator shows what borrowing against securities does to an account. You enter the value of the securities in a margin account, the loan you owe the broker, the maintenance margin, the loan's interest rate and your assumptions for the return and volatility of the securities. The spreadsheet simulates 100 possible monthly price paths over up to 36 months and reports the chance that the account is called within the horizon, how far the value can fall today before a call, the share price that triggers one for a single holding, the leverage, the interest the loan costs over the next year, and the return on your equity if the price falls, stays flat or rises by a fixed move, with the loan and without it.

Every figure on this page is computed by the spreadsheet; the page adds nothing to it. It is an educational estimate from the assumptions you enter. It does not predict markets, it does not tell you whether to borrow, and it is not financial, investment, tax or legal advice. Borrowing to invest can lose more than the money you put in.

Inputs and units

  • The value of the securities in the account today, including those bought with the loan, and the loan (the debit balance), in dollars. Enter a loan of 0 for a cash account.
  • Price of one share today: optional, for a single holding only. It adds the share price at which the account is called; leave it blank for a portfolio of several holdings.
  • The maintenance margin: the smallest share of the position that must be your own equity, as a percentage. FINRA Rule 4210 sets 25 percent as the minimum for long positions, and many brokers ask for more, especially for single or volatile stocks; enter your broker's figure for this position.
  • The yearly interest rate on the loan. A twelfth of it is added to the loan at the end of each month, and nothing is repaid.
  • The expected yearly return of the securities (an arithmetic mean, with dividends kept in the account) and their volatility (the standard deviation of yearly returns).
  • Months to look ahead, from 1 to 36.
  • Price move for the scenarios: optional. Blank means 20 percent, so the scenarios are a 20 percent fall, no change and a 20 percent rise over the horizon.
  • Random seed: the starting number of the spreadsheet's random-number generator. The page does not show it: each press of Simulate first replaces it with the next seed in the stream, except the first press after a worked example or Reset, which keeps that example's seed. Through the API or MCP the seed you pass is used as given; blank means 42, the seed of the worked examples.

Money is in nominal dollars. Rates are percentages.

Governing relationships

With V the value of the securities, L the loan and m the maintenance margin, your equity is V − L, and the account is below the maintenance margin when (V − L) ÷ V < m, which is the same as

V < L ÷ (1 − m), the margin-call level.

Today the value can fall by 1 − L ÷ (V × (1 − m)) before equity reaches the maintenance margin; for a single holding at share price P, the call price is P × L ÷ (V × (1 − m)). Leverage is V ÷ (V − L). With r the yearly rate, the loan after t months is L × (1 + r ÷ 12)^t, and the interest over the next year is L × ((1 + r ÷ 12)^12 − 1).

Each path draws its monthly random numbers from one seeded generator, the minimal standard generator with multiplier 48,271, x(next) = 48271 × x mod (2^31 − 1). Path r owns its own stretch of 64 steps of the stream, so no two paths share a draw. Each state x becomes a uniform draw u = x ÷ (2^31 − 1), and each draw becomes the month's return through the lognormal distribution matched to the yearly return μ and volatility σ, spread evenly over 12 months, with Z the standard normal value whose probability is u:

1 + R = e^(m₁ + s₁ × Z), with s₁ = s ÷ √12, m₁ = m ÷ 12, s² = ln(1 + σ² ÷ (1 + μ)²) and m = ln(1 + μ) − s² ÷ 2

so twelve months compound to exactly the yearly mean and volatility you entered. The value moves by V(t) = V(t − 1) × (1 + R(t)), and a path is called at the first month end at which V(t) < L(t) ÷ (1 − m); it stays called after that.

Calculation sequence

The spreadsheet first works out the loan with its interest and the margin-call level for every month. It then draws 100 paths of monthly returns, follows each path's value month by month, marks the month ends at which each path is below the margin-call level, and counts the paths called by each month. It takes the percentiles of the value in every month and of the equity at the horizon of the paths never called. Beside the simulation it follows the securities at the average return with no ups and downs, and it works out the three fixed price scenarios.

Outputs and interpretation

The headline is the share of the 100 paths that are called at some month end within the horizon. When it is above 1 in 10, its label says so. It is an estimate: at 100 paths its 95 percent sampling margin is about 9.8 percentage points, which the page reports, so a different seed can move it by several points. Beside it are the fall in value today that triggers a call, the call price when a share price is entered, the leverage, the interest over the next year, the seed used and the workbook's self-check. The return needed to cover a year of interest, the 10th, median and 90th percentile equity at the horizon of the paths never called, the equity at the average return and the number of paths simulated (always 100) are returned to the API and MCP.

The first chart shows the 10th percentile, median and 90th percentile of the value in each month with the margin-call level, which rises as interest is added to the loan; the percentiles include paths that were called, as if the securities had been kept. The second shows the share of paths called by each month; its last point is the headline. The third shows your return on equity in the three scenarios beside the same price move without a loan: the loan magnifies both directions and costs interest even when the price stays flat. In the scenarios the price moves steadily to the horizon, so a call is judged at the horizon, which for a steady move is the same as checking every month. The tables give the scenarios and the month-by-month figures.

Validation and status logic

The workbook evaluates the conditions below from top to bottom and returns the first matching status.

Priority Condition Returned status
1 The months to look ahead are not a whole number in the supported interval NOT VALID: the months to look ahead must be a whole number from 1 to 36
2 A supplied seed is not a whole number in the supported interval NOT VALID: the random seed must be a whole number from 1 to 2,147,483,646
3 The position value or the loan is outside the supported amount interval NOT VALID: the position value must be from 1 dollar to 1 trillion dollars, and the loan from 0 to 1 trillion dollars
4 A supplied share price is outside the supported interval NOT VALID: the share price must be blank, or from 0.01 to 1,000,000 dollars
5 The maintenance margin is outside the supported interval NOT VALID: the maintenance margin must be between 10% and 90%
6 The interest rate is outside the supported interval NOT VALID: the interest rate must be between 0% and 30% a year
7 The expected return is outside the supported interval NOT VALID: the expected return must be between -20% and 30% a year
8 Volatility is outside the supported interval NOT VALID: volatility must be between 0% and 100% a year
9 A supplied scenario move is outside the supported interval NOT VALID: the scenario price move must be between 0% and 90%
10 The loan is above the position value times one minus the maintenance margin, so equity is already below the maintenance margin NOT VALID: the account is already below the maintenance margin today; lower the loan or raise the position value
11 The 100-path simulation did not complete NOT VALID: the simulation did not complete; this is a defect in the workbook, please report it
12 The workbook's self-check fails CHECK: the self-check of the workbook failed for this result, so do not rely on it; please report it
13 Volatility is zero CHECK: volatility is 0, so every simulated path is the same and the chance of a margin call can only be 0% or 100%
14 The loan is zero CHECK: no loan is entered, so no margin call is possible
15 None of the preceding conditions applies OK

NOT VALID is a refusal, not a numeric answer: every number reads zero and the tables are empty. An account exactly at the maintenance margin today is valid; the call test is strict, so it is called at the first month end unless its value rises in that month by at least the loan's monthly interest rate. CHECK accompanies a computed result but calls for the stated review. The self-check is reported separately as arithmetic-integrity evidence; it does not replace this ordered status chain.

Assumptions and limitations

The margin is checked only at the end of each month. A broker checks every day, so a path that dips below the margin-call level during a month and recovers by its end is not counted, and the chance shown is lower than a daily check would find. Monthly returns are lognormal and independent from month to month, with no fat tails or crash months, which cause most real margin calls. The maintenance margin and the interest rate stay fixed, interest is added to the loan rather than paid, and no dividends are paid out. The model does not follow what happens after a call, a forced sale or a cash top-up, so the equity percentiles describe only the paths that were never called. It has one long position, no short positions, no tiered rates and no taxes. One hundred paths give an estimate with the sampling margin shown, not a forecast.

Restrictions and non-computing states

This calculator enforces its numeric limits before it accepts a result, and the workbook also refuses the combination a single limit cannot express: a loan too large for the position value and the maintenance margin entered. A retained seed remains part of every simulation.

Errors and warnings

A request rejected by the page's input limits is not a computed result. A transport or service failure cannot establish a fresh workbook answer. Review the workbook's References and Disclaimer, and your broker's margin agreement, before using a result for a real decision.

References

Sources and further reading

The model's amounts, rates and return assumptions come from the inputs, not market data. The workbook's References sheet identifies the calculation sources. The links below explain the rules and ideas behind them; they do not endorse this calculator.

This is an educational estimate, not financial, investment, tax or legal advice. Margin rules, house requirements and interest rates differ between brokers; check your own account agreement before you borrow.

Results are informational and not professional advice. See our Terms of Use. Powered by SpreadsheetWeb · About · Privacy · Terms