Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Order Example #76

Closed
gtman002 opened this issue Dec 22, 2017 · 3 comments
Closed

New Order Example #76

gtman002 opened this issue Dec 22, 2017 · 3 comments

Comments

@gtman002
Copy link

Versions

OS:       Win 10
Python:   3.6.3
krakenex: 3

What are you trying to achieve?

I want to write a python program to place a new order, and am wondering what type of feedback I should be expecting from the Kraken API. I have installed Krakenex with pip3 and can succesfully look up balances and get a response as expected, but when I run code for new order, I get an appropriate pause (3 - 10 seconds), but no response at all. No error, or anything.

# code sample
import krakenex
from requests.exceptions import HTTPError

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

tradepair = 'LTCUSD'
volume_units = 1
buy_price = 1
sell_price = 1000


k.query_private('AddOrder',
                {'pair': tradepair,
                 'type': 'buy',
                 'ordertype': 'limit',
                 'price': buy_price,
                 'volume': volume_units,
                 # only `ordertype`, `price` and `price2` are valid
                 'close[ordertype]': 'limit',
                 'close[price]': sell_price,
                 # these will be ignored!
                 'close[pair]': tradepair,
                 'close[type]': 'sell',
                 'close[volume]': volume_units})

What do you expect to happen?

I would expect to get a response of some sort that has TXID, or an error message saying I don't have enough USD to complete the order.

What happens instead?

After a pause, I get a command prompt.

# error message
no error messages

I have no balance, so I don't expect the trade order to be successful, but I would expect something back.

@veox
Copy link
Owner

veox commented Dec 22, 2017

Duplicate of #73? In particular: #73 (comment)

Also, there is no krakenex version 3. The latest tagged one is v2.0.0.

@gtman002
Copy link
Author

Thanks very much for responding quickly. Yes #73 was the same issue and the reply there was helpful. Also, #65 (retries) looks like something I'd like to try to implement.

To change the api.py file, would I just replace or edit it in the installed directory:
(on Win10)
c:\users\user\appdata\local\programs\python\python36-32\lib\site-packages\krakenex\ ?

Version is 2.0.0

@veox
Copy link
Owner

veox commented Dec 23, 2017

Check PR #66 linked from issue #65. There are already implementations of the "retry" approach.

I assume this can be closed.

@veox veox closed this as completed Dec 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants