From f8f25e36efd63e42041bceb7ec3ddcb2b1ab1c4f Mon Sep 17 00:00:00 2001 From: robcaulk Date: Tue, 7 Jun 2022 19:54:45 +0200 Subject: [PATCH] update example config/strat --- config_examples/config_freqai_futures.example.json | 10 +++++----- freqtrade/templates/FreqaiExampleStrategy.py | 9 +++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/config_examples/config_freqai_futures.example.json b/config_examples/config_freqai_futures.example.json index 30eb6fc3e..e5207a906 100644 --- a/config_examples/config_freqai_futures.example.json +++ b/config_examples/config_freqai_futures.example.json @@ -66,8 +66,8 @@ "1h" ], "train_period": 20, - "backtest_period": 2, - "identifier": "example2", + "backtest_period": 0.001, + "identifier": "constant_retrain_live", "live_trained_timestamp": 0, "corr_pairlist": [ "BTC/USDT:USDT", @@ -76,20 +76,20 @@ "feature_parameters": { "period": 20, "shift": 2, - "DI_threshold": 0, + "DI_threshold": 0.9, "weight_factor": 0.9, "principal_component_analysis": false, "use_SVM_to_remove_outliers": true, "stratify": 0, "indicator_max_period": 20, - "indicator_periods": [10, 20, 30] + "indicator_periods": [10, 20] }, "data_split_parameters": { "test_size": 0.33, "random_state": 1 }, "model_training_parameters": { - "n_estimators": 200, + "n_estimators": 1000, "task_type": "CPU" } }, diff --git a/freqtrade/templates/FreqaiExampleStrategy.py b/freqtrade/templates/FreqaiExampleStrategy.py index 1aaf63dcf..608f24239 100644 --- a/freqtrade/templates/FreqaiExampleStrategy.py +++ b/freqtrade/templates/FreqaiExampleStrategy.py @@ -47,7 +47,7 @@ class FreqaiExampleStrategy(IStrategy): stoploss = -0.05 use_exit_signal = True startup_candle_count: int = 300 - can_short = False + can_short = True linear_roi_offset = DecimalParameter(0.00, 0.02, default=0.005, space='sell', optimize=False, load=True) @@ -178,8 +178,8 @@ class FreqaiExampleStrategy(IStrategy): # each training period. dataframe = self.model.bridge.start(dataframe, metadata, self) - dataframe["target_roi"] = dataframe["target_mean"] + dataframe["target_std"] - dataframe["sell_roi"] = dataframe["target_mean"] - dataframe["target_std"] + dataframe["target_roi"] = dataframe["target_mean"] + dataframe["target_std"] * 1.25 + dataframe["sell_roi"] = dataframe["target_mean"] - dataframe["target_std"] * 1.25 return dataframe def populate_entry_trend(self, df: DataFrame, metadata: dict) -> DataFrame: @@ -245,7 +245,8 @@ class FreqaiExampleStrategy(IStrategy): entry_tag = trade.enter_tag - if 'prediction' + entry_tag not in pair_dict[pair] or pair_dict[pair]['prediction' + entry_tag] > 0:: + if ('prediction' + entry_tag not in pair_dict[pair] or + pair_dict[pair]['prediction' + entry_tag] > 0): with self.model.bridge.lock: pair_dict[pair]['prediction' + entry_tag] = abs(trade_candle['prediction']) if not follow_mode: