Open bot is an event-driven open source cryptocurrency trading bot built using Node.js and RxJS.
- The only exchange integrated is Bittrex.
- For backtesting the cryptowat.ch API is used.
- To run open bot you need a Unix bash shell from OSX or Linux. If you are using Microsoft, setup a virtual machine.
- To run the project you need to install Docker including docker-compose
- If you want to run open bot live against Bittrex you need to have
BITTREX_API_KEY
andBITTREX_API_SECRET
in your path, look at how to Obtain an API key under the "Authentication" section.
git clone https://github.com/openbot-tech/core
cd core
docker-compose build
- Go to the config file in
src/config/index.js
.
Here you will find the following variables:
Choose between
- Backtesting
- Paper testing
- Running the bot live
- Time frame (if backtest is chosen)
- Backtest days (if backtest is chosen)
- Retry order (to configure the order execution)
- Specify your market foreaxmple 'BTC-ETH' for Bitcoin / Ethereum market.
- Choose a premade strategy such as 'BBANDS-RSI' or set in your own custom strategy.
- Each folder in
src/core/strategy/strategies
folder is a strategy you can choose from
export const BACKTEST = false
export const PAPER_TRADE = false
BITTREX_API_KEY=<your api key> BITTREX_API_SECRET=<your api secret> docker-compose up --build
-
To create your own strategy take a look at the template implementation in
src/strategy/strategies/TEMPLATE
-
When you add a new folder with the strategy as
index.js
then webpack will make that folder available as a module. -
So if we add an folder called
MY_NEW_STRATEGY
insrc/strategy/strategies
you can then set theSTRATEGY
value in the config file to'MY_NEW_STRATEGY'
.
-
cd core
-
docker-compose build
- Set either 'BACKTEST' or 'PAPER_TRADE' to 'true' in
src/config/index.js
- Choose the market, strategy, time and candles you want to backtest or papertrade
- If
BACKTEST
is set totrue
then the bot will run against the historic market chosen.
- If
PAPER_TRADE
is set totrue
then the bot will run against the Bittrex socket connection but not submit any orders to the exchange.
Write docker-compose up --build
in your terminal
https://rxjs-trading-bot-client.herokuapp.com/
The difference between production and developing is how we build it with webpack and that production doesn't contain HMR
or hot module reloading which means that any changes in the project would reload the bot. If you run the project for production, changes in the code wouldn't affect the bot execution.
-
Include
HMR
and run -
Change a file in the
src
folder to verify thatHMR
is working
To run the open bot test scripts run
docker-compose -f docker-compose.yml -f docker-compose.test.yml up
=======