-
Notifications
You must be signed in to change notification settings - Fork 36
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
Invalid value error #47
Comments
Hi, After some testing a bit it looks like this only happens with the ADAXBT trading pair when 'BUY'ing with the post_market_order() function as stated above. I've tried with the 'SOLXBT' and 'XRPXBT' pairs as well and they seem to worked fine. |
Hi MrBlindMouse just out of curiosity what is the value of float(truncate(buy_val,buy_scale) if you had to print it out? |
Hi Sanari, The minimum volume for the ADAXBT trading pair is 1.0 |
Are you trying to buy ADA or XBT? I'm a novice but will try and help |
It's a buy function, so XBT |
Sorry, misstyped. Buying ADA, with XBT as the counter volume |
Have you tried rounding down the volume from say 4.701 to 4.70 as an example Thats the issue I had |
Yes, that is what the truncate function does. ADA needs to be trunced to 1 decimal and XBT to 8? I believe but the docs does not say what the counter_value needs to be scaled to |
would it not be min_price : 0.000001 and the number can't be higher than max_price : 0.01 |
I thought so as well, but I now believe those are the limits for the actual price, ie 1 ADA sells for 0.0000188 XBT at the moment. So when the market crashes or explodes then trading is forced close. And even if they are really the counter_volume limits, the value I used falls within that range |
are you sure truncate function is rounding down and not up ie 0.018 becomes 0.02 when it needs to become 0.01 |
Yes, thats what truncate does. It cuts the decimal instead of rounding up or down. Python will sometimes give strange results when trying to round. |
I will try when I get home this evening buying and see if I have any issues |
Having the same issue on my side... suspect something hasn't been implemented yet. |
Hi both 👋 Sincere apologies that no-one from Luno got back to you on this one. |
Hi Guys,
While trying to post a market order using the following,
cl.post_market_order(min_name, 'BUY', base_account_id=buy_id, counter_volume=float(truncate(buy_val,buy_scale)), counter_account_id=btc_id)
I get the error:
('ErrInvalidValue', 'Invalid value provided for counter_volume')
I'm buying on the pair 'ADAXBT'
The value is above the indicated min value and truncated to the indicated precision as per: https://api.luno.com/api/exchange/1/markets
I have no idea what could be wrong.
Help please!!!
Kind Regards
MrBlindMouse
The text was updated successfully, but these errors were encountered: