From 263992e71c7f6f968611ffdb6acfe8e2fd61b53e Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 17 Feb 2019 15:47:18 +0100 Subject: [PATCH 1/5] Set a realistic stoploss of 10% (not 30-50%) --- user_data/strategies/strategy001.py | 2 +- user_data/strategies/strategy002.py | 2 +- user_data/strategies/strategy003.py | 2 +- user_data/strategies/strategy004.py | 2 +- user_data/strategies/strategy005.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/user_data/strategies/strategy001.py b/user_data/strategies/strategy001.py index 91654ab..6390334 100644 --- a/user_data/strategies/strategy001.py +++ b/user_data/strategies/strategy001.py @@ -34,7 +34,7 @@ class strategy001(IStrategy): # Optimal stoploss designed for the strategy # This attribute will be overridden if the config file contains "stoploss" - stoploss = -0.3 + stoploss = -0.10 # Optimal ticker interval for the strategy ticker_interval = '5m' diff --git a/user_data/strategies/strategy002.py b/user_data/strategies/strategy002.py index a6d6966..102472d 100644 --- a/user_data/strategies/strategy002.py +++ b/user_data/strategies/strategy002.py @@ -31,7 +31,7 @@ class strategy002(IStrategy): # Optimal stoploss designed for the strategy # This attribute will be overridden if the config file contains "stoploss" - stoploss = -0.3 + stoploss = -0.10 # Optimal ticker interval for the strategy ticker_interval = '5m' diff --git a/user_data/strategies/strategy003.py b/user_data/strategies/strategy003.py index ccc3780..4e74652 100644 --- a/user_data/strategies/strategy003.py +++ b/user_data/strategies/strategy003.py @@ -31,7 +31,7 @@ class strategy003(IStrategy): # Optimal stoploss designed for the strategy # This attribute will be overridden if the config file contains "stoploss" - stoploss = -0.3 + stoploss = -0.10 # Optimal ticker interval for the strategy ticker_interval = '5m' diff --git a/user_data/strategies/strategy004.py b/user_data/strategies/strategy004.py index 6a72862..1e79617 100644 --- a/user_data/strategies/strategy004.py +++ b/user_data/strategies/strategy004.py @@ -30,7 +30,7 @@ class strategy004(IStrategy): # Optimal stoploss designed for the strategy # This attribute will be overridden if the config file contains "stoploss" - stoploss = -0.3 + stoploss = -0.10 # Optimal ticker interval for the strategy ticker_interval = '5m' diff --git a/user_data/strategies/strategy005.py b/user_data/strategies/strategy005.py index b174e97..845bca4 100644 --- a/user_data/strategies/strategy005.py +++ b/user_data/strategies/strategy005.py @@ -33,7 +33,7 @@ class Strategy005(IStrategy): # Optimal stoploss designed for the strategy # This attribute will be overridden if the config file contains "stoploss" - stoploss = -0.5 + stoploss = -0.10 # Optimal ticker interval for the strategy ticker_interval = '5m' From 0d301a4f49a54caac15005408ba4fc398a4a3550 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 17 Feb 2019 15:53:16 +0100 Subject: [PATCH 2/5] Update strategies to new format --- user_data/strategies/strategy001.py | 8 ++++---- user_data/strategies/strategy002.py | 8 ++++---- user_data/strategies/strategy003.py | 8 ++++---- user_data/strategies/strategy004.py | 8 ++++---- user_data/strategies/strategy005.py | 6 +++--- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/user_data/strategies/strategy001.py b/user_data/strategies/strategy001.py index 6390334..ac9b055 100644 --- a/user_data/strategies/strategy001.py +++ b/user_data/strategies/strategy001.py @@ -13,7 +13,7 @@ import freqtrade.vendor.qtpylib.indicators as qtpylib # Update this variable if you change the class name -class strategy001(IStrategy): +class Strategy001(IStrategy): """ Strategy 001 author@: Gerald Lonlas @@ -39,7 +39,7 @@ class strategy001(IStrategy): # Optimal ticker interval for the strategy ticker_interval = '5m' - def populate_indicators(self, dataframe: DataFrame) -> DataFrame: + def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """ Adds several different TA indicators to the given DataFrame @@ -58,7 +58,7 @@ class strategy001(IStrategy): return dataframe - def populate_buy_trend(self, dataframe: DataFrame) -> DataFrame: + def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """ Based on TA indicators, populates the buy signal for the given dataframe :param dataframe: DataFrame @@ -74,7 +74,7 @@ class strategy001(IStrategy): return dataframe - def populate_sell_trend(self, dataframe: DataFrame) -> DataFrame: + def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """ Based on TA indicators, populates the sell signal for the given dataframe :param dataframe: DataFrame diff --git a/user_data/strategies/strategy002.py b/user_data/strategies/strategy002.py index 102472d..e7e2452 100644 --- a/user_data/strategies/strategy002.py +++ b/user_data/strategies/strategy002.py @@ -10,7 +10,7 @@ import talib.abstract as ta import freqtrade.vendor.qtpylib.indicators as qtpylib import numpy # noqa -class strategy002(IStrategy): +class Strategy002(IStrategy): """ Strategy 002 author@: Gerald Lonlas @@ -36,7 +36,7 @@ class strategy002(IStrategy): # Optimal ticker interval for the strategy ticker_interval = '5m' - def populate_indicators(self, dataframe: DataFrame) -> DataFrame: + def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """ Adds several different TA indicators to the given DataFrame @@ -68,7 +68,7 @@ class strategy002(IStrategy): return dataframe - def populate_buy_trend(self, dataframe: DataFrame) -> DataFrame: + def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """ Based on TA indicators, populates the buy signal for the given dataframe :param dataframe: DataFrame @@ -85,7 +85,7 @@ class strategy002(IStrategy): return dataframe - def populate_sell_trend(self, dataframe: DataFrame) -> DataFrame: + def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """ Based on TA indicators, populates the sell signal for the given dataframe :param dataframe: DataFrame diff --git a/user_data/strategies/strategy003.py b/user_data/strategies/strategy003.py index 4e74652..7dce883 100644 --- a/user_data/strategies/strategy003.py +++ b/user_data/strategies/strategy003.py @@ -10,7 +10,7 @@ import talib.abstract as ta import freqtrade.vendor.qtpylib.indicators as qtpylib import numpy # noqa -class strategy003(IStrategy): +class Strategy003(IStrategy): """ Strategy 003 author@: Gerald Lonlas @@ -36,7 +36,7 @@ class strategy003(IStrategy): # Optimal ticker interval for the strategy ticker_interval = '5m' - def populate_indicators(self, dataframe: DataFrame) -> DataFrame: + def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """ Adds several different TA indicators to the given DataFrame @@ -78,7 +78,7 @@ class strategy003(IStrategy): return dataframe - def populate_buy_trend(self, dataframe: DataFrame) -> DataFrame: + def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """ Based on TA indicators, populates the buy signal for the given dataframe :param dataframe: DataFrame @@ -102,7 +102,7 @@ class strategy003(IStrategy): return dataframe - def populate_sell_trend(self, dataframe: DataFrame) -> DataFrame: + def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """ Based on TA indicators, populates the sell signal for the given dataframe :param dataframe: DataFrame diff --git a/user_data/strategies/strategy004.py b/user_data/strategies/strategy004.py index 1e79617..3b35290 100644 --- a/user_data/strategies/strategy004.py +++ b/user_data/strategies/strategy004.py @@ -8,7 +8,7 @@ from pandas import DataFrame import talib.abstract as ta -class strategy004(IStrategy): +class Strategy004(IStrategy): """ Strategy 004 @@ -35,7 +35,7 @@ class strategy004(IStrategy): # Optimal ticker interval for the strategy ticker_interval = '5m' - def populate_indicators(self, dataframe: DataFrame) -> DataFrame: + def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """ Adds several different TA indicators to the given DataFrame @@ -72,7 +72,7 @@ class strategy004(IStrategy): return dataframe - def populate_buy_trend(self, dataframe: DataFrame) -> DataFrame: + def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """ Based on TA indicators, populates the buy signal for the given dataframe :param dataframe: DataFrame @@ -102,7 +102,7 @@ class strategy004(IStrategy): return dataframe - def populate_sell_trend(self, dataframe: DataFrame) -> DataFrame: + def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """ Based on TA indicators, populates the sell signal for the given dataframe :param dataframe: DataFrame diff --git a/user_data/strategies/strategy005.py b/user_data/strategies/strategy005.py index 845bca4..ba48c78 100644 --- a/user_data/strategies/strategy005.py +++ b/user_data/strategies/strategy005.py @@ -38,7 +38,7 @@ class Strategy005(IStrategy): # Optimal ticker interval for the strategy ticker_interval = '5m' - def populate_indicators(self, dataframe: DataFrame) -> DataFrame: + def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """ Adds several different TA indicators to the given DataFrame @@ -80,7 +80,7 @@ class Strategy005(IStrategy): return dataframe - def populate_buy_trend(self, dataframe: DataFrame) -> DataFrame: + def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """ Based on TA indicators, populates the buy signal for the given dataframe :param dataframe: DataFrame @@ -102,7 +102,7 @@ class Strategy005(IStrategy): return dataframe - def populate_sell_trend(self, dataframe: DataFrame) -> DataFrame: + def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """ Based on TA indicators, populates the sell signal for the given dataframe :param dataframe: DataFrame From 868f2cd1389926183502f8230b4ad3a829ea8df8 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 17 Feb 2019 15:53:58 +0100 Subject: [PATCH 3/5] Rename files to align name --- user_data/strategies/{strategy001.py => Strategy001.py} | 0 user_data/strategies/{strategy002.py => Strategy002.py} | 0 user_data/strategies/{strategy003.py => Strategy003.py} | 0 user_data/strategies/{strategy004.py => Strategy004.py} | 0 user_data/strategies/{strategy005.py => Strategy005.py} | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename user_data/strategies/{strategy001.py => Strategy001.py} (100%) rename user_data/strategies/{strategy002.py => Strategy002.py} (100%) rename user_data/strategies/{strategy003.py => Strategy003.py} (100%) rename user_data/strategies/{strategy004.py => Strategy004.py} (100%) rename user_data/strategies/{strategy005.py => Strategy005.py} (100%) diff --git a/user_data/strategies/strategy001.py b/user_data/strategies/Strategy001.py similarity index 100% rename from user_data/strategies/strategy001.py rename to user_data/strategies/Strategy001.py diff --git a/user_data/strategies/strategy002.py b/user_data/strategies/Strategy002.py similarity index 100% rename from user_data/strategies/strategy002.py rename to user_data/strategies/Strategy002.py diff --git a/user_data/strategies/strategy003.py b/user_data/strategies/Strategy003.py similarity index 100% rename from user_data/strategies/strategy003.py rename to user_data/strategies/Strategy003.py diff --git a/user_data/strategies/strategy004.py b/user_data/strategies/Strategy004.py similarity index 100% rename from user_data/strategies/strategy004.py rename to user_data/strategies/Strategy004.py diff --git a/user_data/strategies/strategy005.py b/user_data/strategies/Strategy005.py similarity index 100% rename from user_data/strategies/strategy005.py rename to user_data/strategies/Strategy005.py From 98cc7cab5b513317811b6901dae2122d25466f42 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 17 Feb 2019 15:58:45 +0100 Subject: [PATCH 4/5] Reference official documentation --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 14041a3..f758137 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ bot. - [How to create/optimize a strategy?](https://github.com/freqtrade/freqtrade/blob/develop/docs/bot-optimization.md) ## Free trading strategies + Value below are result from backtesting from 2018-01-10 to 2018-01-30 and `experimental.sell_profit_only` enabled. More detail on each strategy page. @@ -48,12 +49,14 @@ Strategies from this repo are free to use. Feel free to update them. Most of them were designed from Hyperopt calculations. ## Share your own strategies and contribute to this repo + Feel free to send your strategies, comments, optimizations and pull requests via an [Issue ticket](https://github.com/freqtrade/freqtrade-strategies/issues/new). ## FAQ ### What is Freqtrade? + [Freqtrade](https://github.com/freqtrade) is a Simple High frequency trading bot for crypto currencies designed to support @@ -80,8 +83,7 @@ enabled and disabled. ### How to install a strategy? -First you need a [working Freqtrade](https://github.com/freqtrade/freqtrade/blob/develop/docs/index.md) -in version >= 0.16.0. +First you need a [working Freqtrade](https://freqtrade.io) in version >= 0.16.0. Once you have the bot on the right version, follow this steps: @@ -91,6 +93,8 @@ Once you have the bot on the right version, follow this steps: 3. Paste it into your `user_data/strategies` folder 4. Run the bot with the parameter `-s ` (ex: `python3 ./freqtrade/main.py -s Strategy001`) +[More information](https://www.freqtrade.io/en/latest/bot-optimization/) + ### How to test a strategy? Let assume you have selected the strategy `strategy001.py`: From 0ff6cb1d89c83bbacd0f2fe0052288e46e4bb39d Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 17 Feb 2019 16:06:39 +0100 Subject: [PATCH 5/5] Update strategies with latest parameters --- README.md | 13 +++++++------ user_data/strategies/Strategy001.py | 24 ++++++++++++++++++++++++ user_data/strategies/Strategy002.py | 24 ++++++++++++++++++++++++ user_data/strategies/Strategy003.py | 24 ++++++++++++++++++++++++ user_data/strategies/Strategy004.py | 24 ++++++++++++++++++++++++ user_data/strategies/Strategy005.py | 24 ++++++++++++++++++++++++ 6 files changed, 127 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f758137..af65ea2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Freqtrade strategies -This Git repo contains free buy/sell strategies for [Freqtrade](https://github.com/freqtrade/freqtrade) >= `0.16.0`. +This Git repo contains free buy/sell strategies for [Freqtrade](https://github.com/freqtrade/freqtrade). ## Disclaimer @@ -48,6 +48,9 @@ page. Strategies from this repo are free to use. Feel free to update them. Most of them were designed from Hyperopt calculations. +Some only work in specific market conditions, while others are more "general purpose" strategies. +It's noteworthy that depending on the exchange and Pairs used, further optimization can bring better results. + ## Share your own strategies and contribute to this repo Feel free to send your strategies, comments, optimizations and pull requests via an @@ -83,7 +86,7 @@ enabled and disabled. ### How to install a strategy? -First you need a [working Freqtrade](https://freqtrade.io) in version >= 0.16.0. +First you need a [working Freqtrade](https://freqtrade.io). Once you have the bot on the right version, follow this steps: @@ -111,12 +114,10 @@ python3 ./freqtrade/main.py -s Strategy001 backtesting python3 ./freqtrade/main.py -s Strategy001 backtesting --refresh-pairs-cached ``` +*Note:* Generally, it's recommendet to use static backtest data (from a defined period of time) for compareable results. + #### Test with live data ```bash python3 ./freqtrade/main.py -s Strategy001 backtesting --live ``` - -## Can I have your configuration file? - -You will find them into [user_data/](https://github.com/freqtrade/freqtrade-strategies/tree/master/user_data) folder. diff --git a/user_data/strategies/Strategy001.py b/user_data/strategies/Strategy001.py index ac9b055..a58fc68 100644 --- a/user_data/strategies/Strategy001.py +++ b/user_data/strategies/Strategy001.py @@ -39,6 +39,30 @@ class Strategy001(IStrategy): # Optimal ticker interval for the strategy ticker_interval = '5m' + # trailing stoploss + trailing_stop = False + trailing_stop_positive = 0.01 + trailing_stop_positive_offset = 0.02 + + # Optimal ticker interval for the strategy + ticker_interval = '5m' + + # run "populate_indicators" only for new candle + ta_on_candle = False + + # Experimental settings (configuration will overide these if set) + use_sell_signal = True + sell_profit_only = True + ignore_roi_if_buy_signal = False + + # Optional order type mapping + order_types = { + 'buy': 'limit', + 'sell': 'limit', + 'stoploss': 'market', + 'stoploss_on_exchange': False + } + def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """ Adds several different TA indicators to the given DataFrame diff --git a/user_data/strategies/Strategy002.py b/user_data/strategies/Strategy002.py index e7e2452..3c2ced5 100644 --- a/user_data/strategies/Strategy002.py +++ b/user_data/strategies/Strategy002.py @@ -36,6 +36,30 @@ class Strategy002(IStrategy): # Optimal ticker interval for the strategy ticker_interval = '5m' + # trailing stoploss + trailing_stop = False + trailing_stop_positive = 0.01 + trailing_stop_positive_offset = 0.02 + + # Optimal ticker interval for the strategy + ticker_interval = '5m' + + # run "populate_indicators" only for new candle + ta_on_candle = False + + # Experimental settings (configuration will overide these if set) + use_sell_signal = True + sell_profit_only = True + ignore_roi_if_buy_signal = False + + # Optional order type mapping + order_types = { + 'buy': 'limit', + 'sell': 'limit', + 'stoploss': 'market', + 'stoploss_on_exchange': False + } + def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """ Adds several different TA indicators to the given DataFrame diff --git a/user_data/strategies/Strategy003.py b/user_data/strategies/Strategy003.py index 7dce883..c369ba6 100644 --- a/user_data/strategies/Strategy003.py +++ b/user_data/strategies/Strategy003.py @@ -36,6 +36,30 @@ class Strategy003(IStrategy): # Optimal ticker interval for the strategy ticker_interval = '5m' + # trailing stoploss + trailing_stop = False + trailing_stop_positive = 0.01 + trailing_stop_positive_offset = 0.02 + + # Optimal ticker interval for the strategy + ticker_interval = '5m' + + # run "populate_indicators" only for new candle + ta_on_candle = False + + # Experimental settings (configuration will overide these if set) + use_sell_signal = True + sell_profit_only = True + ignore_roi_if_buy_signal = False + + # Optional order type mapping + order_types = { + 'buy': 'limit', + 'sell': 'limit', + 'stoploss': 'market', + 'stoploss_on_exchange': False + } + def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """ Adds several different TA indicators to the given DataFrame diff --git a/user_data/strategies/Strategy004.py b/user_data/strategies/Strategy004.py index 3b35290..ab6509e 100644 --- a/user_data/strategies/Strategy004.py +++ b/user_data/strategies/Strategy004.py @@ -35,6 +35,30 @@ class Strategy004(IStrategy): # Optimal ticker interval for the strategy ticker_interval = '5m' + # trailing stoploss + trailing_stop = False + trailing_stop_positive = 0.01 + trailing_stop_positive_offset = 0.02 + + # Optimal ticker interval for the strategy + ticker_interval = '5m' + + # run "populate_indicators" only for new candle + ta_on_candle = False + + # Experimental settings (configuration will overide these if set) + use_sell_signal = True + sell_profit_only = True + ignore_roi_if_buy_signal = False + + # Optional order type mapping + order_types = { + 'buy': 'limit', + 'sell': 'limit', + 'stoploss': 'market', + 'stoploss_on_exchange': False + } + def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """ Adds several different TA indicators to the given DataFrame diff --git a/user_data/strategies/Strategy005.py b/user_data/strategies/Strategy005.py index ba48c78..b9ed18a 100644 --- a/user_data/strategies/Strategy005.py +++ b/user_data/strategies/Strategy005.py @@ -38,6 +38,30 @@ class Strategy005(IStrategy): # Optimal ticker interval for the strategy ticker_interval = '5m' + # trailing stoploss + trailing_stop = False + trailing_stop_positive = 0.01 + trailing_stop_positive_offset = 0.02 + + # Optimal ticker interval for the strategy + ticker_interval = '5m' + + # run "populate_indicators" only for new candle + ta_on_candle = False + + # Experimental settings (configuration will overide these if set) + use_sell_signal = True + sell_profit_only = True + ignore_roi_if_buy_signal = False + + # Optional order type mapping + order_types = { + 'buy': 'limit', + 'sell': 'limit', + 'stoploss': 'market', + 'stoploss_on_exchange': False + } + def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """ Adds several different TA indicators to the given DataFrame