wang-ye / robinhood-crypto

Robinhood Crypto
MIT License
45 stars 16 forks source link

Buying ETH #9

Open smsr7 opened 5 years ago

smsr7 commented 5 years ago

Attempting to buy Ethereum with the code: market_order_info = r.trade( 'ETHUSD', price=round(float(info['mark_price']) * 1.005, 2), quantity="0.0001", side="buy", time_in_force="gtc", type="market" ) returns error: 400 Client Error: Bad Request for url: https://nummus.robinhood.com/orders/

File "/usr/local/lib/python3.6/site-packages/robinhood_crypto_api/robinhood_crypto_api.py", line 268, in trade raise TradeException() robinhood_crypto_api.robinhood_crypto_api.TradeException

This same code works when changing 'ETHUSD' to 'BTCUSD' is there anyway to get the buying / selling api to work with Ethereum or is it Bitcoin exclusive

arlebeckwith commented 4 years ago

Having the same problem with doge. Any help is appreciated.

arlebeckwith commented 4 years ago

Passing the price as a string worked for me.

d4v3y0rk commented 3 years ago

@smsr7 I think the problem is you need to do move the price=round(float(info['mark_price']) * 1.005, 2) out of the params and create a variable called price with the resultant data and then use the price variable in the params.