From cfc22577bed042947d40cfa15676c1456aa6f7d4 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 25 Feb 2020 16:52:01 +0100 Subject: [PATCH 1/4] 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. From df49b98c2578a9d45c0a052f643d00e6fbba2bdd Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 26 Feb 2020 06:40:13 +0100 Subject: [PATCH 2/4] Implement wording-changes Co-Authored-By: hroff-1902 <47309513+hroff-1902@users.noreply.github.com> --- docs/strategy-customization.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/strategy-customization.md b/docs/strategy-customization.md index 0dfeb3978..acd985287 100644 --- a/docs/strategy-customization.md +++ b/docs/strategy-customization.md @@ -249,8 +249,8 @@ 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 ...) +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 From af4469f073501150c4aaa520fcd614ea18177fad Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 26 Feb 2020 06:43:15 +0100 Subject: [PATCH 3/4] Convert to str to avoid errors --- docs/strategy-customization.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/strategy-customization.md b/docs/strategy-customization.md index acd985287..fd40a971e 100644 --- a/docs/strategy-customization.md +++ b/docs/strategy-customization.md @@ -260,8 +260,8 @@ 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 + str(ticker_interval_mins * 3)): 0.02, # After 3 candles + str(ticker_interval_mins * 6)): 0.01, # After 6 candles } ``` From e5a9c81412b4a6846872fde59489203184244288 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 27 Feb 2020 14:04:12 +0100 Subject: [PATCH 4/4] Add 0 entry to enhanced ROI example --- docs/strategy-customization.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/strategy-customization.md b/docs/strategy-customization.md index fd40a971e..4aacd3af6 100644 --- a/docs/strategy-customization.md +++ b/docs/strategy-customization.md @@ -257,11 +257,12 @@ from freqtrade.exchange import timeframe_to_minutes class AwesomeStrategy(IStrategy): - ticker_interval = '1d' + ticker_interval = "1d" ticker_interval_mins = timeframe_to_minutes(ticker_interval) minimal_roi = { - str(ticker_interval_mins * 3)): 0.02, # After 3 candles - str(ticker_interval_mins * 6)): 0.01, # After 6 candles + "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 } ```