From cfc22577bed042947d40cfa15676c1456aa6f7d4 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 25 Feb 2020 16:52:01 +0100 Subject: [PATCH] Add timeframe_to_minutes to ROI documentation --- docs/strategy-customization.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/strategy-customization.md b/docs/strategy-customization.md index 07833da34..0dfeb3978 100644 --- a/docs/strategy-customization.md +++ b/docs/strategy-customization.md @@ -249,6 +249,22 @@ minimal_roi = { While technically not completely disabled, this would sell once the trade reaches 10000% Profit. +To use times based on candles, the following snippet can be handy. +This will allow you to change the ticket_interval, and ROI will 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 = { + (ticker_interval_mins * 3): 0.02, # After 3 candles + (ticker_interval_mins * 6): 0.01, # After 6 candles + } +``` + ### Stoploss Setting a stoploss is highly recommended to protect your capital from strong moves against you.