DEV Community

Cover image for Episode 10: 💥 Stop Going All-In and Getting Liquidated! Master Freqtrade's Capital Allocation to Survive Longer
itrade icu
itrade icu

Posted on

Episode 10: 💥 Stop Going All-In and Getting Liquidated! Master Freqtrade's Capital Allocation to Survive Longer

Episode 10: 💥 Stop Going All-In and Getting Liquidated! Master Freqtrade's Capital Allocation to Survive Longer

In Freqtrade, capital allocation is the foundation of all strategy operations. Whether in spot or futures trading, parameters like stake_currency, stake_amount, and tradable_balance_ratio determine the currency used per trade, the amount of funds, and how account risk is controlled.

Proper configuration ensures stable and safe strategy execution; poor setup can lead to order failures or liquidation, impacting live trading.


🚀 Want to Learn Quantitative Trading?

👉 Click to visit: https://www.itrade.icu
Here you'll find Freqtrade beginner tutorials, strategy combat, indicator analysis, and more rich content to help you easily master quantitative trading skills!


🪙 stake_currency — The Trading Currency Used

"stake_currency": "USDT"
Enter fullscreen mode Exit fullscreen mode
  • Specifies the base currency used for buying in each trade.
  • Common options: "USDT", "BTC", "ETH", etc.
  • In spot trading, this determines the asset type you need to prepare in your account.
  • In futures mode, it also determines the pricing unit for contract margins. ✅ Practical Advice:
  • Most strategies use "USDT" as stake_currency—it's more universal and stable.
  • If you only hold BTC and want to trade other coins directly with BTC, switch to "BTC".

💵 stake_amount — Investment Amount per Trade

Can be set as:

1️⃣ Fixed Value (Recommended for Beginners)

"stake_amount": 100
Enter fullscreen mode Exit fullscreen mode
  • Each trade uses up to 100 USDT; actual order amounts may vary slightly due to price/position adjustments.
  • Easier risk control with higher consistency between backtesting and live results.

2️⃣ Dynamic Value "unlimited"

"stake_amount": "unlimited"
Enter fullscreen mode Exit fullscreen mode
  • The system automatically uses available account balance (limited by tradable_balance_ratio below).
  • More flexible, suitable for larger funds or complex strategy scheduling. ⚠️ Note:
  • For futures accounts, ensure reasonable leverage is set on the exchange—Freqtrade's stake_amount does not automatically control leverage.
  • When using multi-pair or multi-position strategies, pay special attention to position management to avoid depleting account balance.

🧮 tradable_balance_ratio — Balance Usage Ratio Limit

"tradable_balance_ratio": 0.95
Enter fullscreen mode Exit fullscreen mode
  • Only effective when stake_amount: "unlimited".
  • Means at most 95% of account balance is used for opening positions, reserving 5% as buffer.
  • Primary role: Prevent "using up balance" to avoid subsequent signal order failures.
  • 📌 Example:
    • Account balance 1000 USDT, ratio = 0.95 → Strategy uses at most 950 USDT for positions.
  • ✅ Recommended Values:
    • Generally set to 0.90 ~ 0.98;
    • The more conservative, the better it prevents liquidation or insufficient margin.

🛡️ Live Trading Risk Control Recommendations

Control Point Suggested Configuration Reason
Initial Testing "stake_amount": 50~100 Fixed amounts are more stable, easier to observe strategy performance
Batch Trading Pair with "max_open_trades" to limit positions Prevent too many simultaneous positions, fund dispersion, and risk out of control
Account Safety Set tradable_balance_ratio < 1.0 Reserve buffer balance to prevent liquidation or insufficient fees
Leverage Mode Dynamically control positions or enable liquidation_buffer Prevent full-margin leverage liquidation and liquidity crashes

✅ Example Configuration Combination

"stake_currency": "USDT",
"stake_amount": "unlimited",
"tradable_balance_ratio": 0.9,
Enter fullscreen mode Exit fullscreen mode

This configuration means:

  • Trade using USDT;
  • No fixed amount per order, but not exceeding 90% of total balance;
  • Skip orders below 10 USDT;
  • More suitable for intermediate/advanced users with flexible risk control strategies.

✅ Summary Checklist

Parameter Name Description Recommended Value / Advice
stake_currency Currency used for trading (buying) "USDT" most common
stake_amount Amount per trade: fixed or "unlimited" Beginners use fixed value; experts use dynamic
tradable_balance_ratio Limits max account usage ratio to avoid full positions or depleting margin 0.9 ~ 0.98

Use these configurations as your basic capital safety line before going live. No matter how good the strategy, always guard the "bottom line" of capital control.

Top comments (0)