Quantitative Trading BasicsFoundations · Lesson 4
Course home
Quantitative Trading / Direction, leverage, and margin

← Lesson 3 · Quotes, Orders, and Fills

If you get the direction right, will you make money?

When a price falls 5%, one account may lose 5%, another may lose 10%, and a third may profit. The result depends on your direction, your position size, and the equity supporting it.

For beginners35–45 minutes including practiceStage 1 wrap-up
Three things decide the account result
  1. DirectionHow price changes turn into profit or loss
  2. Position sizeHow many units are exposed
  3. EquityWhether you can keep the position open

Lesson 3 separated planned quantity from actual fills. Here we start with an existing position and look at how price changes affect equity and can force an exit.

By the end of this lesson, you can

  1. Calculate directional resultsWork out the profit or loss for a simple linear long or short.
  2. Use the right measuresDistinguish notional value, equity, initial margin, and maintenance margin.
  3. Check the pathExplain how the same final price can give different account outcomes.

The lesson uses a fictional Token A and a cash-settled linear perpetual contract. Prices are in yuan for the exercise, and each contract unit tracks the price change of one token. The examples use fictional rates and paths and are for teaching. The time estimate has yet to be tested with learners.

Calculate long and short P&L ↓
02
Direction · About 4 minutes

The same price move can generate opposite results

Long · A price rise helps

Open a 10-unit long at 100 yuan. At 103 yuan, before fees, the result is

10 ×(103 − 100) = +30 yuan

Quantity × (current price − entry price).

Short · A price fall helps

Open a 10-unit short in a linear contract at 100 yuan. At 103 yuan, before fees, the result is

10 ×(100 − 103) = −30 yuan

Quantity × (entry price − current price).

At 97, the long loses 30 and the short gains 30. Here, a short is a position in a contract. Selling tokens you already own reduces your holdings. Shorting a security through borrowing is another mechanism. It means borrowing the security, selling it, buying it back to return, and paying applicable fees.

Use these formulas for the linear, same-currency setup described here. Inverse contracts, options, other contract multipliers, and different settlement currencies require different calculations. An unhedged short keeps losing money if the price keeps rising.

03
Concepts · About 7 minutes

Track notional value, equity, and margin separately

Position notional · How much exposure do you have?

In this lesson, current notional value = quantity × current price. For example, 20 units × 100 yuan = 2,000 yuan. This is price exposure. Net assets and borrowing are separate measures.

Equity · How much net value remains?

Equity generally means assets minus liabilities. With no other cash flows in this contract account, equity = starting funds + position profit or loss. With 1,000 yuan contributed and an unrealized loss of 100 yuan, equity is 900 yuan. Unrealized P&L counts in the margin check.

Margin is a requirement and remains part of equity

In this example, you allocate 1,000 yuan to a contract position with an opening notional value of 2,000 yuan. An initial margin requirement of 20% calls for 400 yuan. Account equity stays at 1,000 yuan. The 400 yuan is part of that equity.

Opening notional ÷ starting equity = 2,000 ÷ 1,000 = 2×. This ratio measures the exposure relative to the equity allocated to the position.

If you buy a spot asset with borrowed money, track assets and debt separately. Suppose you put up 1,000 and borrow 1,000 to buy 2,000 yuan of assets. After a 5% price fall, assets are worth 1,900, debt stays at 1,000, and equity is 900.The SEC’s securities margin account guide explains how borrowing magnifies losses. A contract instead settles gains and losses according to its own terms.

Isolated and cross margin · Which equity is at risk?

Isolated margin typically allocates a separate pool of funds to one position. Cross margin typically lets eligible funds support several positions. This lesson simulates a single isolated position with no other positions and no automatic funding.

Check the actual account and contract terms for allocation, automatic margin additions, eligible collateral, negative balances, and handling of funds after liquidation. The margin requirement alone cannot tell you the maximum loss across products.This trading platform describes how it isolates margin for a position. Its terms apply to that platform’s products.

04
Interactive calculation · About 5 minutes

Leverage can change when only the price moves

Each example starts with an entry price of 100 yuan and starting equity of 1,000 yuan. Choose the opening notional exposure and then move the price. Choosing a multiple here changes the opening quantity.

90 yuan / −10%100 yuan / entry110 yuan / +10%

Position size

Unrealized P&L

Current equity

Equity change

Current notional

Current leverage

The calculator excludes trade fees, funding payments, and other cash flows. None of these price and position settings reach the teaching maintenance margin threshold. This is a snapshot. The next section follows a full path. Amounts display two decimal places, and calculations use the unrounded values.

In the default example, the price falls 5% and equity in the 2× long falls 10%. At that point notional is 1,900, equity is 900, and effective leverage is about 2.11×. The quantity stays the same, but the equity in the denominator falls.

Switch to a short and replay the same price decline. P&L turns positive. Leverage magnifies the effect of price moves on equity, so you gain more when the price moves in your favor and lose more when it moves against you.

05
Price path lab · About 8 minutes

Both paths end at 110. Does each position make it there?

