Sell When Up? Cut When Down? Unlocking Freqtrade’s Entry & Exit Logic
This article was produced by the Quantitative Trading Lab at https://www.itrade.icu. Visit for more benefits. In a
Freqtradestrategy, entry and exit rules are the backbone of performance. Properly configuring take-profit, stoploss, and exit signals significantly improves both profitability and risk management. This guide focuses on the core parameters controlling entries, exits, and stop management.
🎯 minimal_roi — Time-Based Take-Profit
minimal_roi — Time-Based Take-Profitminimal_roi defines the minimum return thresholds based on holding time. Once the threshold is reached, the bot takes profit automatically.
minimal_roi = {
"30": 0.01, # After 30 min, take profit at +1%
"20": 0.02, # After 20 min, take profit at +2%
"0": 0.04 # Immediately take profit if +4% is hit
}Unit: minutes
ROI maps time → required profit percentage
Triggered automatically, with higher priority than custom exit signals
🛑 stoploss — Fixed Loss Threshold
stoploss — Fixed Loss ThresholdDefines a hard stop for trades once losses reach a set percentage.
stoploss = -0.10 # Stop out at -10%Protects capital by preventing uncontrolled losses
Works with market orders for quick execution
Acts as a safety net when combined with
trailing_stop
🚪 use_exit_signal — Enable Custom Exit Signals
use_exit_signal — Enable Custom Exit SignalsControls whether populate_exit_trend is used for sell signals.
True: Strategy uses signals frompopulate_exit_trend(exit_long/exit_short)False: Ignores custom exit signals; exits only via ROI or stoplossUseful for strategies requiring fine-grained exit logic
💰 exit_profit_only — Exit Only in Profit
exit_profit_only — Exit Only in ProfitPrevents exit signals from triggering when a trade is losing.
Applies only to
populate_exit_trendsignalsIf profitable → exit signals work as normal
If losing → exit signals ignored (but stoploss / ROI still apply)
Does not block:
custom_exit()logicHard stoploss
ROI-based exits
Example
+5%
✅
✅ Yes
+1%
✅
✅ Yes
-3%
✅
❌ No
-10%
❌
❌ No
🎚️ exit_profit_offset — Profit Offset Threshold
exit_profit_offset — Profit Offset ThresholdAdds a minimum profit requirement before exit signals trigger.
Works with
exit_profit_onlyPrevents premature exits at near-zero profit
Helps maximize upside before selling
🧠 Example Strategy Snippet
⚙️ use_custom_stoploss — Dynamic Stoploss
use_custom_stoploss — Dynamic StoplossEnables fully customizable stoploss logic via custom_stoploss().
⚠️ Notes:
Only affects stoploss behavior, not take-profit
Fixed
stoplossis ignored once enabledMust return a negative float (e.g.,
-0.05)
✅ Quick Reference
minimal_roi
Time-based take-profit rules
Strategy-dependent
stoploss
Fixed loss threshold
-0.10 (10%)
use_exit_signal
Enable custom exit signals
True
exit_profit_only
Only sell if profitable
False or True as needed
exit_profit_offset
Profit buffer before exiting
0.01 (1%) typical
use_custom_stoploss
Enable dynamic stoploss
False by default, enable if needed
Last updated