make defining period intervals more user friendly and flexible

This commit is contained in:
robcaulk 2022-06-02 13:45:29 +02:00
parent ace951bf7e
commit 4ac6ef2972
3 changed files with 3 additions and 5 deletions

View File

@ -82,7 +82,7 @@
"use_SVM_to_remove_outliers": true, "use_SVM_to_remove_outliers": true,
"stratify": 0, "stratify": 0,
"indicator_max_period": 20, "indicator_max_period": 20,
"indicator_interval": 10 "indicator_periods": [10, 20, 30]
}, },
"data_split_parameters": { "data_split_parameters": {
"test_size": 0.33, "test_size": 0.33,

View File

@ -77,7 +77,7 @@
"use_SVM_to_remove_outliers": false, "use_SVM_to_remove_outliers": false,
"stratify": 0, "stratify": 0,
"indicator_max_period": 50, "indicator_max_period": 50,
"indicator_interval": 10 "indicator_periods": [10, 20]
}, },
"data_split_parameters": { "data_split_parameters": {
"test_size": 0.33, "test_size": 0.33,

View File

@ -1,7 +1,6 @@
import logging import logging
from functools import reduce from functools import reduce
import numpy as np
import pandas as pd import pandas as pd
import talib.abstract as ta import talib.abstract as ta
from pandas import DataFrame from pandas import DataFrame
@ -90,8 +89,7 @@ class FreqaiExampleStrategy(IStrategy):
informative = self.dp.get_pair_dataframe(pair, tf) informative = self.dp.get_pair_dataframe(pair, tf)
# first loop is automatically duplicating indicators for time periods # first loop is automatically duplicating indicators for time periods
for t in np.arange(10, self.freqai_info["feature_parameters"]["indicator_max_period"], for t in self.freqai_info["feature_parameters"]["indicator_periods"]:
self.freqai_info["feature_parameters"]["indicator_interval"]):
t = int(t) t = int(t)
informative['%-' + coin + "rsi-period_" + str(t)] = ta.RSI(informative, timeperiod=t) informative['%-' + coin + "rsi-period_" + str(t)] = ta.RSI(informative, timeperiod=t)