コード例 #1
0
    def __init__(self, quantity, key, secret):
        self.quantity = quantity
        self.commission = .2

        from bitfinex.client import Client, TradeClient
        self.privateWrapper = TradeClient(key, secret)
        self.publicWrapper = Client()
コード例 #2
0
 def setUp(self):
     self.tc = TradeClient(API_KEY, API_SECRET)
コード例 #3
0
from sqlalchemy import *
import time
import numpy as np
from decimal import Decimal
# using bitfinex APIs to get today's_ticker
from bitfinex.client import Client, TradeClient
client = Client()
trade = TradeClient('K4HJultQmdvroWCnNy5OMcXx7QfGoQgZw0vrkWmuV1Y',
                    'dFt4tsMFszh2vTGGvHqFEP3fkaaSniJ4zDA4pSWyJOM')

# we are inporting the Databse that is being created by bitfinex-boat

engine = create_engine('sqlite:////home/metal-machine/Desktop/all_ticker.db')
metadata = MetaData(engine)
tickers = Table('ticker', metadata, autoload=True)


def find_nearest(array, value):
    """ gets the numpy array and timestamp as input and retunrs the nearest value"""

    idx = np.abs(array - value).argmin()
    return array[idx]


def ohlc_past(hours):
    """This function returns the seconds as input and retrun the required ohlc_4"""

    seconds = 3600 * hours  # converting hours into seconds
    time_delta = float('{:7f}'.format(time.time() - seconds))
    time_stamp = tickers.select(tickers.c.timestamp)
    timestamp_array = np.array([i[1] for i in time_stamp.execute()])
コード例 #4
0
from sqlalchemy import *
import time
import numpy as np
from decimal import Decimal
# using bitfinex APIs to get today's_ticker
from bitfinex.client import Client, TradeClient
trade = TradeClient('TlwqyZCq6tcr7kG25WLlPKk1IKvYoRndgr16mQ4qTQh',
                    'yPiilMjqCutpEptu7a1etlJmmHMuaru83wa9qqQOlhb')

print trade.balances()

client = Client()
#trade = TradeClient('K4HJultQmdvroWCnNy5OMcXx7QfGoQgZw0vrkWmuV1Y','dFt4tsMFszh2vTGGvHqFEP3fkaaSniJ4zDA4pSWyJOM')

# we are inporting the Databse that is being created by bitfinex-boat

engine = create_engine('sqlite:////home/metal-machine/Desktop/all_ticker.db')
metadata = MetaData(engine)
tickers = Table('ticker', metadata, autoload=True)


def find_nearest(array, value):
    """ gets the numpy array and timestamp as input and retunrs the nearest value"""

    idx = np.abs(array - value).argmin()
    return array[idx]


def ohlc_past(hours):
    """This function returns the seconds as input and retrun the required ohlc_4"""