Check whether a market is active before trading #51

Closed
opened 2019-03-15 22:03:11 -07:00 by scionaltera · 1 comment
scionaltera commented 2019-03-15 22:03:11 -07:00 (Migrated from github.com)

I ran into a situation today where BCH/USD was temporarily halted on an exchange and the bot wanted to trade it. It obviously couldn't, but kept trying and throwing exceptions for a few minutes. It would be nicer if it checked first and didn't treat it like an error.

I ran into a situation today where BCH/USD was temporarily halted on an exchange and the bot wanted to trade it. It obviously couldn't, but kept trying and throwing exceptions for a few minutes. It would be nicer if it checked first and didn't treat it like an error.
scionaltera commented 2019-04-10 21:31:41 -07:00 (Migrated from github.com)

This is made more complicated because I can't find any method in XChange to ask an Exchange whether a particular market is active or not. We may just have to rely on catching the exception and reversing the first trade if it succeeded. That's not a great solution because this situation pretty much only happens in times of very high volatility and even the few milliseconds between opening a trade, realizing it needs to be reversed and reversing it could result in losses.

This is made more complicated because I can't find any method in XChange to ask an `Exchange` whether a particular market is active or not. We may just have to rely on catching the exception and reversing the first trade if it succeeded. That's not a great solution because this situation pretty much only happens in times of very high volatility and even the few milliseconds between opening a trade, realizing it needs to be reversed and reversing it could result in losses.
Commenting is not possible because the repository is archived.
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
scion/arbitrader#51
No description provided.