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 • Originally published at itrade.icu

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 allocated, 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, real-world strategy guides, indicator breakdowns, and more โ€” helping you master quant trading skills with ease!

๐Ÿช™ 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 in your account.
  • In futures mode, it sets the denomination for contract margin. โœ… Practical Tip:
  • Most strategies use "USDT" as stake_currency โ€” it's more universal and stable.
  • If you only hold BTC and want to trade other pairs directly with it, 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 size may vary slightly due to price/position adjustments.
  • Easier risk control with higher consistency between backtests and live trading.

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, ideal for larger capital or complex strategy scheduling. โš ๏ธ Note:
  • In futures accounts, ensure proper leverage is set on the exchange โ€” Freqtrade's stake_amount does not auto-manage leverage.
  • When using multi-pair or multi-position strategies, pay close attention to position management to avoid depleting the entire 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".
  • Caps usage at 95% of account balance for opening positions, reserving 5% as a buffer.
  • Prevents "running out of funds," avoiding failed subsequent orders.
  • ๐Ÿ“Œ Example:
    • Account balance: 1000 USDT, ratio = 0.95 โ†’ strategy uses at most 950 USDT for positions.
  • โœ… Recommended Values:
    • Generally 0.90 ~ 0.98;
    • The more conservative, the better protection against liquidation or insufficient margin.

๐Ÿ›ก๏ธ Live Trading Risk Control Recommendations

Control Point Suggested Config Reason
Initial Testing "stake_amount": 50~100 Fixed amounts are more stable for observing strategy performance
Batch Trading Pair with "max_open_trades" limit Prevents too many simultaneous positions, avoiding fund dispersion and risk runaway
Account Safety Set tradable_balance_ratio < 1.0 Reserves buffer for fees or emergencies
Leverage Mode Dynamically control position size or enable liquidation_buffer Avoids full-margin leverage liquidation and liquidity crashes

โœ… Example Configuration Combo

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

This means:

  • Trade using USDT;
  • No fixed per-trade amount, but never exceed 90% of total balance;
  • Skip trades under 10 USDT;
  • Best for intermediate/advanced users with integrated risk controls.

โœ… Summary Checklist

Parameter Description Recommended Value / Tip
stake_currency Currency used for trading (buying) "USDT" most common
stake_amount Per-trade amount: fixed or "unlimited" Beginners: fixed; Experts: dynamic
tradable_balance_ratio Caps max account usage to avoid full balance or margin exhaustion 0.9 ~ 0.98

Treat these settings as your baseline capital safety net before going live. No matter how good the strategy, always defend the "bottom line" of fund control.

Top comments (0)