StratBase.aiStratBase.ai
DashboardCreate BacktestMy BacktestsCatalogBlogNewsToolsHelp

Products

  • Researcher Dashboard
  • Create Backtest
  • My Backtests
  • Catalog
  • Blog
  • News

Alerts

  • Calendar
  • OI Screener
  • Funding Rate
  • REKT
  • Pump/Dump

Company

  • About Us
  • Pricing
  • Affiliate
  • AI Widget
  • Contact

Legal

  • Privacy
  • Terms
  • Refund Policy

Support

  • Help Center
  • Reviews
StratBase.aiStratBase.ai

Think it. Test it.

StratBase.ai does not provide financial advice or trading recommendations. AI only formalizes user ideas into testable strategy configurations for research purposes. Past backtesting performance does not guarantee future results. All trading decisions and associated risks are the sole responsibility of the user. This platform is not a broker and does not facilitate real trading.

© 2026 StratBase.ai · AI-powered strategy research and backtesting platform

support@stratbase.ai
How to Set Up Stop Loss and Take Profit in Backtesting
How-ToENstop loss setuptake profit backtest

How to Set Up Stop Loss and Take Profit in Backtesting

James Mitchell2/28/2026(updated 6/2/2026)5 min read477 views

A strategy without proper exit rules is just gambling with extra steps. Stop loss prevents catastrophic losses, take profit secures gains, and trailing stops lock in profit as trades develop. In StratBase.ai, these exits are configurable through the strategy form and profoundly affect backtest results. A mediocre entry with great exits often outperforms a great entry with poor exits — this tutorial shows you how to get the exit side right.

Stop Loss Configuration

The stop loss defines your maximum acceptable loss per trade. In StratBase.ai, you set it as a percentage below your entry price (for longs) or above (for shorts).

Asset TypeDaily TF4H TF1H TF
BTC5–8%3–5%1.5–3%
Major altcoins (ETH, SOL)8–12%5–8%3–5%
Small cap altcoins12–20%8–12%5–8%
Forex majors1–2%0.5–1%0.3–0.5%

Too tight and you get stopped out by normal volatility. Too wide and a single loss erases multiple winners. The sweet spot is 1.5–2× the asset's average true range on your timeframe.

Take Profit Configuration

Take profit closes your trade when it reaches a target gain. The ratio of take profit to stop loss (reward-to-risk) determines your strategy's mathematical edge.

Conservative (1:1): Take profit equals stop loss. Needs >50% win rate to be profitable. Common for range-trading strategies.

Standard (2:1): Take profit is 2× the stop loss. Profitable with just 35% win rate. The standard for most trend-following strategies.

Aggressive (3:1+): Large take profit relative to stop. Only needs 26% win rate for 3:1. Fewer winners but each winner is substantial. Works best with momentum strategies in trending markets.

Trailing Stop

The trailing stop moves your exit in the direction of profit, locking in gains as the trade develops. In StratBase.ai, you configure it as a percentage that trails below the highest price (for longs) or above the lowest price (for shorts).

How it works in practice: You enter BTC long at $50,000 with a 5% trailing stop. Stop starts at $47,500. Price rises to $55,000 — stop moves to $52,250. Price rises to $60,000 — stop moves to $57,000. Price drops to $57,000 — trade exits with +$7,000 profit locked in.

The trailing stop excels in trending markets where letting winners run is critical. It underperforms in choppy markets where prices oscillate — the trailing stop gets triggered during normal pullbacks.

Breakeven Stop

The breakeven feature moves your stop loss to your entry price once the trade reaches a specified profit threshold. For example: “Move stop to breakeven when trade is 3% in profit.” This eliminates the risk of a winning trade turning into a loser.

Important: Trailing stop and breakeven are mutually exclusive in StratBase.ai. You cannot enable both simultaneously. The trailing stop provides breakeven functionality automatically — once it moves past the entry price, you are effectively at breakeven and beyond.

ATR-Based Stops: The Professional Approach

Fixed percentage stops ignore the market's current volatility. A 3% stop on BTC may be perfect during a calm consolidation and utterly inadequate during a high-volatility expansion. ATR (Average True Range) solves this by scaling your stop to actual price movement.

