A sim run batch aggregator / automator for Zenbot. Eases the process of backtesting and subsequent analysis of results.
·
Report Bug
·
Request Feature
Table of Contents
- About The Project
-
Getting Started
- Prerequisites
- Installation - work in progress
- Usage - work in progress
- Roadmap
- Contributing
- License
- Contact
- Acknowledgements
This application is a companion to the cryptocurrency trading bot Zenbot. Zenbot Sim Runner is able to import various data from Zenbot and then automate the running of simulations across multiple variations of multiple strategies.
I built this because:
- Testing and refining strategies is key to profitable use of a trading bot.
- Zenbot's built in default functionality allows running of only simulation at a time, so tweaking parameters for comparison is laborious.
- Zenbot stores simulation results in a format which does not easily allow comparison across multiple simulations.
This was primarily built for my own use and so is super-janky in places! There are no tests, no form validation, etc etc, so errors and bugs at this stage are to be expected.
Zenbot itself has disclaimers that should suffice, but just to be sure the message gets across: Use this project and Zenbot AT YOUR OWN RISK. You can and probably will lose money if and when you live trade on an exchange.
This project leverages the excellent PHP framework Laravel. In particular, it uses Laravel's job queue functionality to allow queueing up controlled submission of many simulation runs in one batch.
This section is a work in progress :)
I am running this on Manjaro Linux but it doesn't have any very exotic dependencies so it should run on any mainstream OS.
in a nutshell, you need to install the dependencies, tell it where your working instance of Zenbot is, import some data from Zenbot and away you go!
- Zenbot
This project is meaningless without it!
https://github.com/DeviaVir/zenbot - npm
You probably already have npm installed if you have a working copy of Zenbot! - composer (PHP dependency manager)
https://getcomposer.org/download/ - MySQL / MariaDB
I installed MariaDB on Manjaro. You may prefer to use a db in the cloud, or MySQL on Ubuntu etc etc. You could probably use MSSQL Server and maybe others because Laravel provides a layer of abstraction between the DB and the app code. I have only tested wiyth MariaDB. - Redis
https://redis.io/topics/quickstart
Note: Zenbot Sim Runner does not deal with backfilling - you need to do this directly from Zenbot before running any relevant sim runs.
-
Clone the repo
git clone https://github.com/jefc1111/zenbot-sim-runner.git
-
Install NPM packages
npm install
-
Install composer packages
composer install
-
Build front end bundle
npm run dev
-
Create database tables
php artisan migrate
-
Set your queue connection to 'redis'. In Laravel's
.env
by addingQUEUE_CONNECTION=redis
. In the absence of that line it will default tosync
(which can be more convenient for troubleshooting etc). -
Start the app using PHP's built in web server (alternatively you could run it on an Apache or nginx web server)
php artisan serve
In my own dev environment right now I have to run three commands to get things working;
redis-server
php artisan horizon
php artisan serve
Work in progress
- Import strategies, exchanges and products from Zenbot (this populates the corresponding MySQL tables)
- Create a sim run batch (select strategies, refine strategies, confirm)
- Run the batch, or individual sim runs
- Observe queued jobs
- View results
- Copy batch details
Distributed under the MIT License.
Geoff - [email protected]
Project Link: https://github.com/jefc1111/zenbot-sim-runner