forked from xeroc/stakemachine
-
Notifications
You must be signed in to change notification settings - Fork 127
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
Implement saving virtual orders into state #487
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Purge saved virtual orders only if no buy AND sell orders. If we have both buy and sell real orders, restore both. If we have only one type of orders, restore corresponding virtual orders and purge opposite orders.
AttributeError: 'NoneType' object has no attribute 'values'
thehapax
reviewed
Mar 13, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Staggered Orders is getting really large. We should refactor so that it is not so large and a clearer separation of logic. For example, virtual orders extracted out would be a starting point. @PermieBTS
Carbon-Zero
approved these changes
Apr 5, 2019
This is more clean than using a price as id.
Add new columns "virtual" and "custom" to Orders table. "Virtual" is for indicating virtual order, "Custom" is for adding any custom data in string format, may be used by any strategy to add additional info about order. This commit also introduces database migrations mechanism via alembic tool. Seems like it's the best solution for sqlalchemy to handle schema updates.
Use new storage methods to save/restore virtual orders
Add notice, add workaround to purge test worker orders from the db on teradown.
New method is needed to be able selectively remove orders from the db.
* Operational depth following is strict now (don't keep additional 5 orders on price movements) * Order size check is removed as orders are kept in state and not restored from scratch * Order replacement is now happening in single `for` cycle instead of one-per-maintenance
joelvai
approved these changes
Aug 8, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements keeping virtual orders in the db (see #442) and also keeping of initial and current orders for visualization purposes (#636).