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

Draft behavior of order execution logic #15

Closed
arnaudj opened this issue Dec 16, 2021 · 2 comments
Closed

Draft behavior of order execution logic #15

arnaudj opened this issue Dec 16, 2021 · 2 comments

Comments

@arnaudj
Copy link
Collaborator

arnaudj commented Dec 16, 2021

Should we draft a spec with the overall behavior we want to implement? Then translate that into actual code handled by the right module.

This could take the form of a github gist (with python pseudo code, e.g), or a google doc, or other

No strong idea on the format. I find this kind of doc interesting: https://docs.hummingbot.io/strategies/twap
note the activity diagram that helps build a finite state machine (pseudo code can be enough) that could be tick-ed from a task queue, eg.

This could be the opportunity to clarify behavior (eg: are we supposed to have open orders overnight? what do we do with open orders intraday: what is the trigger for us to decide to replace their price? Should a TargetPositionRequest be considered constant during a day? etc)

@CharlesFr
Copy link
Collaborator

CharlesFr commented Dec 17, 2021

I made a quick diagram of the execution logic, I hope this helps.

image

A few notes:

  • I think it would be wise to add a timeout to this loop, if reached it'll place a market order
  • Update price can use the order book and match the price of the 3rd best bid/ask
  • Security.name should lose the base currency 'BTC/USD' becomes 'BTC' then we can add an additional field execution_symbol to the security model. It can default to USD base currency (for spot) but can be manually changed in the admin panel. The logic for deciding this isn't trivial and doesn't need to be automated right now.

@arnaudj
Copy link
Collaborator Author

arnaudj commented Feb 4, 2022

Drafted in a google doc, open for comment.

I'm considering closing this issue, unless somebody is actively working on this

@arnaudj arnaudj closed this as completed Feb 24, 2022
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

2 participants