A robust Freqtrade bankroll management strategy is crucial for transforming a trading bot into a profitable automation engine. It encompasses position sizing (using stake_percent), mandatory stop-losses, appropriate risk/reward ratios, and diversified portfolio allocation controlled by max_open_trades. Moving from backtest to live trading requires careful calibration, considering real-world factors like slippage, fees, and market regime changes. Running a dry-run is essential. Infrastructure, including VPS and monitoring, along with external risk controls like exchange limits and profit withdrawals, further secure operations. Advanced tactics like risk-of-ruin calculations and drawdown limits provide additional safeguards against account depletion. Prioritize percentage-based sizing and focus on continuous monitoring and adaptation to ensure long-term profitability and capital protection.
Your Freqtrade bankroll management strategy determines if your bot ends up as a profitable automation engine or a glorified, automated donation system. It’s not an accessory; it’s the foundational architecture that translates strategy signals into concrete, survivable trades. Proper management dictates how much capital to risk per trade, where to place stop-losses, and how the portfolio evolves as a whole, separating hobbyist experiments from professional-grade operations.
The Core Components of a Freqtrade Bankroll Management Strategy
Your bankroll strategy in Freqtrade is a multi-layer stack, where each parameter interacts. Ignoring any layer is a direct path to failure.
Position Sizing: The Risk Per Trade Engine
This defines how much of your total capital (stake) is allocated to a single trade opening. In Freqtrade, this is set by the stake_amount or stake_percent parameters in your configuration or strategy. It is the primary defense against ruin. A common amateur error is sizing exclusively for profit, using statements like "stake_amount": 100. This is fatal as your account grows or shrinks; the fixed amount either risks too little to matter or, after losses, risks a crippling percentage. Dynamic sizing based on a percentage of your current wallet is non-negotiable.
Stop-Loss Configuration: The Mandatory Circuit Breaker
A stop-loss (SL) is not a suggestion, it is a pre-defined commitment to exit a losing trade. In Freqtrade, you set this with stoploss in your strategy (e.g., -0.02 for -2%). The stop-loss, combined with your position size, defines your maximum risk per trade in dollar terms. The calculation is critical: Risk ($) = Stake ($) x |Stop-Loss (%)|. If you stake $100 with a -5% SL, your max risk is $5. This is the number you must control. A tight stop-loss (e.g., -1%) with a large stake can risk the same amount as a wide stop-loss (e.g., -10%) with a small stake. The stop-loss must be justified by your strategy’s time frame and typical volatility, not wishful thinking.
Take-Profit and Risk/Reward Ratios
While Freqtrade allows trailing stop-losses and multiple take-profit (TP) levels, the foundational concept is the Risk/Reward (R/R) ratio. If your SL risks 2% of the stake, your primary TP should target a gain greater than 2%. A 1:1 R/R ratio requires a >50% win rate just to break even after fees. A strategy with a 35% win rate can be profitable if its R/R ratio is 1:3 or better. You define these in your strategy with minimal_roi and trailing_stop. The minimal_roi parameter is a dictionary, e.g., "0": 0.02, "30": 0.01, "60": 0 means: exit for +2% at any time, but if the trade lasts 30 minutes, only lock in +1%, and after 60 minutes, exit at any profit. This is not profit-taking at the end of the month; it’s a set of conditional circuit breakers built into the trade cycle.
Portfolio Allocation and Concurrent Trades
Your bankroll is further fractured by max_open_trades. This parameter limits how many positions can be open simultaneously. If you have stake_percent: 10% and max_open_trades: 10, you could theoretically have 100% of your capital deployed. This is often a terrible idea. You must consider correlation: during a market-wide downturn, all 10 correlated trades (e.g., all in major crypto pairs) can hit their stop-losses simultaneously, multiplying your single-trade risk. Conservative management treats max_open_trades as a diversification and drawdown control tool. A common rule is to ensure (stake_percent * max_open_trades) <= 30%. This leaves 70% of capital as dry powder to average down or weather sequential losses. For more on managing your capital for automated systems, read our Trading Bot Bankroll Management guide.
Freqtrade Position Sizing Models Comparison
The method you choose for stake_amount fundamentally changes your risk geometry and growth path.
| Model | Implementation in Freqtrade | Risk Profile | Capital Scaling | Best Use Case |
|---|---|---|---|---|
| Fixed Amount | "stake_amount": 100 |
Constant $ risk per trade. Risk percentage fluctuates wildly with account balance. | Poor. Risk becomes negligible as account grows. Risk becomes dangerously high after losses. | Simple testing of strategy logic with a fixed, small amount of disposable capital. Not for live trading. |
| Fixed Percentage (Vanilla) | "stake_percent": 2.0 |
Constant percentage risk per trade. Dollar risk scales directly with current equity. | Smooth and proportional. Profitable trades increase stake size; losses decrease it. This is the standard for most live traders. | The default for robust, long-term trading. Implements a natural “ratchet” that grows and protects capital. |
| Fixed Percentage (with Cap) | "stake_percent": 2.0 &Custom strategy code with custom_stake_amount. |
Constant percentage, but with a maximum absolute dollar stake. Limits exposure during large growth spurts. | Proportional until cap is hit, then fixed-dollar. Prevents over-concentration in single trades on large accounts. | Managing larger accounts (e.g., >$50k) where 2% ($1000) might exceed sensible liquidity for a given pair. |
| Kelly Criterion (Theoretical) | Requires custom code in custom_stake_amount using formula: f = win_rate - (loss_rate / (avg_profit / avg_loss)). |
Mathematically optimal for maximizing long-term growth. Can recommend dangerously high stakes (>25%) if edge is over-estimated. | Aggressive and volatile. A small error in estimating your strategy’s true edge leads to over-betting and ruin. | Academic ideal. In practice, use “Fractional Kelly” (e.g., 10-25% of the recommended stake) for robust real-world use. |
| Volatility-Adjusted | Custom code in custom_stake_amount. Uses ATR or recent volatility to size stake inversely (e.g., smaller stake in high volatility). |
Risk per trade is normalized across different pairs/conditions. Targets constant volatility risk instead of constant capital risk. | More consistent position sizing across a multi-pair portfolio. Reduces risk of a volatile asset dominating your drawdown. | Portfolios trading diverse assets with different inherent volatilities (e.g., combining BTC, ETH, and low-cap alts). |
You implement a custom sizing model by defining a custom_stake_amount function in your strategy. For example, a simple volatility-adjusted model:
from freqtrade.persistence import Trade
from freqtrade.strategy import IStrategy
import pandas as pd
import pandas_ta as ta
class MyStrategy(IStrategy):
# ... other parameters ...
def custom_stake_amount(self, pair: str, current_time, current_rate, proposed_stake, min_stake, max_stake, leverage, entry_tag, side, **kwargs):
# Get dataframe and calculate 14-period ATR
dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)
atr = dataframe['atr'].iloc[-1] if 'atr' in dataframe.columns else 0.01
# Base stake is 2% of current total wallet
total = self.wallets.get_total_stake_amount()
base_stake = total * 0.02
# Adjust: If ATR > 2% of price, reduce stake proportionally
price = current_rate
atr_percent = atr / price
if atr_percent > 0.02:
adjustment = 0.02 / atr_percent
base_stake = base_stake * adjustment
# Ensure within exchange limits
return max(min(base_stake, max_stake), min_stake)
Calibrating Your Strategy for the Real World: Backtest to Live
The backtest is a high-fidelity simulation, but it’s not reality. Your Freqtrade bankroll management strategy must be calibrated for the friction and randomness of live execution.
Backtest vs. Live Performance Discrepancies
| Factor | Backtest Assumption | Live Reality | Impact on Bankroll |
|---|---|---|---|
| Order Execution & Slippage | Orders are filled at the exact candle’s close (or open/high/low). No delay. |
Network latency, exchange API delays, and market liquidity cause slippage. Your entry and exit occur at worse prices. | Consistently erodes profits and exacerbates losses. A strategy with a 1% TP and -1% SL in backtest may become unprofitable due to effective 0.8% / -1.2% fills. |
| Liquidity & Order Book Depth | Infinite liquidity at the quoted price. | Real order books have limited depth. A $5000 market order moves the price more than a $100 order. Particularly severe for low-cap alts. | Position sizing must respect pair liquidity. A 5% stake on a $100k account ($5000) is too large for an alt with $10k bid depth, guaranteeing major slippage. |
| Funding Fees & Costs | Often ignored or simplified. | Perpetual futures strategies (if using Hyperliquid or other DEXs via Freqtrade) pay or receive funding fees every 8 hours. Spot trading pays maker/taker fees. | Fees compound. A high-frequency strategy with a 0.1% expected profit per trade is obliterated by 0.05% taker fees. You must backtest with fees enabled (--fee 0.001). For more detailed insights, explore our guide on Hyperliquid API Automation. |
| Psychological Discipline | The bot executes every signal perfectly, including painful stop-losses. | The operator may be tempted to manually intervene: disabling the bot, moving stops, or overriding trades due to fear/greed. | Usually catastrophic. The live system deviates from the tested model, breaking the statistical edge. The bankroll becomes subject to emotional, unmodeled risk. |
| Strategy Look-Ahead Bias | The strategy logic uses the entire candle (OHLC) for calculations at the candle’s close. |
You cannot know a candle’s high and low until it’s closed. Indicators calculated on close are fine, but using high/low for signals introduces bias. |
Overstates performance. A live bot cannot sell at a candle’s high if that high happened before the close signal. Results in false entries/exits and unexpected drawdowns. |
| Market Regime Change | The backtest period (e.g., 2023 bull market) represents a single regime. | Markets cycle between high volatility, low volatility, bullish, and bearish regimes. Your strategy will face conditions it was not optimized for. | Causes extended periods of drawdown (equity curve decay). Your bankroll must survive these periods without a total wipeout, requiring conservative initial sizing. |
The Dry-Run Crucible: Your Final Defense
Freqtrade’s Dry-Run mode (--dry-run) is the mandatory intermediate step between backtest and live trading. It uses your live configuration and connects to the exchange’s real-time data feed, executing simulated trades with your real strategy logic.
- Purpose: Discover discrepancies in order placement, fee calculation, and exchange specifics (like min/max trade sizes) without financial risk.
- What to Validate:
- Are orders being placed and filled at realistic prices? Check the logs.
- Does your
available_balancecalculation in the bot match your expectation after accounting for fees? - Does
max_open_tradeswork correctly with your trading pairs? - Are stop-loss and take-profit orders being submitted to the exchange correctly (visible as open orders in your exchange UI)?
- Duration: Run a Dry-Run for at least 1-2 weeks, or through a full market cycle of volatility if possible. Only go live when the Dry-Run executes flawlessly and its performance aligns (within a reasonable error margin) with your backtest’s expectations for the same period.
Building Your Live Trading Infrastructure: Beyond the Config File
Running a live Freqtrade bot is a systems engineering task. It’s not just freqtrade trade --strategy MyStrat --config config.json.
The Operational Stack
- VPS or Dedicated Server: Your bot must run 24/7. A home PC or laptop is insufficient. Use a reliable VPS provider (Hetzner, DigitalOcean, AWS EC2). A $5-$10/month instance is adequate for starters. For a guide to setting up your environment, see our article on Self-Hosted Freqtrade VPS Setup.
- Process Management: Don’t run Freqtrade in a terminal you might close. Use a process manager like
systemd(for Linux) ortmux/screen.- Example
systemdservice file (/etc/systemd/system/freqtrade.service):
[Unit] Description=Freqtrade Bot After=network.target [Service] Type=simple User=ubuntu WorkingDirectory=/home/ubuntu/freqtrade ExecStart=/home/ubuntu/freqtrade/.venv/bin/freqtrade trade --strategy MyStrategy --config config.json Restart=always RestartSec=10 [Install] WantedBy=multi-user.target - Example
- Monitoring & Alerting: Use Freqtrade’s built-in Telegram bot or APIs. You need alerts for: bot stopped, a series of consecutive losses, drawdown exceeding a threshold (e.g., -15% from peak), and any exchange errors.
- Data Management: For multi-timeframe strategies, Freqtrade downloads needed data. Ensure your VPS has enough storage (50-100GB). Consider using offline data with
--datadirfor faster strategy optimization.
Risk Controls at the Infrastructure Level
Your bankroll management doesn’t stop at the strategy. Enforce these external controls:
- Exchange-Level Limits: On your exchange account (Binance, Coinbase, etc.), set a daily withdrawal limit and disable margin/futures if not used. This is a last-ditch barrier against a catastrophic bug or hack. You should also be aware of API wallet security best practices.
- Separate Trading Capital: Fund your trading bot’s exchange account with only the capital you are willing to risk. Never link it to your main savings or cold storage wallet.
- Regular Withdrawals of Profits: Have a rule. For example, once your account balance grows 25% from its starting capital, withdraw the 25% profit. This physically removes risk capital from the automated system and secures gains.
- Circuit Breaker via API: Write a simple watchdog script that queries Freqtrade’s REST API (if enabled) to check the current drawdown. If drawdown exceeds X%, the script sends a command to stop the bot.
Case Study: Deploying a Conservative Strategy
Let’s walk through deploying a simple, mean-reversion strategy on 4 major crypto pairs with a strict bankroll architecture. This approach utilizes principles discussed in Bankroll Management for Trading Bots.
Strategy Logic (Conceptual): Buy (long) when the RSI(14) on the 1h chart dips below 30, with the price above the 200-period moving average. Sell when RSI crosses above 55 or stop-loss hits.
Bankroll & Configuration Parameters:
- Starting Capital: $10,000
- Position Sizing (
stake_percent): 1.5% - Stop-Loss (
stoploss): -3.0% - Max Open Trades (
max_open_trades): 4 - Minimal ROI (
minimal_roi):{"0": 0.02, "60": 0.015, "120": 0.01, "240": 0} - Trailing Stop (
trailing_stop):true,"trailing_stop_positive": 0.01 - Analysis:
- Risk per Trade: $10,000 * 0.015 = $150 stake. $150 * 0.03 = $4.50 max risk per trade.
- Max Portfolio Risk (all positions open): $150 * 4 = $600 deployed (6% of capital). Theoretical max loss if all 4 hit SL simultaneously: $4.50 * 4 = $18 (0.18% of total capital). This is low because our stake percent is small relative to our stop-loss.
- Win Rate Requirement: With a 3% SL and a 2% TP (first ROI target), we have a ~1:0.66 R/R ratio. This is not great, so the trailing stop and higher secondary ROI targets are critical. This strategy needs a high win rate (>60%) to be profitable, which is plausible for a mean-reversion setup in a trending context (the 200 MA filter).
Deployment Checklist:
- Backtest over 2 years of data, with fees set to 0.1%.
- Analyze the maximum drawdown (MDD) in the backtest. If MDD > 20%, reduce
stake_percent. - Run a 2-week Dry-Run. Confirm behavior matches backtest for the same period.
- Deploy live on VPS with
systemd, funding the exchange account with exactly $10,000. - Set a withdrawal rule: When account reaches $12,500, withdraw $2,500, resetting the working capital to ~$10,000.
Advanced Tactics: Risk-Of-Ruin and Drawdown Limits
As you scale, formalize your risk thresholds.
- Risk-of-Ruin (RoR): The probability of losing a critical portion of your bankroll (e.g., 50%) given your strategy’s win rate and risk-per-trade. Use an online calculator. For our case study: 1.5% stake, 3% SL = 0.045% of capital risked per trade. Even with a 50% win rate, the risk of a 50% drawdown is virtually zero. This is conservative.
- Maximum Acceptable Drawdown (MADD): Set a global, hard stop. This is not a per-trade stop-loss. If your total equity curve from peak to trough hits -20%, you stop the bot entirely for a mandatory review period. This prevents a “death by a thousand cuts” scenario from a strategy that has broken.
Common Freqtrade Bankroll Management Traps to Avoid
- Over-leveraging via
stake_percentandmax_open_trades: Settingstake_percent: 10andmax_open_trades: 10commits 100% of capital. One market event can trigger a cascade. - Ignoring Exchange Order Limits: An exchange has a minimum order size (e.g., $10 on Binance spot). If your 1% stake on a $500 account is $5, the order will fail.
- Curve-Fitting the Stop-Loss: Optimizing your
stoplossandminimal_roivalues to produce a stunning backtest profit. This leads to values like -0.5% SL and +0.6% TP that will be destroyed by live slippage and fees. - Failing to Account for
available_balance: Freqtrade’s stake is calculated from the total wallet, but open positions lock up margin. The bot can attempt to open a trade and fail ifavailable_balanceis insufficient. Use"dry_run_wallet": 10000in config to simulate a fixed balance and test this. - No Protocol for Strategy Decay: All strategies decay. Have a plan to evaluate performance monthly. Key metrics: Sharpe Ratio, Max Drawdown, and Win Rate. If they degrade significantly, pause and re-optimize. The dynamic nature of trading platforms and their features might impact strategy effectiveness; consider also reviewing trading bot platform comparisons periodically.
FAQ: Freqtrade Bankroll Management
What is the single most important parameter in Freqtrade bankroll management?
stake_percent. It directly controls what fraction of your capital is exposed in every single trade. Getting this wrong by even a few percentage points (e.g., using 5% instead of 2%) can increase your risk of ruin by orders of magnitude. It is the primary dial for risk.
How do I calculate my true risk per trade in Freqtrade?
True risk in dollar terms is current_wallet_balance * (stake_percent / 100) * abs(stoploss). If your wallet is $10,000, with stake_percent: 2 and stoploss: -0.03 (-3%), your risk is 10000 * 0.02 * 0.03 = $6. This is the amount you stand to lose if the trade hits its stop-loss perfectly, excluding slippage.
Should I use a fixed dollar amount or a percentage for stake size?
Almost always use a percentage (stake_percent). A fixed dollar amount becomes disconnected from your actual account size. A $100 stake on a $1000 account risks 10% per trade, which is enormous. That same $100 stake on a $50,000 account risks only 0.2%, which is trivial. Percentage-based sizing automatically adjusts your stake to your current capital, which is fundamental to proper money management.
How many concurrent trades (max_open_trades) should I allow?
This depends on your strategy’s diversification and your stake size. A conservative rule is to ensure (stake_percent * max_open_trades) does not exceed 20-30%. For a 2% stake, this suggests a maximum of 10-15 trades. In practice, if you’re trading highly correlated assets (like major crypto pairs), a much lower number like 3-5 is safer to prevent correlated drawdowns.
My backtest shows 50% returns. How much should I realistically expect live?
Expect significantly less. Start by mentally halving the backtest return to account for slippage, fees, and execution imperfections. If the backtest shows 50%, a 25% live return would be excellent. More importantly, expect the live drawdown to be 1.5x to 2x larger than the backtest suggests. Your bankroll must be sized to withstand this harsher reality.
When should I increase my stake percentage?
Only after a statistically significant period of live, profitable trading (e.g., 3-6 months) and after you have withdrawn your initial risk capital. Do not increase stake size simply because your account grew from profits; this is the “snowball” effect of percentage sizing already working. You might consider a small increase (e.g., from 1.5% to 2%) only if your risk models remain sound at the new, larger absolute dollar stakes.