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

gemini create order not working #436

Closed
ZhiminHeGit opened this issue Nov 1, 2017 · 6 comments
Closed

gemini create order not working #436

ZhiminHeGit opened this issue Nov 1, 2017 · 6 comments
Assignees

Comments

@ZhiminHeGit
Copy link

ZhiminHeGit commented Nov 1, 2017

i was able to query the balance successfully, which means the API key is working. The API key has trading priority as well. here is the code snippet

gemini_balance = gemini.fetch_balance()
print 'gemini', gemini_balance['BTC']['total'], gemini_balance['USD']['total'] # success
time.sleep(2)
gemini.create_order('BTC/USD', 'limit', 'sell', 0.1, 6350) # got ccxt.base.errors.ExchangeNotAvailable
@kroitor
Copy link
Member

kroitor commented Nov 1, 2017

@hzmbeyond80 can you post verbose output, plz?

gemini.verbose = True  # ← add this line  
gemini.create_order('BTC/USD', 'limit', 'sell', 0.1, 6350)  # ← what does the output say?

Plz use tripple backticks

```
code
```

or

```
output
```

@kroitor kroitor self-assigned this Nov 1, 2017
@ZhiminHeGit
Copy link
Author

('https://api.gemini.com/v1/order/new', 'POST', 'https://api.gemini.com/v1/order/new', '\nRequest:', {'X-GEMINI-SIGNATURE': '9ec27cc961ba36ffcf77a1bddbd75bbe2240a47467b191f43f8fafbe7c364f152b073cc47744fa8bf5dc1548f6afe845', 'X-GEMINI-PAYLOAD': 'eyJub25jZSI6MTUwOTUyMDc0Niwic3ltYm9sIjoiYnRjdXNkIiwicmVxdWVzdCI6Ii92MS9vcmRlci9uZXciLCJjbGllbnRfb3JkZXJfaWQiOjE1MDk1MjA3NDYsImFtb3VudCI6IjAuMSIsInR5cGUiOiJleGNoYW5nZSBsaW1pdCIsInByaWNlIjoiNjM1MCIsInNpZGUiOiJzZWxsIn0=', 'Accept-Encoding': 'gzip, deflate', 'X-GEMINI-APIKEY': 'KuNk8fnPp8QwfHuu9ADM', 'Content-Type': 'text/plain', 'User-Agent': 'ccxt/1.9.307 (+https://github.com/ccxt-dev/ccxt) Python/2.7.10'}, None)
Traceback (most recent call last):
  File "/Users/zhiminhe/Dropbox/BitcoinPYVersions/BitCoinPYPython2.0/btc_action_jp_us.py", line 63, in <module>
    print gemini.create_order('BTC/USD', 'limit', 'sell', 0.1, 6350)
  File "/Users/zhiminhe/Dropbox/BitcoinPYVersions/BitCoinPYPython2.0/ccxt/gemini.py", line 162, in create_order
    response = self.privatePostOrderNew(self.extend(order, params))
  File "/Users/zhiminhe/Dropbox/BitcoinPYVersions/BitCoinPYPython2.0/ccxt/gemini.py", line 198, in request
    response = self.fetch2(path, api, method, params, headers, body)
  File "/Users/zhiminhe/Dropbox/BitcoinPYVersions/BitCoinPYPython2.0/ccxt/base/exchange.py", line 235, in fetch2
    return self.fetch(request['url'], request['method'], request['headers'], request['body'])
  File "/Users/zhiminhe/Dropbox/BitcoinPYVersions/BitCoinPYPython2.0/ccxt/base/exchange.py", line 288, in fetch
    self.handle_rest_errors(e, e.code, text, url, method)
  File "/Users/zhiminhe/Dropbox/BitcoinPYVersions/BitCoinPYPython2.0/ccxt/base/exchange.py", line 331, in handle_rest_errors
    self.raise_error(error, url, method, exception if exception else http_status_code, details)
  File "/Users/zhiminhe/Dropbox/BitcoinPYVersions/BitCoinPYPython2.0/ccxt/base/exchange.py", line 220, in raise_error
    details,
ccxt.base.errors.ExchangeNotAvailable: gemini POST https://api.gemini.com/v1/order/new 400 Bad Request  (possible reasons: invalid API keys, bad or old nonce, exchange is down or offline, on maintenance, DDoS protection, rate-limiting, )

Process finished with exit code 1

@kroitor
Copy link
Member

kroitor commented Nov 1, 2017

@hzmbeyond80 thx! I'll take a look into it and will get back to you asap!

@ZhiminHeGit
Copy link
Author

ZhiminHeGit commented Nov 1, 2017 via email

@kroitor
Copy link
Member

kroitor commented Nov 1, 2017

@hzmbeyond80 awesome! Thanks for your help! I am going to upload the fix for it now!

@kroitor kroitor closed this as completed in 76e1838 Nov 1, 2017
@kroitor
Copy link
Member

kroitor commented Nov 1, 2017

@hzmbeyond80 this was fixed in 1.9.329. Thx to you!

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