From 4ac6ef2972a56a8213ba2c21c139b8e25043efe1 Mon Sep 17 00:00:00 2001 From: robcaulk Date: Thu, 2 Jun 2022 13:45:29 +0200 Subject: [PATCH] make defining period intervals more user friendly and flexible --- config_examples/config_freqai_futures.example.json | 2 +- config_examples/config_freqai_spot.example.json | 2 +- freqtrade/templates/FreqaiExampleStrategy.py | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/config_examples/config_freqai_futures.example.json b/config_examples/config_freqai_futures.example.json index 55217ee0c..30eb6fc3e 100644 --- a/config_examples/config_freqai_futures.example.json +++ b/config_examples/config_freqai_futures.example.json @@ -82,7 +82,7 @@ "use_SVM_to_remove_outliers": true, "stratify": 0, "indicator_max_period": 20, - "indicator_interval": 10 + "indicator_periods": [10, 20, 30] }, "data_split_parameters": { "test_size": 0.33, diff --git a/config_examples/config_freqai_spot.example.json b/config_examples/config_freqai_spot.example.json index 5ba0615d2..7ff01cc07 100644 --- a/config_examples/config_freqai_spot.example.json +++ b/config_examples/config_freqai_spot.example.json @@ -77,7 +77,7 @@ "use_SVM_to_remove_outliers": false, "stratify": 0, "indicator_max_period": 50, - "indicator_interval": 10 + "indicator_periods": [10, 20] }, "data_split_parameters": { "test_size": 0.33, diff --git a/freqtrade/templates/FreqaiExampleStrategy.py b/freqtrade/templates/FreqaiExampleStrategy.py index bc1aba361..d9dc38f0d 100644 --- a/freqtrade/templates/FreqaiExampleStrategy.py +++ b/freqtrade/templates/FreqaiExampleStrategy.py @@ -1,7 +1,6 @@ import logging from functools import reduce -import numpy as np import pandas as pd import talib.abstract as ta from pandas import DataFrame @@ -90,8 +89,7 @@ class FreqaiExampleStrategy(IStrategy): informative = self.dp.get_pair_dataframe(pair, tf) # first loop is automatically duplicating indicators for time periods - for t in np.arange(10, self.freqai_info["feature_parameters"]["indicator_max_period"], - self.freqai_info["feature_parameters"]["indicator_interval"]): + for t in self.freqai_info["feature_parameters"]["indicator_periods"]: t = int(t) informative['%-' + coin + "rsi-period_" + str(t)] = ta.RSI(informative, timeperiod=t)