mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
doc: add doc for sqlite3
This commit is contained in:
parent
3d29c24e7b
commit
43b6ef6243
|
@ -1,6 +1,8 @@
|
||||||
## Strategy Testing
|
# Strategy Testing
|
||||||
|
|
||||||
A pre-built small backtest data db file is located at `data/bbgo_test.sql`, which contains 30days BTCUSDT kline data from binance.
|
A pre-built small backtest data mysql database file is located at `data/bbgo_test.sql`, which contains 30days BTCUSDT kline data from binance.
|
||||||
|
|
||||||
|
for SQLite, it's `data/bbgo_test.sqlite3`.
|
||||||
|
|
||||||
You can use this file for environments without networking to test your strategy.
|
You can use this file for environments without networking to test your strategy.
|
||||||
|
|
||||||
|
@ -17,8 +19,32 @@ The SQL file is added via git-lfs, so you need to install git-lfs first:
|
||||||
git lfs install
|
git lfs install
|
||||||
```
|
```
|
||||||
|
|
||||||
To import the database, you can do:
|
## Testing with MySQL
|
||||||
|
|
||||||
|
To import the SQL file into your MySQL database, you can do:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
mysql -uroot -pYOUR_PASSWORD < data/bbgo_test.sql
|
mysql -uroot -pYOUR_PASSWORD < data/bbgo_test.sql
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Setup your database correctly:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
DB_DRIVER=mysql
|
||||||
|
DB_DSN=root:123123@tcp(127.0.0.1:3306)/bbgo
|
||||||
|
```
|
||||||
|
|
||||||
|
## Testing with SQLite3
|
||||||
|
|
||||||
|
Create your own sqlite3 database copy in local:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
cp -v data/bbgo_test.sqlite3 bbgo_test.sqlite3
|
||||||
|
```
|
||||||
|
|
||||||
|
Configure the environment variables to use SQLite3:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
DB_DRIVER="sqlite3"
|
||||||
|
DB_DSN="bbgo_test.sqlite3"
|
||||||
|
```
|
||||||
|
|
Loading…
Reference in New Issue
Block a user