MAMAYtrading terminal

Spread builder: test your own idea

6 min read · How to write a spread as a formula, put it on tracking and look at its history.

Level:

Short version for experts: tables, lists and screenshots only.

Words in this lesson (11)
Spread — The difference between two prices. In the order book — between the best bid and the best ask. In arbitrage — between the price of the same asset on two venues.
Arbitrage — Making money on the price difference of the same thing in two places: buy where it's cheaper, sell where it's more expensive.
Opportunity (arbitrage pair) — A pair of trades in arbitrage: where we buy and where we sell.
Funding — A regular payment between those who are long and those who are short on a perpetual futures contract. Who pays depends on whether the futures price is above or below spot.
Spot — Ordinary buying and selling of the coin or stock itself: you buy it — it's yours.
Futures — A contract on the price of an asset. You don't receive the coin itself — you gain or lose on the price change. Lets you short and use leverage.
Level — A price where the market has already turned before. Support is below the price, resistance is above it.
Screener — A filtering program: it scans hundreds of stocks or coins and shows only those that match the given criteria.
Slippage — The difference between the price you saw and the price at which the trade was actually filled.
Fee — What you pay the exchange for every trade — both on entry and on exit.
Backtest — Testing a rule on past data: what would have happened if we had traded this way before.

Why you need it

The screener shows the opportunities it found itself. But you may have an idea of your own: "I think these two instruments move together, and right now they've diverged". The "Spread builder" lets you write that idea as a formula and see how the spread actually behaved.

How to write a formula

An instrument is written as EXCHANGE:COIN — for spot, EXCHANGE:COIN.P — for perpetual futures. This is the widely used notation: you can paste tickers from other charting programs.

FormulaWhat it calculates
BYBIT:BTCUSDT.P - GATEIO:BTCUSDT.Pthe futures price difference on two exchanges, in dollars
BINANCE:ETHUSDT / BYBIT:ETHUSDTthe price ratio; 1.000 — the prices are equal
BYBIT:BTCUSDT.P - BYBIT:BTCUSDTfutures minus spot on the same exchange
(OKX:BICOUSDT.P / GATEIO:BICOUSDT.P - 1) * 100the spread in percent

Addition, subtraction, multiplication, division and parentheses are available. Exchanges: Binance, Bybit, OKX, Gate, MEXC, Bitget.

Below the formula field there are ready examples — click any of them and it's filled in.

Step by step

  1. Type the formula. Below it you'll immediately see the spread value and the live prices of each instrument.
  2. Give it a name (optional).
  3. Click "Save and track 24/7" — MAMAY starts recording this spread's history.
  4. The spread appears in the "Tracked spreads" list. Click it to open the chart.

What to look for on the chart

  • What value the spread oscillates around. That's its "normal".
  • How far it moves away and how quickly it comes back.
  • Whether it comes back at all. If the spread moved away and has been sitting at a new level for a week, there's no "normal" anymore, and you can't trade the return.
A formula in percent is easier to compare: a $2.80 spread on bitcoin is nothing, but $2.80 on a $10 coin is huge.

What the builder doesn't do

It shows the raw price spread. It has no fees, slippage or funding. Before trading, subtract the costs (the lesson "The math of an opportunity" in the "Arbitrage" track).

↗ Open "Builder / backtest" in MAMAY ▶ The math of an opportunity

Learn where you trade

These lessons live inside the MAMAY terminal. There they come with a mentor powered by your AI that explains the screen you have open right now, reviews of your trades, and everything hidden on the site: screener rules, settings and live examples. Learning and manual trading are free.

Windows 10 and 11 · exchange keys stay on your computer · how the mentor works