robin_stocks icon indicating copy to clipboard operation
robin_stocks copied to clipboard

Always getting an error when using order_sell_crypto_by_price

Open dfnoriega opened this issue 4 years ago • 8 comments

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.

dfnoriega avatar May 17 '20 00:05 dfnoriega

What parameters are you passing to the function?

jmfernandes avatar May 17 '20 01:05 jmfernandes

r.orders.order_sell_crypto_by_price('DOGE',5,priceType='ask_price')

dfnoriega avatar May 17 '20 16:05 dfnoriega

Try using 5.00 as the price instead of 5.

jmfernandes avatar May 17 '20 16:05 jmfernandes

Just tried it. Nothing yet.

dfnoriega avatar May 17 '20 16:05 dfnoriega

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

griever-ghost avatar Aug 14 '20 00:08 griever-ghost

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.

mpr3z1v3 avatar Aug 15 '20 19:08 mpr3z1v3

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

mpr3z1v3 avatar Aug 15 '20 19:08 mpr3z1v3

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)

buckeye1038 avatar Feb 01 '21 01:02 buckeye1038