-
Notifications
You must be signed in to change notification settings - Fork 271
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
Size resolution is too high error, can't buy fractional? #62
Comments
Thanks for opening an issue! In this case this should be expected behavior. Notice that when placing an order on Coinbase in the web interface, there is only a certain number of decimals you can put in your order size. In this case Coinbase enforces a maximum resolution of 1e-8 of your base currency. You created an order for 0.008585614459548448 base, which has a higher resolution than coinbase allows. We enforce the resolutions in the backtest so that you can be confident your live model will also be able to accurately submit orders. Solution:This is why we built Try wrapping your market orders to look like this: state.interface.market_order(symbol, side="buy", size=blankly.trunc(buy, 8)) state.interface.market_order(symbol, side='sell', size=blankly.trunc(curr_value, 8)) This will enforce an 8 decimal accuracy and truncate higher accuracy decimals. I recommend viewing the order filter we're checking with by doing: print(state.interface.get_order_filter(symbol)) I will add a recommendation to use |
@EmersonDove Thank you for the explanation and for extending the documentation! |
Description
Some problem with the order size. Seems like we can't buy fractional coins?
Of course it can easily happen that I misunderstood something, but then a more verbose error would be better
settings.json
backtest.json (if applicable)
Error (if applicable)
Platform Info
This was the quick test code which produced the error:
The text was updated successfully, but these errors were encountered: