Hedge mode: why trading bots need it

One-way or hedge mode? For a single manual trade it does not matter. For several bots on one account it decides whether they close each other's positions.

Hedge mode: why trading bots need it

Every futures exchange has a switch called position mode: one-way or hedge (two-way). A manual trader rarely touches it. A bot that runs several strategies on one account cannot work without it.

What the switch does

In one-way mode an account has one position per pair. A buy order while short reduces the short; a buy bigger than the short flips it into a long. The exchange nets everything into a single number.

In hedge mode long and short positions on the same pair live side by side. A buy order opens or adds to the long; a sell opens or adds to the short; each has its own entry price, margin and P&L. Closing the long does not touch the short.

Why a bot needs two-way positions

Take Owl: a trend-following bot and a counter-trend bot on ETH. In a strong move the trend bot is long while the counter-trend bot sells the extension. In one-way mode the second bot's sell would partly close the first bot's long, and both strategies would see positions they did not open. In hedge mode each bot manages its own side and the statistics of each stay honest.

The same applies to Wolf and Mole, where a pair may hold a long from one setup and a short from another, and to My assembly, where you mix bots of different strategies on one account.

How EDVI switches it on

When you connect an API key, EDVI sets hedge mode on the account through the API, then sets cross margin and x10 leverage on the selected pairs. On Binance and BingX the mode is account-wide; on Bybit it is per pair in the unified account; on OKX it is an account setting as well. You do not need to do anything by hand.

The switch fails in one case: open positions or orders on the account. Exchanges refuse to change the mode while anything is open. If EDVI reports position mode in the strategy log after connecting, close your manual positions and orders on the futures side, then switch the strategy off and on.

Margin in hedge mode

Long and short on the same pair each lock their own initial margin. The exchange does not net them for margin purposes, so an account that holds both sides uses more margin than the net exposure suggests. That is one of the reasons the strategies run on x10 rather than x1, as explained in what leverage to set for a trading bot. Funding, on the other hand, is paid or received per side, so a long and a short of equal size on the same pair roughly cancel each other's funding.

Manual trading on a bot account

Hedge mode does not protect the bot from you. A manual long on a pair the bot trades becomes part of "the long position" the bot sees, and the bot may close it at its take-profit. Keep manual trading on a separate account or sub-account; the API key article explains how to split them.

In short

  • Hedge mode = long and short on one pair at the same time, each with its own P&L.
  • Multi-bot strategies need it to keep positions apart.
  • EDVI enables it automatically; close manual positions first if the switch fails.
  • Both sides lock margin; funding on opposite sides mostly cancels.

More from the blog

All posts