Compare three independent accounts, each with 1,000 yuan in starting funds and an entry price of 100 yuan. Each takes a long position. The spot account buys 10 units. The two perpetual accounts take exposure to 20 and 50 units respectively and each allocate all 1,000 yuan.

Funding rules for the demo

  • The fully paid spot position uses no borrowing and has no margin liquidation in this demo.
  • Perpetual initial margin = 20% of opening notional. The 20-unit position requires 400 yuan and the 50-unit position requires 1,000 yuan. Both qualify.
  • Maintenance margin is 5% of current notional. If the allocated equity reaches or falls below that requirement, the entire position closes.
  • The price moves continuously between adjacent points. The simulation closes the entire position at the theoretical threshold, with no fees or slippage. Equity left over becomes cash, and the account does not reopen the position.
  • The simulation adds no funds and charges no funding payments, trading fees, or liquidation fees. All ratios and execution rules are assumptions for this lesson.

A real perpetual contract may use a mark price for valuation and liquidation triggers. The mark is a risk reference calculated under the product’s rules and can differ from the last trade. This exercise uses one price path for valuation, triggers, and simulated fills to isolate the funding constraint. An actual fill can differ from the trigger price because of gaps, fees, and margin tiers.Binance explains the difference between the mark price and the liquidation process.

The dashed gray line shows the whole path. The solid line shows how far the demo has advanced. This path is predefined for the exercise.

Current notional and maintenance requirements use the position size still open. After an exit, the position goes to zero and the remaining equity stays in cash.

Optional · Why does the 5× long reach the threshold near 84.21 yuan?

Call the price P. Equity for a 50-unit long = 1,000 + 50 × (P − 100). Maintenance margin = 50 × P × 5%. Setting them equal gives 47.5 × P = 4,000, so P = 84.210526…

At the theoretical threshold, about 210.53 yuan of equity remains. The simulation assumes an immediate exit at that price, leaving it in cash. Real liquidations can leave a different amount. The trigger uses the unrounded price. Under the same assumptions, the 2× account’s threshold would be about 52.63, below both simulated paths.

When you reach the end, change the path to “Rise straight away.” Both paths start with the same position and end at the same price. On the path with a drop, the 5× position closes before the recovery. In the demo, a price rebound leaves that account in cash.

06
Independent practice · About 7 minutes

Calculate the results for a fresh account

Starting equity is 5,000 yuan and opening notional is 15,000 yuan.

Hold a fixed-size linear long while the price falls 4%. Calculate the unrealized result. Assume no funding constraints trigger, and there are no fees or other cash flows. Use these fixed inputs independently of the lab above.

Check six judgments about leverage and margin

0 / 6 questions checked

07
Stage 1 deliverable · About 8 minutes

Put the first four lessons into a trade card

Use a linear perpetual long on fictional Token A with 20 units, an entry price of 100, and 1,000 of starting equity isolated for the position. Use this lesson’s margin rules. Add data, order, exit, and cost terms. Flag anything you still need to verify.

Check your Stage 1 trading worksheet

A hypothetical long position in a linear perpetual contract holds 20 units at an entry price of 100 with initial equity of 1,000. Initial margin is 20% of entry notional. Maintenance margin at entry is 5% of current notional. Ignore fees.

Complete the questions below before trying the optional writing exercise. Use the fixed inputs here, even if you changed the experiment above. Enter numbers in the units shown and keep at least two decimal places where needed. Follow the specified precision for tables. You can check one answer at a time or all answers together.

1. Entry notional
yuan
Reference answer (try the question first)
2. Initial margin requirement
yuan
Reference answer (try the question first)
3. Maintenance margin requirement at entry
yuan
Reference answer (try the question first)
4. Account equity if the price stays the same and there are no fees
yuan
Reference answer (try the question first)
5. Which treatments belong in the trading worksheet? Select all that apply.
Reference answer (try the question first)

Save your homework to export these results. Check again after changing an answer. Optional writing and self-assessment are ungraded. Save your work before refreshing.

Optional writing (ungraded)

Show the example and self-check criteria

Check the first field for a contract long, 20 units, 2,000 yuan opening notional, 1,000 yuan equity, initial margin of 400 yuan, and maintenance margin of 100 yuan at entry. Account for margin as a requirement and keep it in equity.

The remaining fields allow different choices. Use repeatable times and conditions. Use data available at the time, then document execution and fill records. Define the voluntary exit rule and how to handle unfilled orders. Continue accounting with the actual remaining position and equity. Record fees and funding payments, and verify valuation, margin mode, and liquidation terms for the real product.

You can choose a fee for the example if you label it as an assumption. If a cost is unknown, mark it as unresolved until you can check it.

0 / 4 self-checks. Written answers are for self-review.

Includes the current calculation, progress along the path, practice results, and trade card. Export before refreshing or closing the page.

Stage 1 · From an idea to a trade you can verify

You now have four questions for a trade. What is the rule? What do you hold? How did orders fill? Can the account support the position? Use the trade card to see whether you can apply all four on your own.

The next stage covers return and risk. Lesson 5 uses consecutive returns and a mid-period deposit to distinguish changes in account value from investment return.

Lesson 5 · Returns and Compounding → Course home →