Skip to main content

Long/Short Crypto Bots with Mirror Mode: Trade Both Directions

· 11 min read
VolatiCloud Team
VolatiCloud

A long-only crypto bot that returns 35% in a bull year typically returns nothing during a 12-month downtrend — and may bleed slow losses on every false breakout it tries to enter. The traditional fix is to disable bots manually when sentiment turns bearish, but that puts the discretionary market-timing decision back on you, defeating half the point of automation. Mirror mode in VolatiCloud's Strategy Builder solves this differently: define your long entry conditions once, flip a toggle, and let the platform auto-generate the inverted short conditions so the same bot trades both directions without duplicated logic.

The Cost of Being Long-Only in Crypto

In a typical crypto bull cycle, a long-only moving-average crossover strategy might produce 30–40% annual returns. In a bear market with the same strategy running, it produces nothing — or trades into declining prices if the exit conditions lag too far behind entry signals.

Traders who understand this often respond by shutting down bots manually when sentiment turns bearish, then restarting them when things look better. This defeats half the point of automation: you're still making discretionary market-timing decisions.

The alternative is building a strategy that works in both directions — entering longs when conditions point up, and entering shorts when conditions point down. A well-tuned bidirectional strategy doesn't need to know whether it's a bull or bear market. It just executes.

The practical barrier has always been maintenance. If your long entry condition is "RSI crosses above 30 while price is above the 50-period SMA," your short entry condition is often the logical inverse: "RSI crosses below 70 while price is below the 50-period SMA." Maintaining two parallel condition trees that need to stay in sync is tedious and error-prone. Flip one threshold, forget to flip the other, and your short-side performance silently diverges.

Position Modes in VolatiCloud

VolatiCloud's Strategy Builder supports three position modes that control which directions your strategy can trade:

ModeWhat it doescan_short
LONG_ONLYOnly long entries and exits (default)False
SHORT_ONLYOnly short entries and exitsTrue
LONG_AND_SHORTBoth directions active simultaneouslyTrue

LONG_ONLY is the default and matches how all strategies built before this feature was introduced behave — no change in existing behavior.

SHORT_ONLY is useful when you're building a dedicated short strategy, perhaps to hedge an existing long portfolio running on a different bot.

LONG_AND_SHORT is the most powerful option: the strategy can enter longs when bullish conditions fire and enter shorts when bearish conditions fire. Whether it holds both positions simultaneously depends on your exchange's margin settings and the specific conditions you configure.

Under the hood, position mode determines which signal functions the strategy code generator produces:

# LONG_ONLY — only these signals exist
def populate_entry_trend(self, dataframe, metadata):
dataframe.loc[conditions, "enter_long"] = 1
return dataframe

def populate_exit_trend(self, dataframe, metadata):
dataframe.loc[conditions, "exit_long"] = 1
return dataframe

# LONG_AND_SHORT — all four signals
def populate_entry_trend(self, dataframe, metadata):
dataframe.loc[long_conditions, "enter_long"] = 1
dataframe.loc[short_conditions, "enter_short"] = 1
return dataframe

def populate_exit_trend(self, dataframe, metadata):
dataframe.loc[long_exit_conditions, "exit_long"] = 1
dataframe.loc[short_exit_conditions, "exit_short"] = 1
return dataframe

The can_short = True flag tells the trading engine that this strategy can open short positions. Without it, short entry signals are ignored even if they exist.

How Mirror Mode Eliminates Duplicate Logic

Writing independent entry and exit conditions for both long and short is the right approach when your strategy is fundamentally asymmetric — for example, a momentum strategy that enters longs aggressively but shorts conservatively, or one that uses different indicators per direction.

But for a large class of strategies — oscillator reversals, mean reversion, crossover systems — the short conditions are simply inverted long conditions. RSI oversold → long entry. RSI overbought → short entry. MACD crossover → long entry. MACD crossunder → short entry.

Mirror mode codifies this pattern. Instead of maintaining two sets of conditions, you define your long conditions once and let VolatiCloud auto-generate the corresponding short conditions by inverting:

  • greater thanless than
  • less thangreater than
  • crossovercrossunder
  • crossundercrossover

The mirror config has two inversion toggles you can apply independently:

  • Invert comparisons — flips threshold operators (><, >=<=, eqneq)
  • Invert crossovers — flips crossover/crossunder signals

This granularity matters. Some strategies need both inversions; others only need one. A mean-reversion RSI strategy using comparison nodes needs comparison inversion but may not use any crossover nodes. An EMA crossover system using crossovers needs crossover inversion but may not have comparison nodes.

Building a Long/Short RSI Strategy: Step by Step

Here's how to build a simple bidirectional RSI strategy in the VolatiCloud Visual Builder.

1. Create a new strategy and open the Visual Builder

From the Strategies page, click New Strategy and select UI Builder mode.

2. Set Position Mode to LONG_AND_SHORT

At the top of the Builder, find the Position Mode selector. Switch it from LONG_ONLY to LONG_AND_SHORT. This reveals two tabs: Long and Short.

3. Build long entry conditions

On the Long tab, under Entry, add your conditions:

  • Add an RSI indicator node: period 14, source close
  • Add a comparison node: RSI < 35
  • This fires when RSI is oversold — a long entry signal

4. Build long exit conditions

Under Exit on the Long tab:

  • Add a comparison node: RSI > 65
  • Exits the long when RSI reaches overbought territory

5. Enable Mirror Mode

Click Enable Mirror on the Short tab. Select Long as the mirror source. Enable both Invert Comparisons and Invert Crossovers.

