Skip to content
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

[potentially a bug] SimpleOrder: comparing BTC unit to USD unit #454

Open
spacegoing opened this issue Dec 10, 2022 · 0 comments
Open

[potentially a bug] SimpleOrder: comparing BTC unit to USD unit #454

spacegoing opened this issue Dec 10, 2022 · 0 comments

Comments

@spacegoing
Copy link

spacegoing commented Dec 10, 2022

This part of logic is potentially a bug:

quantity = (size * instrument).quantize()
if size < 10 ** -instrument.precision \
or size < self.min_order_pct * portfolio.net_worth \
or size < self.min_order_abs:
return []

For a USD/BTC pair, when the side is sell, quantity is measured in BTC. However, or size < self.min_order_pct * portfolio.net_worth \ is comparing BTC against USD. Is this potentially a bug?

What is the purpose of this condition?

Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant