예제 #1
0
 async def load(self):
     try:
         self.candle_handler = FileCandleHandler(self.test_data,
                                                 self.candle_limit)
         self.candle_handler.load()
     except:
         utils.print_traceback()
예제 #2
0
 async def start(self):
     try:
         if self.candle_handler:
             # await
             self.candle_handler.start()
         else:
             logger.info('candle_handler 를 사용하지 않습니다.')
     except:
         utils.print_traceback()
예제 #3
0
 async def init(self):
     """
     이 부분을 호출하여 넥서스를 초기화한다.
     :return:
     """
     try:
         await self.nexus.wait_ready()
     except Exception as e:
         logger.error('init error > %s', e)
         utils.print_traceback()
예제 #4
0
 async def sched(self):
     while True:
         try:
             while self.messages:
                 item = self.messages.popleft()
                 await self.__send_telegram(item)
                 await asyncio.sleep(0.5)
             else:
                 await asyncio.sleep(1)
         except:
             utils.print_traceback()
예제 #5
0
    async def load(self):
        try:

            # await
            self.api.load_markets()

            if self.candle_handler:
                # await
                self.candle_handler.load()
            else:
                logger.info('candle_handler 를 사용하지 않습니다.')

            await self.ws.connect()
        except:
            utils.print_traceback()
예제 #6
0
    async def load(self):
        try:
            # await
            self.api.load_markets()

            # _, filepath = await
            _, filepath = data_ingest.ingest_data(self.api,
                                                  self.symbol,
                                                  self.test_start,
                                                  self.test_end,
                                                  self.candle_period,
                                                  self.candle_limit,
                                                  reload=True)
            self.candle_handler = CandleHandler(filepath, self.candle_limit)
            self.candle_handler.load()
        except:
            utils.print_traceback()