Skip to content

Commit

Permalink
Merge pull request #202 from s4w3d0ff/dev
Browse files Browse the repository at this point in the history
Example updates, and fix cancelAllOrders
  • Loading branch information
s4w3d0ff committed Jun 15, 2019
2 parents b219925 + ee18845 commit 44bdc98
Show file tree
Hide file tree
Showing 8 changed files with 191 additions and 658 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![python](https://img.shields.io/badge/python-2.7%20%26%203-blue.svg)![licence](https://img.shields.io/badge/licence-GPL%20v2-blue.svg)](https://github.com/s4w3d0ff/python-poloniex/blob/master/LICENSE) [![release](https://img.shields.io/github/release/s4w3d0ff/python-poloniex.svg)![release build](https://travis-ci.org/s4w3d0ff/python-poloniex.svg?branch=v0.5.6)](https://github.com/s4w3d0ff/python-poloniex/releases)
[![master](https://img.shields.io/badge/branch-master-blue.svg)![master build](https://api.travis-ci.org/s4w3d0ff/python-poloniex.svg?branch=master)](https://github.com/s4w3d0ff/python-poloniex/tree/master) [![dev](https://img.shields.io/badge/branch-dev-blue.svg)![dev build](https://api.travis-ci.org/s4w3d0ff/python-poloniex.svg?branch=dev)](https://github.com/s4w3d0ff/python-poloniex/tree/dev)

Inspired by [this](http://pastebin.com/8fBVpjaj) wrapper written by 'oipminer'
> I (s4w3d0ff) am not affiliated with, nor paid by [Poloniex](https://poloniex.com). If you wish to contribute to the repository please read [CONTRIBUTING.md](https://github.com/s4w3d0ff/python-poloniex/blob/master/CONTRIBUTING.md). All and any help is appreciated.
#### Features:
Expand All @@ -24,8 +25,10 @@ All api calls are done through an instance of `poloniex.Poloniex`. You can use t
```python
# import this package
from poloniex import Poloniex

# make an instance of poloniex.Poloniex
polo = Poloniex()

# show the ticker
print(polo('returnTicker'))
```
Expand All @@ -46,13 +49,16 @@ To use the private api commands you first need an api key and secret (supplied b
```python
import poloniex
polo = poloniex.Poloniex(key='your-Api-Key-Here-xxxx', secret='yourSecretKeyHere123456789')

# or this works
polo.key = 'your-Api-Key-Here-xxxx'
polo.secret = 'yourSecretKeyHere123456789'

# get your balances
balance = polo.returnBalances()
print("I have %s ETH!" % balance['ETH'])
# or

# or use '__call__'
balance = polo('returnBalances')
print("I have %s BTC!" % balance['BTC'])
```
Expand All @@ -68,7 +74,7 @@ print(polo.marketTradeHist('BTC_ETH'))
print(polo.returnTradeHistory('BTC_ETH'))
```

You can also not use the 'helper' methods at all and use `poloniex.PoloniexBase` which only has `returnMarketHist`, `__call__` to make rest api calls.
You can also not use the 'helper' methods at all and use `poloniex.PoloniexBase` which only has `returnMarketHist` and `__call__` to make rest api calls.

#### Websocket Usage:
To connect to the websocket api just create a child class of `PoloniexSocketed` like so:
Expand Down
17 changes: 7 additions & 10 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
# Examples
#### _Examples require [this poloniex module](https://github.com/s4w3d0ff/python-poloniex) to be installed._
##### _Examples require [this poloniex module](https://github.com/s4w3d0ff/python-poloniex) to be installed._

## Chart:
Saves chart data in a mongodb collection and returns a pandas dataframe with basic indicators.
### Requirements:
pip:
Saves chart data in a mongodb collection and returns a pandas dataframe.
#### Requirements:
```
pandas
numpy
pymongo
tqdm
```
Chart examples require [mongod](https://www.mongodb.com/) running locally.

## Loanbot:
Helps your loan offers get filled and keeps them from going 'stale'
### Requirements:
Just [this git repository](https://github.com/s4w3d0ff/python-poloniex).


## Websocket:
Examples of how to use the websocket api to create tickers, stoplimits, etc.
### Requirements:
Just [this git repository](https://github.com/s4w3d0ff/python-poloniex) v0.5+.
`mongoTicker.py` requires pymongo and mongod running.

### Projects using `python-poloniex`:
- [donnie](https://github.com/s4w3d0ff/donnie) - 'Poloniex tradebot toolkit for Python 3+'
13 changes: 2 additions & 11 deletions examples/chart/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
chart.py - saves chart data in a mongodb collection and returns a pandas dataframe with basic indicators
mongoDataframe.py - saves chart data in a mongodb collection and returns a pandas dataframe

Requires:
```
pandas
numpy
pymongo
```

bokehPlotter.py - same as chart.py with an added `graph` method that plots the data (with indicators) using bokeh

Requires:
```
pandas
numpy
pymongo
bokeh
tqdm
```

0 comments on commit 44bdc98

Please sign in to comment.