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

Implement saving virtual orders into state #487

Merged
merged 20 commits into from
Aug 20, 2019

Conversation

bitphage
Copy link
Collaborator

@bitphage bitphage commented Feb 19, 2019

This PR implements keeping virtual orders in the db (see #442) and also keeping of initial and current orders for visualization purposes (#636).

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'
Copy link
Collaborator

@thehapax thehapax left a 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

@thehapax thehapax requested a review from joelvai April 15, 2019 05:23
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 joelvai merged commit b73d2af into Codaone:devel Aug 20, 2019
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

Successfully merging this pull request may close these issues.

4 participants