lomacks / bittrex-order-refresh

Periodically refresh Bittrex orders to avoid 28 day order cancellation policy
20 stars 5 forks source link

bittrex-order-refresh

What is this?

A tool to periodically "refresh" (cancel and recreate) Bittrex limit orders to work around Bittrex's new policy of automatically cancelling orders older than 28 days. Each time the program is run it will refresh orders older than a threshold (14 days by default). It should be run periodically (e.g. every few days) to keep all orders up to date.

Important: The tool attempts to identify and handle any potential errors, and also backs up the list of orders before changing anything as an extra safeguard. However, it is a good idea to keep an eye on the output to ensure everything worked as expected. I also can't be responsible for any unforeseen problems, so use this tool at your own risk.

The tool is open source and written in Node.js (JavaScript) so you can vet the source code. You just need to install the Node.js runtime in order to use it - instructions below.

Installation & Usage

Windows

You can now start the tool by double-clicking the run_windows script. Do that every few days to keep your orders up to date.

Mac OSX

You can now start the tool by double-clicking the run_osx script. Do that every few days to keep your orders up to date.

What does it do?

Refresh orders

The tool will identify any orders created more than 14 days ago (by default), and then cancel and recreate them. Only limit buy and limit sell orders are supported (market orders are left alone). Partially-filled orders should be handled correctly, and error-handling in the tool should be fairly robust - but keep an eye on the output.

Restore from backup

The tool also has the ability to restore orders from one of the auto-generated backups, but this shouldn't be needed under normal circumstances. If you do want to do this, usage is along the lines of:

npm start -- --purge-open-orders  # WARNING: This will cancel ALL currently open limit orders (to avoid duplicates when restoring)
npm start -- --restore-orders backups/backup-<date>.json  # This recreates all limit orders from the backup file

There is also a shell script, util/csv-to-json.sh, which may be useful for importing order lists from CSV files (e.g. if you kept a manual backup of your open orders before Bittrex cancelled them).