Skip to content

Commit

Permalink
add get_symbol_candles into real time evaluator
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume De Saint Martin authored and Herklos committed Apr 7, 2020
1 parent 6dfc148 commit 5b3bc8e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions octobot_evaluators/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@

EVALUATOR_CLASS_TYPE_MRO_INDEX = -4

MATRIX_CHANNEL = "Matrix"
MATRIX_CHANNELS = "MatrixChannels"
MATRIX_CHANNEL: str = "Matrix"
MATRIX_CHANNELS: str = "MatrixChannels"

evaluator_class_str_to_matrix_type_dict = {
"TAEvaluator": EvaluatorMatrixTypes.TA,
Expand Down
9 changes: 9 additions & 0 deletions octobot_evaluators/evaluator/realtime_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,12 @@ def __init__(self):
def load_config(self):
self.set_default_config()
self.specific_config = {**self.specific_config, **get_tentacle_config(self.__class__)}

def get_symbol_candles(self, exchange_name: str, exchange_id: str, symbol: str, time_frame):
try:
from octobot_trading.api.symbol_data import get_symbol_candles_manager
return get_symbol_candles_manager(self.get_exchange_symbol_data(exchange_name, exchange_id, symbol),
time_frame)
except ImportError:
self.logger.error(f"Can't get candles manager: requires OctoBot-Trading package installed")

1 change: 1 addition & 0 deletions tests/channels/test_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

from octobot_evaluators.api.evaluators import create_matrix
from octobot_evaluators.api.initialization import create_matrix_channels
from octobot_evaluators.constants import MATRIX_CHANNEL
from octobot_evaluators.data.matrix import get_tentacle_path
from octobot_evaluators.matrices.matrices import Matrices

Expand Down

0 comments on commit 5b3bc8e

Please sign in to comment.