Gdax trying to put limit or market trade
See original GitHub issueHaving a lot of trouble making trade on gdax.
When trying to call your own method for gdax create_limit_buy this happens
return self.create_limit_buy_order (product, amount, price, params)
File "C:\Program Files (x86)\Python36-32\lib\site-packages\ccxt\__init__.py", line 504, in create_limit_buy_order
return self.create_order (product, 'limit', 'buy', amount, price, params)
File "C:\Program Files (x86)\Python36-32\lib\site-packages\ccxt\__init__.py", line 6416, in create_order
return self.privatePostOrder (self.extend (order, params))
AttributeError: 'gdax' object has no attribute 'privatePostOrder'
When trying to write my own method
response = gdax.request('orders', 'private', 'POST', params={'type': 'limit',
'side': 'buy',
'product_id': product,
'price': 3000,
'size': 1.0})
this happens
https://api-public.sandbox.gdax.com/orders POST {'CB-ACCESS-KEY': 'ba6e6e102338f6e66244d804984bdc1e', 'CB-ACCESS-SIGN': b'pMfi9OUiCJX9YqFktaVXycNqD7MFpbEWIYgWRvwD0nI=', 'CB-ACCESS-TIMESTAMP': '1500374457', 'CB-ACCESS-PASSPHRASE': '**********', 'User-Agent': 'ccxt/1.0.158 (+https://github.com/kroitor/ccxt) Python/3.6.1'} {"type":"limit","side":"buy","product_id":"BTC/USD","price":3000,"size":1.0}
Traceback (most recent call last):
gdax POST https://api-public.sandbox.gdax.com/orders 400 Bad Request b'{"message":"invalid signature"}'
File "C:\oop\novi ws\Crypto\testGdax.py", line 23, in <module>
'size': 1.0})
File "C:\Program Files (x86)\Python36-32\lib\site-packages\ccxt\__init__.py", line 6441, in request
return self.fetch (url, method, headers, body)
File "C:\Program Files (x86)\Python36-32\lib\site-packages\ccxt\__init__.py", line 207, in fetch
response = opener.open (request, timeout = int (self.timeout / 1000))
File "C:\Program Files (x86)\Python36-32\lib\urllib\request.py", line 532, in open
response = meth(req, response)
File "C:\Program Files (x86)\Python36-32\lib\urllib\request.py", line 642, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Program Files (x86)\Python36-32\lib\urllib\request.py", line 570, in error
return self._call_chain(*args)
File "C:\Program Files (x86)\Python36-32\lib\urllib\request.py", line 504, in _call_chain
result = func(*args)
File "C:\Program Files (x86)\Python36-32\lib\urllib\request.py", line 650, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Stop-limit order | How to set the limit | Coinbase Pro - GDAX
How to choose a limit price for a stop order. Let's take a look. See the full GDAX playlist here: VIDEO SECTIONS 00:00...
Read more >5 Limit orders as makers | Trading on Coinbase Pro - GDAX
In this video, let's look at the next two limit order configurations. ... when we want to consider all possible variations of some...
Read more >4 Limit orders as takers | Trading on Coinbase Pro - GDAX
In this video, we are going to keep talking about order types and parameters. We looked at market orders in the previous video...
Read more >8 Stop-Limit orders | Trading on Coinbase Pro - GDAX
Let's look at stop- limit orders. I will show you how to configure them and verify their maker-taker status. We will also touch...
Read more >Market, Limit, Stop, Stop-Limit | Order type summary explanation
Trading - Advanced Order Types with Coinbase. by DEEPLIZARD. Market, Limit, Stop, Stop- Limit | Order type summary explanation ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, I fixed it, finally. Now it replies with “Insufficient funds” as it should. Code for testing:
The problem was that their sandbox does not accept
client_oid
field. Removed it. Should work now. Thanks again!So now it says “Insufficient funds” as it should… Will add an exception for this case, though.