diff --git a/freqtrade/freqai/data_kitchen.py b/freqtrade/freqai/data_kitchen.py index 2378dcdd8..730ef2767 100644 --- a/freqtrade/freqai/data_kitchen.py +++ b/freqtrade/freqai/data_kitchen.py @@ -3,6 +3,7 @@ import datetime import logging import shutil from pathlib import Path +from threading import Lock from typing import Any, Dict, List, Tuple import numpy as np @@ -70,6 +71,8 @@ class FreqaiDataKitchen: self.model_filename: str = "" self.live = live self.pair = pair + self.analysis_lock = Lock() + self.svm_model: linear_model.SGDOneClassSVM = None self.keras: bool = self.freqai_config.get("keras", False) self.set_all_pairs() @@ -961,7 +964,7 @@ class FreqaiDataKitchen: for tf in tfs: if tf == tfs[-1]: sgi = True # doing this last allows user to use all tf raw prices in labels - with strategy.freqai.lock: + with self.analysis_lock: dataframe = strategy.populate_any_indicators( pair, dataframe.copy(), @@ -969,7 +972,7 @@ class FreqaiDataKitchen: informative=base_dataframes[tf], set_generalized_indicators=sgi ) - with strategy.freqai.lock: + with self.analysis_lock: if pairs: for i in pairs: if pair in i: diff --git a/freqtrade/freqai/freqai_interface.py b/freqtrade/freqai/freqai_interface.py index 374fcea2f..4c9cf1c05 100644 --- a/freqtrade/freqai/freqai_interface.py +++ b/freqtrade/freqai/freqai_interface.py @@ -70,7 +70,6 @@ class IFreqaiModel(ABC): self.set_full_path() self.follow_mode: bool = self.freqai_info.get("follow_mode", False) self.dd = FreqaiDataDrawer(Path(self.full_path), self.config, self.follow_mode) - self.lock = threading.Lock() self.identifier: str = self.freqai_info.get("identifier", "no_id_provided") self.scanning = False self.keras: bool = self.freqai_info.get("keras", False)