mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Merge pull request #2974 from freqtrade/enhance_roi_doc
Add timeframe_to_minutes to ROI documentation
This commit is contained in:
commit
c1c0b59223
|
@ -249,6 +249,23 @@ minimal_roi = {
|
|||
|
||||
While technically not completely disabled, this would sell once the trade reaches 10000% Profit.
|
||||
|
||||
To use times based on candle duration (ticker_interval or timeframe), the following snippet can be handy.
|
||||
This will allow you to change the ticket_interval for the strategy, and ROI times will still be set as candles (e.g. after 3 candles ...)
|
||||
|
||||
``` python
|
||||
from freqtrade.exchange import timeframe_to_minutes
|
||||
|
||||
class AwesomeStrategy(IStrategy):
|
||||
|
||||
ticker_interval = "1d"
|
||||
ticker_interval_mins = timeframe_to_minutes(ticker_interval)
|
||||
minimal_roi = {
|
||||
"0": 0.05, # 5% for the first 3 candles
|
||||
str(ticker_interval_mins * 3)): 0.02, # 2% after 3 candles
|
||||
str(ticker_interval_mins * 6)): 0.01, # 1% After 6 candles
|
||||
}
|
||||
```
|
||||
|
||||
### Stoploss
|
||||
|
||||
Setting a stoploss is highly recommended to protect your capital from strong moves against you.
|
||||
|
|
Loading…
Reference in New Issue
Block a user