OpenTrader is an advanced cryptocurrency trading bot offering high-frequency, cross-exchange arbitrage and event-based strategies, including technical analysis with indicators. Features a user-friendly management UI, robust backtesting capabilities, and support for 100+ exchanges via CCXT.
Strategies:
DCA
: Dollar-Cost Averaging (DCA) strategy that buys an asset at regular intervals.Supported exchanges: OKX
, BYBIT
, BINANCE
, KRAKEN
, COINBASE
, GATEIO
# NodeJS v18 or higher
$ node -v
# `pnpm` must be installed
$ pnpm -v
# Install Turborepo globally
$ pnpm install turbo --global
# Docker (optional)
$ docker -v
The project uses a single .env
file in the root directory.
Frameworks such as Next.js require the .env
file to be located directly in the project directory.
To address this, some apps/packages
might include a symlink pointing to the root .env
file.
.env
in the root directory$ cp .env.example .env
DATABASE_URL
if your URL is different from the actual one.$ pnpm install
/packages/**
$ turbo run build --filter='./packages/*'
$ turbo run prisma:migrate
$ turbo run prisma:seed
⚠️ Note: Since the packages do not have a dev server, running the
build
command is mandatory on the first run.
Copy the exchanges.default.json5
file to exchanges.dev.json5
and add your API keys.
Supported exchanges: OKX, BYBIT, BINANCE, KRAKEN, COINBASE, GATEIO
Create the strategy configuration file config.dev.json5
. We will use the grid
strategy as an example.
{
// Grid strategy params
settings: {
highPrice: 70000, // upper price of the grid
lowPrice: 60000, // lower price of the grid
gridLevels: 20, // number of grid levels
quantityPerGrid: 0.0001, // quantity in base currency per each grid
},
pair: "BTC/USDT",
exchange: "DEFAULT",
}
Currently supported strategies:
grid
,rsi
Command: pnpm opentrader backtest <strategy> --from <date> --to <date> -t <timeframe>
Example running a grid
strategy on 1h
timeframe.
$ pnpm opentrader backtest grid --from 2024-03-01 --to 2024-06-01 -t 1h
To get more accurate results, use a smaller timeframe, e.g. 1m, however, it will take more time to download OHLC data from the exchange.
Command: pnpm opentrader trade <strategy>
Example running a live trading with grid
strategy.
$ pnpm opentrader trade grid
After
Ctrl+C
, the orders created by the bot will remain on the exchange. To cancel them, use thepnpm opentrader stop
command.
The user interface allows managing multiple bots and strategies, viewing backtest results, and monitoring live trading.
Currently, the UI is under development. For early access, please email me at contact@opentrader.pro
After getting the access, run the following command to pull the UI into monorepo:
$ git submodule update --init
Run frontend app:
$ pnpm i
$ turbo run build --filter='./packages/*'
$ turbo run dev
Licensed under the Apache 2.0 License. See the LICENSE file for more information.