Strongly encourage limit orders to close #418
Labels
No labels
blocked
breaking
bug
dependencies
duplicate
enhancement
good first issue
help wanted
question
tech debt
testing
wontfix
No milestone
No project
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set.
Reference
scion/arbitrader#418
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Arbitrader can get into a mode where it's waiting for one or more limit orders to fill, either to open or close a pair of positions. If you have bad luck it can be a very long time before the orders fill, if they ever do. Currently there is no way to escape from this mode unless the orders fill. It would be nice to have a graceful way to exit this situation.
I propose a new condition like
force-closeorexit-when-idlenamedadjust-limit-orders. When you create this file, Arbitrader will look at the order(s) it's waiting on. It will adjust the price on the open order(s) to match whatever the current ticker is inTickerServiceso that the orders will probably close. The command would be repeatable in case it didn't work the first time.Of course all profit estimations are thrown off by this but you wouldn't have to exit the program, manually kill the orders in the exchanges, erase the state file, and restart like you do now.
Let's wait until the rxJava stuff is merged to do this. Right now it's going to be too complicated because we just
sleep()while we wait for the orders to complete. After that we will have nonblocking code that will allow us to do stuff like check conditions and look at tickers.I would prefer something more automatic, like a timeout. After X amount of time if both limit orders were not filled then we cancel them and start over. If one open order is not filled then we close/sell the filled one and cancel the open order.
This way we avoid more IO operations (check on the disk) and the bot can continue on it's own without needing human intervention.