I present to you a *release candidate* for a python module that can be
used to easily build a trading bot.
As an orientation, I used the polonex trading interface. However there
are some differences that you should be aware of:
* market pairs are denoted as 'quote'_'base', e.g. `USD_BTS`
* Prices/Rates are denoted in 'quote', i.e. the USD_BTS market
is priced in USD and buying 1 USD costs `rate` BTS
* All markets could be considered reversed as well ('BTS_USD')
Usage... is quite simple:
dex = GrapheneExchange(config)
dex.returnTradeHistory("USD_BTS")
dex.returnTicker()
dex.return24Volume()
dex.returnOrderBook("USD_BTS")
dex.returnBalances()
dex.returnOpenOrders("all")
dex.buy("USD_BTS", 0.001, 10)
dex.sell("USD_BTS", 0.001, 10)
Documentation:http://python-graphenelib.readthedocs.org/en/latest/exchange.htmlExample Usage:Script:
https://github.com/xeroc/python-graphenelib/blob/master/scripts/exchange-simpleticker-stats/main.pyOutput:
CNY_BTS
=======
- Trade Premium: 8.109%
- Bid Order Premium: 1.171%
- Ask Order Premium: 8.109%
- Spread: 6.630%
- CER premium: 5.22%
GOLD_BTS
========
- Trade Premium: 2.264%
- Bid Order Premium: 19.559%
- Ask Order Premium: 2.264%
- Spread: 19.413%
- CER premium: 3.53%
USD_BTS
=======
- Trade Premium: 0.180%
- Bid Order Premium: 2.137%
- Ask Order Premium: 0.439%
- Spread: 1.721%
- CER premium: 4.97%
SILVER_BTS
==========
- Trade Premium: 8.595%
- Bid Order Premium: 8.098%
- Ask Order Premium: 1.031%
- Spread: 9.464%
- CER premium: 4.16%
So,
To all the Traders and Bot developers:* Please give this library a try and improve liquidity in the markets
* Note that the library is not well tested yet, so please a) use only
what you can affort to lose and b) review the code
cass edit: title spelling mistake
GrapehenExchange --> GrapheneExchange