Second attempt to automatically close positions on Kraken #40

Merged
scionaltera merged 21 commits from close-kraken-positions into master 2019-03-27 21:05:25 -07:00
scionaltera commented 2019-01-04 22:11:10 -08:00 (Migrated from github.com)

It appears that Kraken actually modifies the volume of open positions over time, and requires that the volume match exactly when you place an order to close a position. Arbitrader remembers the volume from when it opened the position, but if the position was open for a few days it may have changed. We're going to remember the order ID and fetch the new volume (if the exchange supports it; not all of them do) and use that to close the position. If anything goes wrong we'll fall back to the volume we used to open the position.

In small scale, short term tests this strategy appears to work. I'm still waiting on a longer term position to close so I can see it "in the wild".

It appears that Kraken actually modifies the volume of open positions over time, and requires that the volume match exactly when you place an order to close a position. Arbitrader remembers the volume from when it opened the position, but if the position was open for a few days it may have changed. We're going to remember the order ID and fetch the new volume (if the exchange supports it; not all of them do) and use that to close the position. If anything goes wrong we'll fall back to the volume we used to open the position. In small scale, short term tests this strategy appears to work. I'm still waiting on a longer term position to close so I can see it "in the wild".
scionaltera commented 2019-03-27 21:08:11 -07:00 (Migrated from github.com)

I wasn't able to confirm this fix in the wild like I wanted. The bot has not been trading very frequently lately. Unfortunately a lot of other stuff ended up on this branch and it is now preventing other development. The easiest way forward is to merge this PR and start working on other features. If the Kraken problem re-emerges, I'll do a better job of tackling it in an isolated branch and not blocking feature development.

I wasn't able to confirm this fix in the wild like I wanted. The bot has not been trading very frequently lately. Unfortunately a lot of other stuff ended up on this branch and it is now preventing other development. The easiest way forward is to merge this PR and start working on other features. If the Kraken problem re-emerges, I'll do a better job of tackling it in an isolated branch and not blocking feature development.
Commenting is not possible because the repository is archived.
No description provided.