diff --git a/Evaluator/RealTime/instant_fluctuations_evaluator.py b/Evaluator/RealTime/instant_fluctuations_evaluator.py index fc76eb08c..21e7e2588 100644 --- a/Evaluator/RealTime/instant_fluctuations_evaluator.py +++ b/Evaluator/RealTime/instant_fluctuations_evaluator.py @@ -2,6 +2,7 @@ OctoBot Tentacle $tentacle_description: { + "package_name": "OctoBot-Tentacles", "name": "instant_fluctuations_evaluator", "type": "Evaluator", "subtype": "RealTime", @@ -212,8 +213,10 @@ def _should_eval(self): return self.should_eval -# This RT evaluator should be used on regulated markets like USDT/USD or TUSD/USDT... class InstantRegulatedMarketEvaluator(RealTimeTAEvaluator): + MARKET_PRICE = "regulated_market_price" + MARKET_RANGE = "regulated_market_range" + def __init__(self, exchange, symbol): super().__init__(exchange, symbol) self.last_candle_data = None @@ -232,9 +235,21 @@ def eval_impl(self): last_price = close_values[-1] - self.eval_note = 0 + # TODO + # should sell + if last_price > self.specific_config[self.MARKET_PRICE] + self.specific_config[self.MARKET_RANGE]: + self.eval_note = 1 - self.notify_evaluator_thread_managers(self.__class__.__name__) + # should buy + elif last_price < self.specific_config[self.MARKET_PRICE] + self.specific_config[self.MARKET_RANGE]: + self.eval_note = -1 + + else: + self.eval_note = 0 + + if self.last_eval_note != self.eval_note: + self.notify_evaluator_thread_managers(self.__class__.__name__) + self.last_eval_note = self.eval_note def set_default_config(self): super().set_default_config() diff --git a/Evaluator/Strategies/mixed_strategies_evaluator.py b/Evaluator/Strategies/mixed_strategies_evaluator.py index 663ffb908..265ccee33 100644 --- a/Evaluator/Strategies/mixed_strategies_evaluator.py +++ b/Evaluator/Strategies/mixed_strategies_evaluator.py @@ -215,4 +215,4 @@ def eval_impl(self) -> None: def finalize(self): if self.counter > 0: - self.eval_note += self.evaluation / self.counter + self.eval_note = self.evaluation / self.counter