예제 #1
0
    def myOrders(self, inMkt, inStatus):
        try:
            buda = Buda.Auth(cr.k, cr.s)
            self.orderList = buda.order_pages(inMkt, None, None, inStatus)

        except Exception:
            pass
예제 #2
0
    def new(self, inMkt, inType, inLimit, inAmount):
        try:
            buda = Buda.Auth(cr.k, cr.s)
            res = buda.new_order(inMkt, inType, "limit", inLimit, inAmount)

        except Exception:
            pass
예제 #3
0
    def getBalances(self, inCur):
        try:
            buda = Buda.Auth(cr.k, cr.s)
            res = buda.balance(inCur)

            self.setBalances(res.id, res.amount.amount,
                             res.available_amount.amount,
                             res.frozen_amount.amount,
                             res.pending_withdraw_amount.amount)

        except Exception:
            pass
예제 #4
0
파일: bot.py 프로젝트: agrass/dca-btc-bot
    def _setup(self, config):
        # Get API_KEY and API_SECRET from credentials
        credentials = settings.credentials['Buda']
        key = credentials['key']
        secret = credentials['secret']

        # Initialize a Buda Auth client
        self.buda_basic = Buda.Auth(key, secret)
        self.buda_auth = buda.BudaAuth(key, secret)
        self.buda_trading = buda.BudaTrading(
            'btcclp', dry_run=self.dry_run, timeout=self.timeout, logger=self.log, store=self.store)
        self.buda_wallets = self.buda_trading.wallet_client('CLP')
        self.bitstamp = Bitstamp.Public()

        self.daily_investment = settings.investment['monthly'] / 30
        self.transactions = json.loads(self.store.get('transactions') or '[]')
        now = datetime.datetime.now()
        last_transaction = self.transactions[-1] if len(self.transactions) > 0 else None
        last_transaction_date = datetime.datetime.strptime(last_transaction['date'], "%b %d %Y %H:%M:%S") if last_transaction else None
        self.amount_investment = self.calculate_amount_investment(now, last_transaction_date)
예제 #5
0
 def cancel(self, orderId):
     try:
         buda = Buda.Auth(cr.k, cr.s)
         buda.cancel_order(orderId)
     except Exception:
         pass
예제 #6
0
 def client(self) -> Buda.Auth:
     self.check_credentials()
     return Buda.Auth(**self.credentials, **self.client_params)
예제 #7
0
 def client(self) -> Buda.Public:
     return Buda.Public(**self.client_params)
예제 #8
0
 def setUp(self):
     self.client = Buda.Auth(API_KEY, API_SECRET, base_url=HOST)
예제 #9
0
 def test_key_secret(self):
     with self.assertRaises(TypeError):
         Buda.Auth()
예제 #10
0
 def setUp(self):
     self.client = Buda.Auth('BAD_KEY', 'BAD_SECRET', base_url=HOST)
예제 #11
0
 def setUp(self):
     self.client = Buda.Public(base_url=HOST)
예제 #12
0
 def setUp(self):
     self.client = Buda.Auth(API_KEY, API_SECRET, TEST)
예제 #13
0
 def setUp(self):
     self.client = Buda.Public(TEST)
예제 #14
0
 def test_key_secret(self):
     self.assertRaises(ValueError, lambda: Buda.Auth())
예제 #15
0
 def setUp(self):
     self.client = Buda.Auth('BAD_KEY', 'BAD_SECRET')