Esempio n. 1
0
    def __init__(self):
        super().__init__()

        # 用来交易的client
        self.clients = {
            # "HaobtcCNY": haobtccny.PrivateHaobtcCNY(config.HAOBTC_API_KEY, config.HAOBTC_SECRET_TOKEN),
            "HuobiCNY":
            huobicny.PrivateHuobiCNY(config.HUOBI_API_KEY,
                                     config.HUOBI_SECRET_TOKEN),
            "OKCoinCNY":
            okcoincny.PrivateOkCoinCNY(config.OKCOIN_API_KEY,
                                       config.OKCOIN_SECRET_TOKEN),
            # "BrokerCNY": brokercny.PrivateBrokerCNY(),
        }

        self.reverse_profit_thresh = config.reverse_profit_thresh
        self.reverse_perc_thresh = config.reverse_perc_thresh
        self.profit_thresh = config.profit_thresh
        self.perc_thresh = config.perc_thresh
        self.trade_wait = config.trade_wait  # in seconds
        self.last_trade = 0

        # tmp use before can get account
        self.init_btc = {'OKCoinCNY': 500000000, 'HuobiCNY': 500000000}
        self.init_cny = {'OKCoinCNY': 10000000, 'HuobiCNY': 10000000}

        self.stage0_percent = config.stage0_percent
        self.stage1_percent = config.stage1_percent
        self.last_bid_price = 0
        self.trend_up = True

        self.hedger = 'BrokerCNY'
Esempio n. 2
0
    def __init__(self):
        self.clients = {
            # TODO: move that to the config file
            "HaobtcCNY": haobtccny.PrivateHaobtcCNY(),
            "OKCoinCNY": okcoincny.PrivateOkCoinCNY(),
            "HuobiCNY": huobicny.PrivateHuobiCNY(),
        }

        self.profit_thresh = config.profit_thresh
        self.perc_thresh = config.perc_thresh
        self.trade_wait = 120 * 1  # in seconds
        self.last_trade = 0
Esempio n. 3
0
    def __init__(self):
        self.clients = {
            # TODO: move that to the config file
            "HaobtcCNY":
            haobtccny.PrivateHaobtcCNY(config.HAOBTC_API_KEY,
                                       config.HAOBTC_SECRET_TOKEN),
            "OKCoinCNY":
            okcoincny.PrivateOkCoinCNY(config.OKCOIN_API_KEY,
                                       config.OKCOIN_SECRET_TOKEN),
            "HuobiCNY":
            huobicny.PrivateHuobiCNY(config.HUOBI_API_KEY,
                                     config.HUOBI_SECRET_TOKEN),
        }

        self.profit_thresh = config.profit_thresh
        self.perc_thresh = config.perc_thresh
        self.trade_wait = 10 * 1  # in seconds
        self.last_trade = 0
Esempio n. 4
0
    def __init__(self):
        self.clients = {
            # TODO: move that to the config file
            "HaobtcCNY": haobtccny.PrivateHaobtcCNY(config.HAOBTC_API_KEY, config.HAOBTC_SECRET_TOKEN),
            "OKCoinCNY": okcoincny.PrivateOkCoinCNY(config.OKCOIN_API_KEY, config.OKCOIN_SECRET_TOKEN),
            "HuobiCNY": huobicny.PrivateHuobiCNY(config.HUOBI_API_KEY, config.HUOBI_SECRET_TOKEN),
        }

        self.profit_thresh = config.profit_thresh
        self.perc_thresh = config.perc_thresh
        self.trade_wait = 10 * 1  # in seconds
        self.last_trade = 0
        self.cny_balance = 0
        self.btc_balance = 0
        self.cny_frozen = 0
        self.btc_frozen = 0
        self.cny_total = 0
        self.btc_total = 0
       
        try:
            os.mkdir(self.out_dir)
        except:
            pass