def run(self): if self.hyperopt: raise Exception( "Trading View Strategy dose not support hyperopt Mode.") elif self.back_test: raise Exception( "Trading View Strategy dose not support backtest Mode.") elif self.stub_test: self.exchange = BitMexStub() logger.info(f"Bot Mode : Stub") else: self.exchange = BitMex(demo=self.test_net) logger.info(f"Bot Mode : Trade") logger.info(f"Starting Bot") logger.info(f"Strategy : {type(self).__name__}") logger.info(f"Resolution : {self.resolution()}") logger.info(f"Balance : {self.exchange.get_balance()}") notify(f"Starting Bot\n" f"Strategy : {type(self).__name__}\n" f"Resolution : {self.resolution()}\n" f"Balance : {self.exchange.get_balance()/100000000} XBT") self.subscriber.on_message(self.__on_message)
def run(self): """ ˜ Bot 기동 """ if self.hyperopt: logger.info(f"Bot Mode : Hyperopt") self.params_search() return elif self.stub_test: logger.info(f"Bot Mode : Stub") self.exchange = BitMexStub() elif self.back_test: logger.info(f"Bot Mode : Back test") self.exchange = BitMexBackTest() else: logger.info(f"Bot Mode : Trade") self.exchange = BitMex(demo=self.test_net) self.exchange.ohlcv_len = self.ohlcv_len() self.exchange.on_update(self.bin_size, self.strategy) logger.info(f"Starting Bot") logger.info(f"Strategy : {type(self).__name__}") logger.info(f"Resolution : {self.resolution()}") logger.info(f"Balance : {self.exchange.get_balance()}") notify(f"Starting Bot\n" f"Strategy : {type(self).__name__}\n" f"Resolution : {self.resolution()}\n" f"Balance : {self.exchange.get_balance()/100000000} XBT") self.exchange.show_result()
def run(self): if self.hyperopt: raise Exception( "Trading View Strategy dose not support hyperopt Mode.") elif self.back_test: raise Exception( "Trading View Strategy dose not support backtest Mode.") elif self.stub_test: # if you want to use binance futures # self.exchange = BinanceFuturesStub(account=self.account, pair=self.pair) self.exchange = BitMexStub(account=self.account, pair=self.pair) logger.info(f"Bot Mode : Stub") else: # if you want to use binance #self.exchange = BinanceFutures(account=self.account, pair=self.pair, demo=self.test_net) self.exchange = BitMex(account=self.account, pair=self.pair, demo=self.test_net) logger.info(f"Bot Mode : Trade") logger.info(f"Starting Bot") logger.info(f"Strategy : {type(self).__name__}") logger.info(f"Balance : {self.exchange.get_balance()}") notify(f"Starting Bot\n" f"Strategy : {type(self).__name__}\n" f"Balance : {self.exchange.get_balance()/100000000} XBT") self.subscriber.on_message(self.__on_message)
def run(self): """ ˜ Botを起動する関数。 """ logger.info(f"Starting Bot") logger.info(f"Strategy : {type(self).__name__}") if self.hyperopt: logger.info(f"Bot Mode : Hyperopt") self.params_search() return elif self.stub_test: logger.info(f"Bot Mode : Stub") self.exchange = BitMexStub() elif self.back_test: logger.info(f"Bot Mode : Back test") self.exchange = BitMexBackTest() else: logger.info(f"Bot Mode : Trade") self.exchange = BitMex(demo=self.test_net) self.exchange.ohlcv_len = self.ohlcv_len() self.exchange.on_update(self.bin_size, self.strategy) self.exchange.show_result()
def run(self): """ ˜ Function to run the bot """ if self.hyperopt: logger.info(f"Bot Mode : Hyperopt") self.params_search() return elif self.stub_test: logger.info(f"Bot Mode : Stub") if self.exchange_arg == "binance": self.exchange = BinanceFuturesStub(account=self.account, pair=self.pair) elif self.exchange_arg == "bitmex": self.exchange = BitMexStub(account=self.account, pair=self.pair) else: logger.info(f"--exchange argument missing or invalid") return elif self.back_test: logger.info(f"Bot Mode : Back test") if self.exchange_arg == "binance": self.exchange = BinanceFuturesBackTest(account=self.account, pair=self.pair) elif self.exchange_arg == "bitmex": self.exchange = BitMexBackTest(account=self.account, pair=self.pair) else: logger.info(f"--exchange argument missing or invalid") return else: logger.info(f"Bot Mode : Trade") if self.exchange_arg == "binance": self.exchange = BinanceFutures(account=self.account, pair=self.pair, demo=self.test_net) elif self.exchange_arg == "bitmex": self.exchange = BitMex(account=self.account, pair=self.pair, demo=self.test_net) else: logger.info(f"--exchange argument missing or invalid") return self.exchange.ohlcv_len = self.ohlcv_len() self.exchange.on_update(self.bin_size, self.strategy) logger.info(f"Starting Bot") logger.info(f"Strategy : {type(self).__name__}") logger.info(f"Balance : {self.exchange.get_balance()}") notify(f"Starting Bot\n" f"Strategy : {type(self).__name__}\n" f"Balance : {self.exchange.get_balance()}") self.exchange.show_result()