Skip to content

Wrappers for Bitfinex's web-socket data and trading APIs

License

Notifications You must be signed in to change notification settings

sentrip/btfx-trader

Repository files navigation

btfx-trader

https://travis-ci.org/sentrip/btfx-trader.svg?branch=master Documentation Status Updates

Simple to use wrappers for Bitfinex's web socket api

Features

  • Access to cryptocurrency data with an API similar to queue.Queue
  • Simple trading API that responds to account data

Installation

To install btfx-trader, run this command in your terminal:

pip install btfx-trader

Usage

To use public data:

from btfx_trader import PublicData

q = PublicData(types=['tickers'], symbols=['BTCUSD'])
q.connect()

while True:
    data = q.get('tickers', 'BTCUSD')

To make an order:

from btfx_trader import Trader

trader = Trader('YOUR_BITFINEX_KEY', 'YOUR_BITFINEX_SECRET')
trader.connect()
# Order 0.01 BTC at $10000 per bitcoin
order_id = trader.order('BTCUSD', 10000, dollar_amount=100)

To cancel an order:

# for a single order
trader.cancel(order_id)
# for multiple orders
trader.cancel_all(older_than=10)

About

Wrappers for Bitfinex's web-socket data and trading APIs

Resources

License

Stars

Watchers

Forks

Packages

No packages published