Exemple #1
0
	def run(self):
		self.client = fcoin_client()
		self.client.start()
		self.client.subscribe_ticker(symbol, self.ticker_handler)
		self.symbols_action()
		self.get_balance_action(symbols)
		while True:
			self.trade()
 def run(self):
     self.symbols_action()
     # self.get_balance_action(symbols)
     balance.balance()
     self.client = fcoin_client(self.on_close)
     self.client.start()
     self.client.subscribe_tickers(symbol_pairs, self.ticker_handler)
     while True:
         tickers = ticker_queue.get()
         self.trade(tickers)
         ticker_queue.queue.clear()
    def run(self):
        self.client = fcoin_client()
        self.client.start()
        self.client.subscribe_ticker(symbol, self.ticker_handler)
        self.symbols_action()
        self.get_balance_action(symbols)

        time = 0
        while True:
            self.trade()
            time = time + 1
            if (time > 100):
                break
Exemple #4
0
 def run(self):
     self.client = fcoin_client(self.on_close)
     # self.client = fcoin_client()
     self.client.start()
     self.client.subscribe_tickers([symbol], self.ticker_handler)
     self.symbols_action()
     # self.get_balance_action(symbols)
     if not is_mutable_amount:
         logging.info("交易标的:{} 每单交易量:{} {}".format(symbol, amount,
                                                   symbols[0]))
     balance.balance()
     while True:
         self.trade()
 def on_close(self):
     print("websocket closed, try to restart...")
     time.sleep(second)
     self.client = fcoin_client(self.on_close)
     self.client.start()
     self.client.subscribe_tickers(symbol_pairs, self.ticker_handler)