Skip to content

Commit

Permalink
Add conditional-close example.
Browse files Browse the repository at this point in the history
Since the API documentation might be a little unclear:

https://github.com/veox/krakenex/issues/1
  • Loading branch information
veox committed Jan 14, 2014
1 parent 645cd87 commit 15dd9ee
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
23 changes: 23 additions & 0 deletions examples/conditional-close.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env python2
#
# Demonstrates how to use the conditional close functionality; that is,
# placing an order that, once filled, will place another order.
#
# This can be useful for very simple automation, where a bot is not
# needed to constantly monitor execution.

import krakenex

k = krakenex.API()
k.load_key('kraken.key')

k.query_private('AddOrder', {'pair': 'XXBTZEUR',
'type': 'buy',
'ordertype': 'limit',
'price': '1',
'volume': '1',
'close[pair]': 'XXBTZEUR',
'close[type]': 'sell',
'close[ordertype]': 'limit',
'close[price]': '9001',
'close[volume]': '1'})
2 changes: 2 additions & 0 deletions examples/kraken.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
keykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykey
secretsecretsecretsecretsecretsecretsecretsecretsecretsecretsecretsecretsecretsecretsecret

1 comment on commit 15dd9ee

@Rkauff
Copy link

@Rkauff Rkauff commented on 15dd9ee Jan 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"https://github.com/veox/krakenex/issues/1" is throwing a 404 Error.

Please sign in to comment.