The approach: calculate the ATR for your instrument and timeframe, then set your stop loss as a multiple of ATR. Common multiples range from 1.5× ATR (tight, more frequent stops) to 3× ATR (wide, fewer stops but larger individual losses). On BTC/USDT 4H with a 14-period ATR, a 2× ATR stop adapts automatically: tighter during calm periods and wider during volatile ones.

In backtesting across BTC, ETH, and SOL on the 4H timeframe (2021–2024), ATR-based stops outperformed fixed percentage stops in profit factor by an average of 0.15–0.25 points. The improvement comes primarily from reducing premature stop-outs during volatile periods while maintaining tight risk control during calm ones.

Stop MethodBTC 4H PFETH 4H PFSOL 4H PF
Fixed 3%1.421.180.94
2× ATR(14)1.581.411.22
2.5× ATR(14)1.551.451.31

Notice how the fixed 3% stop is actually profitable on BTC, marginal on ETH, and losing on SOL — because SOL's higher volatility requires wider stops. The 2.5× ATR stop produces consistent profitability across all three assets without any per-asset tuning.

Impact on Backtest Results

Exit SetupWin RateAvg WinAvg LossPF
3% SL / 6% TP48%+5.8%−2.9%1.9
3% SL / 9% TP38%+8.7%−2.9%1.8
3% SL / trailing 5%44%+7.2%−2.9%2.0
5% SL / 10% TP52%+9.5%−4.8%2.1
5% SL / trailing 8%46%+11.3%−4.8%2.2

Notice: wider stops (5%) produce higher profit factors because they survive more volatility and let trades develop. The trailing stop produces the best overall results by capturing extended moves that fixed take profit would exit early.

Golden rule: Always set a stop loss. Strategies without stops may show better backtested returns (because they avoid being stopped out before reversals), but in live trading, a single unexpected crash without a stop can destroy your account. Stop losses are insurance — the premium is worth paying.

Configure your exits with confidence

StratBase.ai lets you configure stop loss, take profit, trailing stop, and breakeven through the strategy form. Test different combinations instantly and compare their impact on your equity curve. Start backtesting →

FAQ

What stop loss percentage for crypto?

BTC daily: 5–8%, 4H: 3–5%. Altcoins: add 50–100%. The optimal approach is 1.5–2× ATR, which adapts automatically to each asset's current volatility.

How does trailing stop work?

Moves stop in profit direction — always trailing below the highest price. Never moves backward. Locks in gains as trade develops. Best in trending markets; underperforms in choppy ranges.

Can I use trailing stop and breakeven together?

No — mutually exclusive in StratBase.ai. Trailing stop provides breakeven automatically once it moves past entry. Enable one or the other, not both.

Fixed percentage or ATR-based stops?

ATR-based stops outperform fixed percentages across most instruments. They adapt to current volatility automatically, reducing premature stop-outs during volatile periods while maintaining tight risk during calm ones.

About the Author

J
James Mitchell

Trading systems developer and financial engineer. 10+ years building automated trading infrastructure and backtesting frameworks across crypto and traditional markets.

FAQ

What stop loss percentage should I use for crypto?▾

For BTC on daily timeframe, 3-8% stop loss is typical. For 4H, 2-5%. For altcoins, increase by 50-100% to account for higher volatility. The optimal stop depends on your entry method — tighter entries (at support) allow tighter stops. Always backtest different values to find the best fit for your specific strategy.

How does the trailing stop work in backtesting?▾

The trailing stop starts at your initial stop distance and moves in the direction of profit as the trade progresses. For a long trade with a 5% trailing stop, the stop initially sits 5% below entry. As price rises, the stop moves up — always staying 5% below the highest price reached. It never moves backward. When price reverses and hits the trailing stop, the trade closes with locked-in profit.

Can I use trailing stop and breakeven together?▾

No. Trailing stop and breakeven are mutually exclusive in StratBase.AI. The trailing stop replaces breakeven functionality because once it moves the stop above entry price, it effectively creates a breakeven (and beyond). Enable one or the other, not both.

Related articles

account slippage backtestingaccumulation distribution guideadx trend strength guideai assistant create strategyanalyze trade log backtest

Comments (0)

Loading comments...