Install Go
$ brew update
$ brew install golang
Update your .bashrc / .bash_profile file
Add these lines to your .bashrc
file.
export GOPATH=$HOME/{{ GO_WORKSPACE_DIR }} # Change this to your go workspace.
export GOROOT=/usr/local/bin/go # Location of your go installation
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
Source your updated bash profile
$ source ~/.bash_profile
Install Postgres
- Download Postgres
- Download Postico
- Open Postgres App and
Initialize
- Open Postico and connect with these settings...
Host: localhost
Password: _empty_
Port: 5432
Database: postgres
Download Mirgation Tool
$ go get github.com/rubenv/sql-migrate/...
Upload Schema to Database
$ make setup-db
Create an API Key
- Create
./bittrex.env
- Add the following lines...
export BITTREX_API_KEY="test"
export BITTREX_API_SECRET="test"
- Source the environment variables
$ source bittrex.env
Navigate to Bittrex Settings
Download all the dependencies
$ govendor sync
Build Executable
$ make cli
Run Setup
$ bin/cli setup
Run Trading Bot
$ bin/cli trader
Backtesting involves running a strategy over existing data to determine if it will be profitable. To backtest, you need to create a new strategy in the strategies folder. It must abide by the Strategy interface{}
and have ShouldBuy()
and ShouldSell()
.
First, update the GetStrategy
function in cmd/cli/backtest.go
to point to your new strategy. Then build and run.
# Build CLI
$ make cli
# Run Backtest with 1h chart and btc-eth market
$ bin/cli backtest --interval=1h --marketKey=btc-eth
You will see a summary and the percent change on your investment.
The ticker application can will run and collect hourly ticker information for all of the markets on an exchange.
# Build CLI
$ make cli
# Run ticker
$ bin/cli ticker --exchange=bittrex
We collect hourly ticker information from bittrex due to API Rate Limit Restrictions. Then, every morning at 00:10 UTC, we process the last 24 hourly ticks and generate a 24H candle. This data is all written to RDS.