mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 17:13:51 +00:00
Merge pull request #1017 from zenixls2/script/sync_time
feature: add sync_time.sh utility
This commit is contained in:
commit
3d0de0926c
17
README.md
17
README.md
|
@ -232,6 +232,23 @@ bbgo pnl --exchange binance --asset BTC --since "2019-01-01"
|
|||
|
||||
## Advanced Configuration
|
||||
|
||||
### Synchronize System Time With Binance
|
||||
|
||||
BBGO provides the script for UNIX systems/subsystems to synchronize date with Binance. `jq` and `bc` are required to be installed in previous.
|
||||
To install the dependencies in Ubuntu, try the following commands:
|
||||
|
||||
```bash
|
||||
sudo apt install -y bc jq
|
||||
```
|
||||
|
||||
And to synchronize the date, try:
|
||||
|
||||
```bash
|
||||
sudo ./scripts/sync_time.sh
|
||||
```
|
||||
|
||||
You could also add the script to crontab so that the system time could get synchronized with Binance regularly.
|
||||
|
||||
### Testnet (Paper Trading)
|
||||
|
||||
Currently only supports binance testnet. To run bbgo in testnet, apply new API keys
|
||||
|
|
3
scripts/sync_time.sh
Executable file
3
scripts/sync_time.sh
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/sh
|
||||
|
||||
date -s @`echo "$(curl https://api.binance.com/api/v3/time 2>/dev/null | jq .serverTime)/1000"|bc -l`
|
Loading…
Reference in New Issue
Block a user