robin_stocks
robin_stocks copied to clipboard
Always getting an error when using order_sell_crypto_by_price
Hi! Always get the message {'quantity': ['Order quantity has invalid increment.']} when trying to sell Doge. Any ideas on what the problem may be?
Thanks.
What parameters are you passing to the function?
r.orders.order_sell_crypto_by_price('DOGE',5,priceType='ask_price')
Try using 5.00 as the price instead of 5.
Just tried it. Nothing yet.
Hello there!
Is there a solution for this one yet? I'm having the exact same issue, except for order_buy_crypto_by_price
My parameters are: asset_symbol = "ETH" my_buying_power = float(r.load_account_profile(info="crypto_buying_power")) # 61.18 buy = r.order_buy_crypto_by_price(asset_symbol, my_buying_power, priceType="mark_price") print(buy)
And the exact output I receive is:
{'quantity': ['Order quantity has invalid increment.']}
Also, can I pay someone for dedicated support? Not sure of what's allowed, but I'm highly interested in getting my program up and running!
Kind regards, -David
Just adding a +1 to this, the r.order_buy_crypto_by_price works fine for BTC, LTC, BCH but does not work for ETH for some reason, I get the same error as above.
Just an update that the new changes that were pushed yesterday fix this problem:) It's now working without an issue! https://github.com/jmfernandes/robin_stocks/commit/0fce1dffee152cba7df53cdd12594ab9970b9761 has the fix:) Thanks @jmfernandes
I found that the reason this is happening with DOGECOIN is that it is trying to buy a fraction of DOGECOIN. with the pricing being so low, you are not able to purch fractions of these coins.
The work around that I am implementing is to buy
price = float(robin_stocks.crypto.get_crypto_quote(DOGE).get('ask_price'))
shares = round(1.00/price, 0)
robin_stocks.orders.order_buy_crypto_by_quantity(DOGE, shares)