Rename and move analysis_lock to data_kitchen

This commit is contained in:
Matthias 2022-08-14 17:23:14 +02:00
parent 3a9ec76c91
commit a29402ddde
2 changed files with 5 additions and 3 deletions

View File

@ -3,6 +3,7 @@ import datetime
import logging import logging
import shutil import shutil
from pathlib import Path from pathlib import Path
from threading import Lock
from typing import Any, Dict, List, Tuple from typing import Any, Dict, List, Tuple
import numpy as np import numpy as np
@ -70,6 +71,8 @@ class FreqaiDataKitchen:
self.model_filename: str = "" self.model_filename: str = ""
self.live = live self.live = live
self.pair = pair self.pair = pair
self.analysis_lock = Lock()
self.svm_model: linear_model.SGDOneClassSVM = None self.svm_model: linear_model.SGDOneClassSVM = None
self.keras: bool = self.freqai_config.get("keras", False) self.keras: bool = self.freqai_config.get("keras", False)
self.set_all_pairs() self.set_all_pairs()
@ -961,7 +964,7 @@ class FreqaiDataKitchen:
for tf in tfs: for tf in tfs:
if tf == tfs[-1]: if tf == tfs[-1]:
sgi = True # doing this last allows user to use all tf raw prices in labels 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( dataframe = strategy.populate_any_indicators(
pair, pair,
dataframe.copy(), dataframe.copy(),
@ -969,7 +972,7 @@ class FreqaiDataKitchen:
informative=base_dataframes[tf], informative=base_dataframes[tf],
set_generalized_indicators=sgi set_generalized_indicators=sgi
) )
with strategy.freqai.lock: with self.analysis_lock:
if pairs: if pairs:
for i in pairs: for i in pairs:
if pair in i: if pair in i:

View File

@ -70,7 +70,6 @@ class IFreqaiModel(ABC):
self.set_full_path() self.set_full_path()
self.follow_mode: bool = self.freqai_info.get("follow_mode", False) self.follow_mode: bool = self.freqai_info.get("follow_mode", False)
self.dd = FreqaiDataDrawer(Path(self.full_path), self.config, self.follow_mode) 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.identifier: str = self.freqai_info.get("identifier", "no_id_provided")
self.scanning = False self.scanning = False
self.keras: bool = self.freqai_info.get("keras", False) self.keras: bool = self.freqai_info.get("keras", False)