VolatiCloud will preview the auto-generated short conditions:

  • Entry: RSI > 65 (RSI is overbought — short entry)
  • Exit: RSI < 35 (RSI is oversold — short exit)

This is exactly correct for a mean-reversion RSI strategy.

6. Review and save

The code preview shows all four signal functions populated. The can_short flag is set to True. Save and give the strategy a version name — VolatiCloud's immutable strategy versioning preserves this configuration for the lifetime of the strategy.

When mirror mode is appropriate

Mirror mode works best for oscillator-based strategies where signals are symmetric. For trend-following strategies — EMA crossovers, momentum breakouts — the long and short conditions often need different sensitivity thresholds, so independent configuration is usually better.

Backtesting a Bidirectional Crypto Strategy

Before running a long/short strategy live, backtest each direction independently. This reveals whether the short-side performance contributes positively or if it's dragging down your overall results.

In VolatiCloud's backtesting, set the Position Mode filter to target your strategy, then run separate backtests with the same date range:

  1. One backtest with the bot configured to long-only behavior (useful for establishing a baseline)
  2. One full backtest with LONG_AND_SHORT active

Compare the results. Key metrics to check:

MetricWhy it matters for long/short
Win rate per directionShort win rates often differ significantly from long win rates
Average profit per directionShorts tend to be shorter in duration — smaller average profit per trade is expected
Max drawdownCombined long/short drawdowns can compound if both sides are open simultaneously
Total tradesMore trades means more fees — make sure profit/trade covers exchange costs

Be skeptical of backtests where the short side adds profit in every single bear phase — this may indicate overfitting to specific historical drawdowns. Validate with walk-forward optimization to confirm the edge persists on out-of-sample data.

Risk Differences Between Long and Short

Short positions carry fundamentally different risk characteristics than long positions. Understanding this before going live is essential.

Maximum loss is asymmetric. A long position's maximum loss is your full position size — price can only go to zero. A short position's maximum loss is theoretically unlimited, since price can rise without bound. In practice, your exchange will margin-call and liquidate before catastrophic loss, but a sharp short squeeze can generate losses far larger than expected.

Funding rates on perpetual futures. Most crypto short selling happens through perpetual futures. These charge a funding rate — typically every 8 hours — that transfers money between long and short holders depending on market sentiment. In strong uptrends, funding rates for shorts can be 0.1% every 8 hours or more, which compounds to over 10% annually in fees alone. Your backtest needs to account for this (most backtesting engines, including Freqtrade, include funding rate simulation).

Stop-losses matter more on shorts. Given the asymmetric loss potential, always run tight stop-losses on short positions. ATR-based dynamic stops — described in the ATR stop-loss strategy guide — work well for shorts because they widen automatically during volatile squeezes and tighten when price action calms.

Position sizing. Many traders use smaller position sizes for shorts than for longs, accepting that short-side profit potential is limited while downside risk is not. This is reflected in the position sizing concepts covered in risk management for crypto trading bots.

Test on paper trading first

Always paper-trade a new long/short strategy before committing real capital. Short-side behavior can look very different live compared to backtests, particularly during gap-up moves that occur overnight when your bot is running unattended. VolatiCloud's dry-run mode lets you run the full strategy in simulation against live market data without risking funds.

When to Use Each Position Mode

The right position mode depends on your strategy type and market view.

Use LONG_ONLY when:

  • You're trading spot assets without access to margin/futures
  • You have a directional bullish view and want to capture uptrends only
  • Your strategy logic doesn't translate well to the short side

Use SHORT_ONLY when:

  • You're building a dedicated hedge bot to offset long exposure elsewhere in your portfolio
  • You have a specific bearish thesis and want a bot to express it

Use LONG_AND_SHORT when:

  • You're trading perpetual futures and want full market exposure
  • Your indicator logic is symmetric (RSI, MACD, Bollinger Bands mean reversion)
  • You want the bot to remain active regardless of macro market direction

Most professional traders using VolatiCloud run separate bots per direction initially — even if the conditions are mirrored — so they can toggle each side independently when market conditions favor one direction strongly. This is easy to set up with strategy versioning: create a short-only fork of your long-only strategy and run it as a separate bot.

Filtering and Managing Long/Short Strategies

The Strategies list in VolatiCloud surfaces Position Mode as a filterable column alongside trading mode, timeframe, and stake currency. This makes it easy to filter your strategy library to find all LONG_AND_SHORT strategies, or quickly identify which bots are running short positions.

When managing multiple bots with different position modes, use the card view on the Bots and Strategies pages for a visual overview that shows mode indicators at a glance — useful when you're managing a portfolio with a mix of long-only and bidirectional bots.

Getting Started with Bidirectional Trading

The simplest path is to take a strategy you've already backtested and trusted for long trading, fork it, and experiment with adding short-side logic using mirror mode.

  1. Open an existing strategy in the Visual Builder
  2. Fork it using the Fork action to preserve the original
  3. Switch position mode to LONG_AND_SHORT
  4. Enable mirror mode with both inversions active
  5. Run a backtest on the same date range as your original long-only backtest using the running backtests guide
  6. Compare the results — if short-side adds risk-adjusted value, promote it to a live bot in dry-run mode first

The Strategy Builder in VolatiCloud handles all the code generation — you don't need to write Python or understand Freqtrade internals to produce a valid bidirectional strategy. The position mode selector, per-direction tabs, and mirror toggle make it possible to configure a complete long/short strategy without leaving the browser.

Start exploring at console.volaticloud.com or read the Strategy Builder documentation for a full reference on condition nodes and configuration options.