Beispiel #1
0
 async def ohlcv_callback(self, exchange: str, exchange_id: str,
                          cryptocurrency: str, symbol: str, time_frame,
                          candle, inc_in_construction_data):
     symbol_candles = self.get_exchange_symbol_data(exchange, exchange_id,
                                                    symbol)
     high_candles = trading_api.get_symbol_high_candles(
         symbol_candles,
         time_frame,
         include_in_construction=inc_in_construction_data)
     if len(high_candles) >= self.short_period:
         low_candles = trading_api.get_symbol_low_candles(
             symbol_candles,
             time_frame,
             include_in_construction=inc_in_construction_data)
         close_candles = trading_api.get_symbol_close_candles(
             symbol_candles,
             time_frame,
             include_in_construction=inc_in_construction_data)
         volume_candles = trading_api.get_symbol_volume_candles(
             symbol_candles,
             time_frame,
             include_in_construction=inc_in_construction_data)
         await self.evaluate(cryptocurrency, symbol, time_frame,
                             high_candles, low_candles, close_candles,
                             volume_candles, candle)
     else:
         self.eval_note = False
         await self.evaluation_completed(
             cryptocurrency,
             symbol,
             time_frame,
             eval_time=evaluators_util.get_eval_time(full_candle=candle,
                                                     time_frame=time_frame))
Beispiel #2
0
 async def ohlcv_callback(self, exchange: str, exchange_id: str,
                          cryptocurrency: str, symbol: str, time_frame,
                          candle, inc_in_construction_data):
     exchange_symbol_data = self.get_exchange_symbol_data(
         exchange, exchange_id, symbol)
     high = trading_api.get_symbol_high_candles(
         exchange_symbol_data,
         time_frame,
         include_in_construction=inc_in_construction_data)
     low = trading_api.get_symbol_low_candles(
         exchange_symbol_data,
         time_frame,
         include_in_construction=inc_in_construction_data)
     close = trading_api.get_symbol_close_candles(
         exchange_symbol_data,
         time_frame,
         include_in_construction=inc_in_construction_data)
     self.eval_note = commons_constants.START_PENDING_EVAL_NOTE
     if len(close) > self.length:
         await self.evaluate(cryptocurrency, symbol, time_frame, candle,
                             high, low, close)
     await self.evaluation_completed(
         cryptocurrency,
         symbol,
         time_frame,
         eval_time=evaluators_util.get_eval_time(full_candle=candle,
                                                 time_frame=time_frame))
 def high(self):
     return trading_api.get_symbol_high_candles(
         self.candles,
         self.time_frame,
         include_in_construction=self.inc_in_construction_data)