Alphafamilia Algo Help

Leverage, margin and liquidation

Reading time: 6 minutes.

First: Futures: long and short.

Important. The quiz at the end of this lesson is required: without it a futures connection cannot be added. The questions check whether you understand how money can be lost on futures.

Margin is your pledge

The margin is your money that the exchange holds as a pledge for the position. The position's profit and loss come out of the margin and go into it.

Leverage — how many times the position is larger than the margin

Leverage shows how many times the position size is larger than the margin. In the strategy:

margin = position size ÷ leverage

A position size of 300 USDT at leverage 3 — the margin is 100 USDT. In the app the leverage is from 1 to 10.

Leverage multiplies both the profit and the loss. The price moves by the same percent, but the position is larger than your money. So each move hits the margin harder.

Example. Margin 100 USDT, leverage 5. The position is 500 USDT, a long. No fees:

Price Position's result What happened to the margin
+10 % +50 USDT 150 USDT (+50 %)
−10 % −50 USDT 50 USDT (−50 %)
−20 % −100 USDT ≈0 — the exchange closes the position before that

Without leverage (leverage 1) the same −10 % would cost 10 USDT out of 100.

Liquidation — the exchange closes the position itself

Liquidation is the exchange's forced closing of a position when the margin cannot cover the loss. The exchange does it on its own, asking nobody. The margin is lost — fully or almost fully.

The price at which this happens is called the liquidation price. The higher the leverage, the closer it is:

Leverage A long is liquidated at about
2 −50 % from the average price
5 −20 % from the average price
10 −10 % from the average price

This is the estimate the strategy form makes: −100 % ÷ leverage (for a short — a rise of 100 % ÷ leverage). The real price is counted by the exchange: by its own rules, with the fees, and with cross margin — counting all the money of the futures account. So it can be both closer than the estimate and further. The exchange's liquidation price is shown on the strategy's screen.

Why DCA on futures needs low leverage

A DCA strategy buys more when the price goes against the position. Its lower levels lie far from the entry. If the liquidation is closer than these levels, the price never reaches them: the exchange closes the position first.

Example. A long, 5 parts of 200 USDT, step 3 %, step growth 20 %. The levels: 100, 97, 93.4, 89.08 and 83.9. Before the last level the average price is ≈94.7.

  • Leverage 10: the liquidation is ≈85.2. The last level, 83.9, is beyond it. It never fills.
  • Leverage 5: the liquidation is ≈75.8. All the levels are before it, with room to spare.

The strategy form warns about this: “At leverage … the liquidation is ≈ −… % from the average price. DCA… — beyond it: they never fill, the exchange closes the position first.” With leverage above 5 — “5 or less is advised”. A strategy can be saved with a warning, but it is better to lower the leverage, the step or the number of parts (The form's warnings).

Hedge Mode and cross margin

The strategy needs two settings of the futures account:

  • Hedge Mode — the long and the short of one pair live as separate positions (lesson 13).
  • Cross margin (Cross) — all the free money of the futures account serves as the pledge, not only the strategy's margin. The exchange holds the position longer. But a liquidation can take all the money of the futures account.

So keep on the futures account only what you are ready to risk. Withdrawing money from that account brings the liquidation closer. On Bybit spot and futures share one wallet, and the spot coins are part of the pledge too (shared wallet). Where to switch the modes on — Futures: preparation.

How the strategy uses it

  • No stop-loss. The strategy does not close a position at a loss by itself.
  • The strategy cannot stop a liquidation. The exchange does it.
  • The risk strip on the strategy's screen shows the price now and the price at which the position is liquidated, with a word for it: “far” — more than 25 % away (the strip is grey), “close” — from 10 to 25 % (amber), “danger” — 10 % or closer (red); “liquidation --” — liquidation is farther than the price can go.
  • “🔴 Close to liquidation” comes in Telegram when 10 % or less is left to liquidation (once a cycle). Whether to close the position is your decision — by hand on the exchange.
  • “Stop” does not close the position. The orders are cancelled, the position stays open without a TP and may reach liquidation.
  • If the exchange liquidated the position, the strategy goes into an emergency with the reason “the exchange liquidated the position”.

In detail — Futures: liquidation.

How to limit the risk

  • A test environment first: I want to try without money.
  • Leverage 1–2 and a small position size.
  • No “beyond it” warnings in the strategy form.
  • Watch the risk strip.

Check yourself

1. Margin 100 USDT, leverage 5, a long. The price fell by 10 %. What is the result without fees?

  1. a) −10 USDT
  2. b) −5 USDT
  3. c) −50 USDT
  4. d) −100 USDT
Answer

Right: c) −50 USDT

The position is 100 × 5 = 500 USDT. 10 % of 500 is 50 USDT, half of the margin.

2. Position size 600 USDT, leverage 3. How much of your money is needed on the account as margin?

  1. a) 200 USDT
  2. b) 600 USDT
  3. c) 1800 USDT
  4. d) 3 USDT
Answer

Right: a) 200 USDT

Margin = position size ÷ leverage = 600 ÷ 3 = 200 USDT. The position is still 600 USDT, and the loss is counted from it.

3. What happens at a liquidation?

  1. a) The strategy sells the position by a stop-loss and keeps the margin
  2. b) The exchange pauses the position until the price rises
  3. c) The exchange closes the position itself, the margin is lost
  4. d) The strategy cancels the liquidation if you pressed “Stop” in time
Answer

Right: c) The exchange closes the position itself, the margin is lost

The exchange does the liquidation. The strategy cannot stop it, and “Stop” does not close the position.

4. A long strategy with leverage 10. By the estimate the liquidation is ≈10 % below the average, and the grid's last levels are 16 % below the entry. What happens to these levels?

  1. a) They fill and save the position: the average gets lower
  2. b) The strategy lowers the leverage itself to reach them
  3. c) They may never fill: the exchange liquidates the position first
  4. d) Nothing: leverage has nothing to do with the grid
Answer

Right: c) They may never fill: the exchange liquidates the position first

Leverage does not change the grid, but it brings the liquidation closer. Levels beyond the liquidation price never fill — lower the leverage, the step or the number of parts.

5. You use cross margin. The futures account holds 1000 USDT, the strategy's margin is 100 USDT. What do you risk at a liquidation?

  1. a) Only the strategy's margin, 100 USDT
  2. b) All the money of the futures account, up to 1000 USDT
  3. c) Nothing: cross margin protects from liquidation
  4. d) Only the exchange's fee
Answer

Right: b) All the money of the futures account, up to 1000 USDT

With cross margin the pledge is the whole free balance of the futures account. The position holds longer, but you can lose more.

6. “🔴 Close to liquidation” came. What will the strategy do?

  1. a) Close the position at market
  2. b) Top up the margin from the spot account
  3. c) Lower the leverage
  4. d) Nothing by itself: whether to close the position is your decision on the exchange
Answer

Right: d) Nothing by itself: whether to close the position is your decision on the exchange

There is no stop-loss, the strategy moves no money and does not close the position itself. The message is a signal for you to decide.

Sources