6 Runtime Controls
Peter Keeler edited this page 2020-12-17 16:13:14 -08:00

Controlling Arbitrader at Runtime

Arbitrader has some limited support for controlling it while it runs. To interact with the bot directly, you can create empty files with special names. The bot will detect the file, act on it, and delete it.

If you run Arbitrader inside a Docker container, you will need to create the files inside the Docker container for Arbitrader to see them. You can do something like this to get a shell inside the container:

docker exec -it <container name> /bin/sh

Enter a New Trade

To force Arbitrader to enter a trade even though the spread isn't good enough, create a file named force-open in the directory where Arbitrader is running. The content of the file should be as follows:

CurrencyPair LongExchangeName/ShortExchangeName

For example:

BTC/USD BitFlyer/Kraken

The intention of this command is primarily for testing without having to rely on good market conditions. I'm not sure why else you would want to enter a trade without waiting for good prices. 🤷‍♂️

Exit the Current Trade

To force Arbitrader to exit the current trade, create a file named force-close in the directory where Arbitrader is running. In a few seconds you should see the bot close the trade.

Please note that if there are other trade opportunities open at the time, the bot may immediately enter a new trade. If the market would cause the bot to enter the same trade again, it will wait to exit until the spread worsens.

Exit When Idle

To make Arbitrader shut down whenever the current trade closes (or immediately if there is no active trade), create a file named exit-when-idle in the directory where Arbitrader is running.

Blackout Windows

Sometimes exchanges are down for planned maintenance, or you may not want it to trade for other reasons. You can do that by specifying Blackout Windows.

To make Arbitrader avoid trading on an exchange during a period of time that you specify, create a file named blackout in the directory where Arbitrader is running. Each line of the file should be a comma separated list with exactly three elements: the name of the exchange, the start date and the end date. The file may have as many lines as you want, although an excessively large file may impact performance. It is safe to edit or delete the file while Arbitrader is running, without restarting.

Kraken,2020-02-15T11:11:00-07:00,2020-02-15T23:11:00-07:00

You can find the name of the exchange in any log message from Arbitrader where it mentions the exchange. It must exactly match or the bot will not respect your blackout window.

The format for the dates is the standard ISO-8601 format.