Market Neutral Bot
We recommend using Cross Margin Mode for safer trading. Note that using Isolated Margin can carry a higher risk of position liquidation. We also recommend using Hedge Mode to prevent positions from offsetting or closing each other.
Meet our advanced Market Neutral Bot. It is designed to find trading opportunities using quantitative methods rather than directional bets on the market going up or down. The bot uses statistical models to detect price relationships between pairs of cryptocurrencies and trades the difference between them (the "spread") when that difference moves to an unusual level.
Because it trades a spread — long one coin, short another — it aims to make money whether the broader market rises or falls, as long as the two coins move back into their normal relationship.
Statistical Trading Engine
The Market Neutral Bot uses a statistical arbitrage approach. By analysing historical market data and applying mean reversion principles, the bot looks for temporary inefficiencies in the price relationship between two crypto futures pairs, and bets that the relationship will return to normal. This data-driven method lets the bot adapt to changing market conditions instead of relying on a single fixed rule.
How Does the Market Neutral Bot Work?
The bot follows a systematic, data-driven process with four key stages.
Data Collection & Preparation
The bot uses 3 months of historical price data for all tracked cryptocurrencies.
This dataset is the foundation for everything that follows, including volatility clustering and cointegration testing.
Relying on a consistent training period keeps the models stable and relevant to current conditions.
Volatility Clustering
Coins are grouped into two volatility clusters — Low Volatility (L) and High Volatility (H) — to improve selection accuracy and manage risk.
Short-Term Predicted Volatility — estimated from the last 15 days using a GARCH model.
Long-Term Historical Volatility — calculated from the full 90-day dataset.
Extreme outliers are removed using interquartile-range filtering so the clustering is not skewed.
Each coin is labelled L or H, so the bot compares like with like when testing for cointegration.
Johansen Test for Cointegration
Within each volatility cluster, the bot evaluates every possible pair of 2 coins for a long-term price relationship.
The Johansen test detects cointegration — meaning the two prices move together over time, even if they drift apart in the short term. This is the statistical basis for expecting the spread to revert.
For each cointegrated pair, the bot stores the coins, the beta weights (how much of each coin to trade), and the key statistical outputs.
Spread Filtering & Ranking
Cointegrated spreads are ranked by the strength of their cointegration (the gap between the trace statistic and the critical value).
The bot selects the strongest spreads while applying a similarity filter so that no two selected spreads share more than 50% of the same coins — this prevents overexposure to a single asset and improves diversification.
Market Analysis & Execution
Once the best spreads are selected:
Stationarity & Standardisation — the bot builds a synthetic spread from the pair and standardises it into a Z-score, which measures how far the spread currently is from its own average.
Strategy Entry & Exit — when the spread deviates far enough (a significant Z-score), the bot places multi-leg limit orders to enter. It then holds until the spread reverts toward its median, and exits.
Risk & Portfolio Management — the bot applies per-coin exposure limits and total allocation caps, and factors trading fees into every P&L calculation.
Settings Description
The settings below let you tune when the bot enters, how it enters, and how it manages risk. There is no universally correct combination — each setting is a trade-off. The sections after this one explain how to reason about those trade-offs for your own risk tolerance.
Position Settings
Setting | What it does |
Take Profit (%) | How far the spread price must move in your favour before the position closes automatically in profit. |
Stop Loss (%) | How far the spread price must move against you before the position closes automatically at a loss. This is your main tool for capping the size of a losing trade. |
Legs Stop Loss (%) | Closes the entire spread if any single leg (one of the two coins) moves against you by the set percentage — a circuit-breaker for when one coin behaves abnormally and the pair stops behaving like a pair. |
Order Type
Setting | What it does |
Auto | The bot picks the most cost- and slippage-efficient way to enter the spread. |
Market | Both legs are entered immediately with market orders (fastest fill, but you pay the spread/slippage). |
Two Leg Entry | Places limit orders for both legs; if one fills, the other is completed with a market order (better pricing, small risk of a one-sided fill). |
Volatility
Setting | What it does |
High | Only trade spreads from the high-volatility cluster (bigger moves, bigger swings). |
Low | Only trade spreads from the low-volatility cluster (smaller, calmer moves). |
Both | Trade spreads from both clusters. |
Trade Direction
Setting | What it does |
Mean Reversion | Enters when the spread has deviated far from its average, expecting it to revert. This is the classic pairs-trading mode. |
Trend | Enters in the direction of the spread's move, aiming to ride momentum instead of fading it. |
Quantile Group
Controls how extreme a deviation has to be before the bot will enter.
Setting | What it does |
1% | Enter only when the Z-score is in the most extreme 1% of historical deviations. Very selective — rare, but statistically the furthest from normal. |
5% | Enter when the deviation is in the top 5%. A middle ground. |
10% | Enter when the deviation is in the top 10%. Least selective — more frequent entries on smaller deviations. |
Z-Score Rolling Window
Controls how far back the bot looks to decide what "normal" is for the spread.
Setting | What it does |
288 | Short window — roughly 3 days on 15-minute data. The "normal" level updates quickly and reacts to recent conditions. |
2880 | Longer window — roughly 30 days on 15-minute data. The "normal" level is more stable and changes slowly. |
Entry Conditions
Controls at what moment in the deviation the bot enters.
Setting | What it does |
Out of the Channel | A crossover trigger — the bot enters at the moment the Z-score crosses the quantile boundary (for example, crossing down through the lower quantile for a long spread). It reacts to the crossing event itself, so it enters early as the spread stretches out. |
Into the Channel | Waits for the spread to start coming back inside its normal range before entering — a confirmation that reversion may have begun. A later, more conservative entry. |
Outside the Channel | A level / state condition — the bot enters while the Z-score is already beyond the quantile boundary (Z ≤ the quantile for a long, or Z ≥ the quantile for a short), and the condition stays valid for as long as the spread remains beyond it, not only at the instant it crosses. |
Why a Run of Small Wins Can Be Wiped Out by One Loss
This is the single most important thing to understand about mean reversion, and it explains the common pattern of several trades closing in profit and then one loss putting the account negative.
Mean-reversion strategies typically have a high win rate but an uneven payoff shape:
Most trades are small wins — the spread stretches a little, then snaps back to its median, and you take a modest profit.
Occasionally the bet is simply wrong: the two coins' relationship changes (a structural break, major news on one coin, a shift in market regime), the spread keeps widening instead of reverting, and the position becomes a large loss.
So a losing trade in this strategy is often bigger than the typical winning trade. That is not a malfunction — it is the natural shape of the strategy. A profitable mean-reversion system is not one that never loses; it is one where the size of the rare loss is controlled so it cannot erase a long run of wins.
Everything in the risk section below is about that single goal: keeping the size of the occasional loss in proportion to the many small wins.
How to Think About Configuring for Stability
WunderTrading does not provide recommended, "ready-made," or guaranteed settings. The Market Neutral Bot is a tool, not financial advice, and no configuration guarantees a profit or a "stable" result. Markets change, and settings that worked in one period can fail in another. Always test a configuration on a demo account or with small capital first, and only risk what you can afford to lose. The explanations below describe what each setting does and the trade-offs involved so you can make your own informed decision — they are not a specific set of values to copy.
Rather than looking for magic numbers, it helps to reason about each control as a trade-off between two things you cannot maximise at once.
Stop Loss — the main lever on your exact problem. This is the most direct control over the "one loss wipes out my wins" pattern. The tension is real in both directions:
A stop that is too tight will close trades during the normal widening that happens before a spread reverts — turning trades that would have won into losses. Mean reversion needs some room to breathe.
A stop that is too loose (or off) lets a single non-reverting spread grow into the large loss that erases many small wins.
The job is to cap the tail without strangling normal noise. Where that line sits depends on how volatile your chosen spreads are and how much of a single loss your account can absorb.
Legs Stop Loss — protection against a broken pair. The whole strategy assumes the two coins stay related. A Legs Stop Loss is a safeguard for when they don't — when one coin has an idiosyncratic move (an exchange listing, a hack, a delisting, an outsized news event) and the market-neutral assumption breaks. It can prevent a runaway single-leg loss, at the cost of occasionally closing a spread on transient single-coin noise.
Quantile Group — selectivity vs frequency. Tighter (1%) means fewer trades on more extreme, statistically rarer deviations — you sit idle more, but each entry is further from normal. Wider (10%) means more frequent entries on smaller deviations — more activity, but a smaller statistical edge per trade and more exposure to noise. Neither is "safer" by itself; more trades can mean more chances for the occasional bad one.
Z-Score Rolling Window — responsiveness vs stability. A short window (288) recalculates "normal" quickly, so it adapts fast and generates more signals — but a fast-moving baseline can chase the price and mislabel an emerging trend as a deviation to fade. A long window (2880) gives a more stable baseline and cleaner signals, but reacts slowly when a pair's relationship genuinely changes — and that lag is often exactly when the big non-reverting loss occurs. Match the window to how stable you believe your pairs' relationships are.
Entry Conditions — early entry vs confirmation. Entering while the spread is still stretching to an extreme ("Out of the Channel") gets you a better price but risks catching a move that keeps going. Waiting for the spread to start returning ("Into the Channel") is more conservative — you give up some entry price in exchange for evidence that reversion may have begun.
Beyond the individual settings. Two things outside any single field often matter more for a smooth equity curve than the entry parameters:
Position sizing / allocation — how much capital each spread uses, and how many spreads run at once. Over-allocating to several spreads that share the same coins (or the same market regime) concentrates risk, so one bad regime can hit many positions together. The bot's similarity filter helps, but your total allocation is your decision.
Take Profit vs Stop Loss geometry — because wins tend to be small and losses can be large, the ratio between your typical win and your worst-case loss is what actually determines whether a high win rate adds up to a positive result.
Frequently Asked Questions
How do I set it up for more stable operation? Stability in a mean-reversion bot comes less from a specific number and more from controlling the size of the rare loss relative to the many small wins — mainly through Stop Loss and Legs Stop Loss, sensible position sizing, and not over-allocating to correlated spreads. See "How to Think About Configuring for Stability" above. There is no single configuration we can hand you that guarantees a stable result.
Which Entry Condition should I use — Into the Channel, Out of the Channel, or Outside the Channel? The three differ in when they fire relative to the quantile boundary:
Out of the Channel fires on the crossing moment — the instant the Z-score crosses the quantile.
Outside the Channel fires while the Z-score is already past the quantile (Z ≤ quantile for a long, Z ≥ quantile for a short), and stays valid as long as it remains beyond it.
Into the Channel waits for the spread to start returning inside the band before entering — the most conservative, since it wants evidence that reversion has begun.
Crossing/early entries get a better price but risk the spread stretching further; waiting for re-entry into the channel trades price for confirmation.
Which Quantile Group — 1%, 5% or 10%? This is a selectivity vs frequency choice, not a safety dial. 1% = rare, extreme, highly selective entries; 10% = frequent entries on smaller deviations. Choose based on how often you want the bot to trade and how much you trust smaller deviations to revert.
Z-score window — 288 or 2880? 288 (~3 days) adapts quickly and gives more signals but can mistake a trend for a deviation; 2880 (~30 days) is more stable but slower to notice when a pair's relationship has genuinely changed. It's a responsiveness vs stability trade-off.
What Stop Loss should I use? We can't give you a number — the right level depends on your spreads' volatility and your account. Conceptually, it must be loose enough not to close trades during the normal widening before reversion, but tight enough that no single trade can erase a long run of wins. This is the setting most directly tied to the "one loss wipes out my profits" problem.
Do I need a Legs Stop Loss? It is the safeguard for the scenario that causes the worst losses — one coin in the pair moving abnormally and breaking the market-neutral assumption. Many traders value it for exactly that reason; the cost is that it may occasionally close a spread on short-lived single-coin noise. Understand what it protects against, then decide.
Summary
The WunderTrading Market Neutral Bot finds pairs of cryptocurrencies that move together, waits for their price relationship to stretch to an unusual level, enters a spread position betting on a return to normal, and exits as the relationship reverts. It is a high-win-rate strategy with occasional larger losses — so configuring it well is mostly about controlling the size of those rare losses (through Stop Loss, Legs Stop Loss, position sizing and diversification) rather than finding a perfect entry setting. Test any configuration on demo or small capital first, and remember that no settings can guarantee a profit.
