Merge pull request #2974 from freqtrade/enhance_roi_doc

Add timeframe_to_minutes to ROI documentation
This commit is contained in:
hroff-1902 2020-02-27 18:18:24 +03:00 committed by GitHub
commit c1c0b59223
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.