Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
7264 commits
Select commit Hold shift + click to select a range
0a3269e
Merge pull request #1441 from c9s/c9s/fix-sync-since-time-override
c9s Dec 8, 2023
3e382e0
Merge pull request #1443 from c9s/feature/xdepthmaker
c9s Dec 8, 2023
d4a201b
upgrade go requirement to 1.20
c9s Dec 8, 2023
c90e5d1
upgrade docker image for go 1.20
c9s Dec 8, 2023
e303184
Merge pull request #1444 from c9s/feature/upgrade-go-1.20
c9s Dec 8, 2023
2c3ccdf
xdepthmaker: more improvements
c9s Dec 11, 2023
de7eb84
xdepthmaker: refactor auth binding to bindAuthSignal
c9s Dec 11, 2023
cedd790
xdepthmaker: add lastOrderReplenishTime to prevent replacing orders t…
c9s Dec 11, 2023
98468b3
xdepthmaker: change priceHeartBeat alert to warning
c9s Dec 11, 2023
8c13092
types: add slice book test for copy depth
c9s Dec 11, 2023
9f14215
bbgo: reduce logs
c9s Dec 11, 2023
8c6724b
xdepthmaker: fix pricing book copy by avoiding using CopyDepth
c9s Dec 11, 2023
158c48b
bbgo: change verbose info log to debug log
c9s Dec 11, 2023
f39474f
github: upgrade golang linter to v1.54
c9s Dec 11, 2023
15fa832
github: upgrade to actions/setup-go@v4
c9s Dec 11, 2023
d960d4f
Merge pull request #1445 from c9s/feature/xdepthmaker
c9s Dec 11, 2023
c5282a8
bitget: add more debug logs
c9s Dec 12, 2023
b2895a0
Merge pull request #1446 from c9s/feature/xdepthmaker
c9s Dec 12, 2023
c2724c4
pkg/exchange: fix price is zero when order not executed
bailantaotao Dec 12, 2023
8025d05
core: log trades pruning
c9s Dec 12, 2023
97c3992
core: adjust TradeExpiryTime to 3 hour
c9s Dec 12, 2023
685f332
core: enable trade store's trade pruning in NewTradeCollector
c9s Dec 12, 2023
21c8593
core: add exceededMaximumTradeStoreSize check
c9s Dec 12, 2023
a6d9b66
Merge pull request #1447 from c9s/edwin/bitget/fix-price
bailantaotao Dec 12, 2023
4e26b9d
core: pull out cool trade period to a constant
c9s Dec 12, 2023
cc33028
Merge pull request #1448 from c9s/c9s/fix-grid2-memory-leaks
c9s Dec 13, 2023
6d944f0
build(deps): bump @babel/traverse in /apps/frontend
dependabot[bot] Dec 13, 2023
b022a61
bitget: add bitget log prefix
c9s Dec 12, 2023
f3ce4c2
bitget: refactor debug function tool
c9s Dec 12, 2023
6cbb17f
all: refactor log formatter functions
c9s Dec 13, 2023
f90ef33
Merge pull request #1449 from c9s/dependabot/npm_and_yarn/apps/fronte…
c9s Dec 13, 2023
29550f0
pkg/exchange: we don't need the fee rate in the public stream
bailantaotao Nov 22, 2023
115c2dc
bbgo: refactor active orderbook
c9s Dec 13, 2023
092d5cf
FEATURE: cancel maker orders and open take profit order
kbearXD Nov 24, 2023
e3d5177
rename
kbearXD Dec 7, 2023
7e61fe4
Merge pull request #1436 from c9s/kbearXD/dca2/open-takeprofit-orders
kbearXD Dec 13, 2023
c170eac
bbgo: fix active order book graceful cancel checking logics
c9s Dec 13, 2023
61fb795
Merge pull request #1450 from c9s/feature/xdepthmaker
c9s Dec 13, 2023
c870def
xdepthmaker: improve shutdown process
c9s Dec 13, 2023
6dd3766
Merge pull request #1451 from c9s/feature/xdepthmaker
c9s Dec 13, 2023
e86b1bb
REFACTOR: make all common.Strategy from pointer to value
kbearXD Dec 13, 2023
4a54611
Merge pull request #1452 from c9s/refactor/strategy/common
c9s Dec 13, 2023
2c7e429
Merge pull request #1429 from c9s/edwin/bybit/get-fee-rate-on-private…
c9s Dec 13, 2023
84a43cf
DOCS: Fix grammatical errors
singodiyashubham87 Dec 13, 2023
84b34e0
update command doc files
c9s Dec 14, 2023
8690977
bump version to v1.55.0
c9s Dec 14, 2023
6d7ff54
add v1.55.0 release note
c9s Dec 14, 2023
e7c3582
fix: import tzdata package
c9s Dec 15, 2023
2a8124c
update command doc files
c9s Dec 15, 2023
19636ae
bump version to v1.55.1
c9s Dec 15, 2023
0466165
add v1.55.1 release note
c9s Dec 15, 2023
3e6d6e1
all: move Initialize() call out, call it before the LoadState
c9s Dec 18, 2023
c5decf9
pkg/exchange: support v2 get asset api
bailantaotao Dec 18, 2023
fe2fa19
Merge pull request #1455 from c9s/c9s/fix-persistence-loading
kbearXD Dec 18, 2023
c71152d
Merge pull request #1453 from singodiyashubham87/issue-1369
c9s Dec 18, 2023
f19ed7a
xdepthmaker: initialize s.CrossExchangeMarketMakingStrategy in Initia…
c9s Dec 18, 2023
038d180
bitget: check bitget websocket trade id and order status
c9s Dec 18, 2023
eda0723
FIX: move common.Strategy to Initialize
kbearXD Dec 18, 2023
4bdaf11
Merge pull request #1459 from c9s/kbearXD/fix/move-common-strategy
c9s Dec 18, 2023
92aa765
bbgo: add recordPosition log
c9s Dec 18, 2023
8412295
bitget: add more debug logs for orderEvent and tradeEvent
c9s Dec 18, 2023
98468fe
Merge pull request #1458 from c9s/feature/xdepthmaker
c9s Dec 18, 2023
63b2625
update command doc files
c9s Dec 18, 2023
3ac862d
bump version to v1.55.2
c9s Dec 18, 2023
1361fa5
add v1.55.2 release note
c9s Dec 18, 2023
3ba46f9
github: fix release workflow
c9s Dec 18, 2023
671ce87
bbgo: fix and improve session UpdatePrice method
c9s Dec 18, 2023
882c127
bbgo: pull out findPossibleMarketSymbols and add tests
c9s Dec 18, 2023
49896bf
Merge pull request #1460 from c9s/c9s/fix-xnav-price-query
c9s Dec 18, 2023
2c9583c
xdepthmaker: remove redundant notification
c9s Dec 18, 2023
84085e0
xdepthmaker: fix duplicated binding
c9s Dec 18, 2023
47b12ed
xdepthmaker: call bbgo.Sync on shutdown
c9s Dec 18, 2023
083f626
Merge pull request #1461 from c9s/c9s/fix-xdepthmaker
c9s Dec 18, 2023
e855214
bump version to v1.55.3
c9s Dec 18, 2023
66a90c5
add v1.55.3 release note
c9s Dec 18, 2023
ec4f43b
bollmaker: support custom quantity
c9s Dec 19, 2023
25c895b
add emacross strategy
c9s Nov 5, 2023
85e87e1
cmd: add emacross to builtin
c9s Nov 5, 2023
6abb320
emacross: clean up and update config
c9s Nov 7, 2023
3dd93b6
emacross, scmaker: fix strategy initialization
c9s Dec 19, 2023
4894a59
fixedmaker, liquiditymaker: update initialize method
c9s Dec 19, 2023
6a07af8
bollmaker: define EMACrossSetting
c9s Dec 19, 2023
f047e75
Merge pull request #1462 from c9s/c9s/bollmaker-custom-quantity
c9s Dec 19, 2023
46329c3
bollmaker: add ema cross signal to bollmaker strategy
c9s Dec 19, 2023
127d448
config: disable emaCross by default
c9s Dec 19, 2023
311ba3b
bollmaker: fix ema cross subscription
c9s Dec 20, 2023
382a789
config: document emaCross in config
c9s Dec 20, 2023
a4f996c
Merge pull request #1393 from c9s/strategy/emacross
c9s Dec 20, 2023
bfd9c8a
FEATURE: run state machine
kbearXD Nov 27, 2023
da02c92
fix profit stats and position
narumiruna Dec 20, 2023
762a090
graceful cancel orders
narumiruna Dec 20, 2023
7b121b1
rebalance on order filled
narumiruna Dec 20, 2023
eb36ed6
xdepthmaker: remove the shared trade collector and order store, add m…
c9s Dec 20, 2023
58321e8
xdepthmaker: update instance id format
c9s Dec 20, 2023
3ba1621
xdepthmaker: simplify covered handler registration
c9s Dec 20, 2023
26f7d86
Merge pull request #1466 from c9s/c9s/fix-xdepthmaker
c9s Dec 20, 2023
b46b82d
update command doc files
c9s Dec 20, 2023
f292387
bump version to v1.55.4
c9s Dec 20, 2023
00c9f2e
add v1.55.4 release note
c9s Dec 20, 2023
7f8a331
Merge pull request #1465 from c9s/narumi/rebalance/fix-position-and-p…
narumiruna Dec 20, 2023
9870ea0
improve/db: add futures kilne tables
andycheng123 Dec 21, 2023
d5cbcc3
improve/db: add futures kilne sqlite tables
andycheng123 Dec 21, 2023
5b0b542
improve/db: query futures kilne if session 'futures' is true when sync
andycheng123 Dec 21, 2023
8ecba43
inventory skew
narumiruna Nov 8, 2023
6809efa
improve/db: save futures kilne to futures table
andycheng123 Dec 21, 2023
f160ea8
apply inventory-skew to fixedmaker
narumiruna Dec 21, 2023
7f0a4a9
apply inventory-skew to xfixedmaker
narumiruna Dec 21, 2023
c82cbbc
fix/futures-kline-sync: typo
andycheng123 Dec 21, 2023
66718e0
improve/backtest-sync: set exchange to use futures
andycheng123 Dec 21, 2023
0ac720c
improve/backtest: backtest with futures klines
andycheng123 Dec 22, 2023
d2f946e
improve/migration: indices for sqlite
andycheng123 Dec 22, 2023
b30b023
FEATURE: check every cuerrent state and next state is valid
kbearXD Dec 22, 2023
c250fec
Merge pull request #1463 from c9s/c9s/bollmaker-ema-crosssignal
c9s Dec 22, 2023
8878005
add DisableMarketDataStore option
c9s Dec 26, 2023
4d17d7e
grid2: subscribe 1m kline only when one of the trigger price is set
c9s Dec 26, 2023
d0f9052
Merge pull request #1472 from c9s/c9s/grid2-check-price-for-subscribe
c9s Dec 26, 2023
f4941be
Merge pull request #1471 from c9s/c9s/add-DisableMarketDataStore-option
c9s Dec 26, 2023
5592d93
add cron schedule to xnav
narumiruna Dec 23, 2023
687df81
add autobuy strategy
narumiruna Dec 22, 2023
59b1bb6
use stateTransition
kbearXD Dec 27, 2023
030c6c1
fix instance id
narumiruna Dec 28, 2023
60043d6
Merge pull request #1464 from c9s/kbearXD/dca2/run-state-and-recover
c9s Dec 28, 2023
e357959
Merge pull request #1468 from c9s/narumi/autobuy/init
narumiruna Dec 28, 2023
57282c3
FEATURE: remove Short
kbearXD Dec 22, 2023
d08aeba
Merge pull request #1473 from c9s/kbearXD/dca2/remove-short
kbearXD Dec 28, 2023
9ad94aa
pkg/exchange: add stream test for book
bailantaotao Jan 2, 2024
90020a6
improve/sync-futures: do not use GetSessionAttributes()
andycheng123 Jan 2, 2024
05536b6
improve/sync-futures: remove unused code
andycheng123 Jan 3, 2024
22a9ab0
Merge pull request #1467 from andycheng123/feature/sync-futures
andycheng123 Jan 3, 2024
30164ac
pkg/exchange: use v2 get account asset api
bailantaotao Jan 3, 2024
b5ff066
pkg/exchange: print symbol
bailantaotao Jan 3, 2024
769d3ce
Merge pull request #1456 from c9s/edwin/bitget/get-account-assets
bailantaotao Jan 3, 2024
6e03626
Merge pull request #1476 from c9s/edwin/okx/add-streaming-test
c9s Jan 3, 2024
3dca9aa
Merge pull request #1470 from c9s/narumi/xnav/schedule
c9s Jan 3, 2024
94fb883
xgap: fix order cancel error
narumiruna Jan 4, 2024
f2d5731
Merge pull request #1479 from c9s/narumi/xgap/fix
c9s Jan 4, 2024
29f3642
specify the version of morphy2k/revive-action to 2.5.4
narumiruna Jan 6, 2024
9f8bdeb
Merge pull request #1475 from c9s/narumi/rebalance/fix-instance-id
c9s Jan 6, 2024
4654022
Merge pull request #1481 from c9s/narumi/fix-workflow
narumiruna Jan 6, 2024
012fc33
xgap: refactor with common strategy
narumiruna Jan 5, 2024
9db6890
Merge pull request #1480 from c9s/narumi/xgap/refactor
narumiruna Jan 6, 2024
3ee5bf2
xgap: improve log message
narumiruna Jan 6, 2024
6367bd7
Merge pull request #1402 from c9s/narumi/fixedmaker/inventory-skew
narumiruna Jan 6, 2024
dc2895c
rename cronExpression to schedule
narumiruna Jan 6, 2024
eb4f43b
Merge pull request #1483 from c9s/narumi/rename
c9s Jan 6, 2024
9dd4de0
Merge pull request #1482 from c9s/narumi/xgap/log
c9s Jan 6, 2024
36aadf7
xgap: check balance before placing orders
narumiruna Jan 6, 2024
b7a397b
Merge pull request #1484 from c9s/narumi/xgap/check-balance
narumiruna Jan 6, 2024
9c10838
xgap: print currency
narumiruna Jan 7, 2024
ad8ea86
change max borrowable query from error to warn
c9s Jan 7, 2024
0b90660
pkg/exchange: refactor book and kline
bailantaotao Jan 2, 2024
2afc72d
Merge pull request #1477 from c9s/edwin/okx/refactor-book-stream
bailantaotao Jan 8, 2024
33deaea
bitget: bitget ignore offline symbols
c9s Jan 8, 2024
cfe3b64
update bitget v2 get_symbols_request_requestgen
c9s Jan 8, 2024
e358da1
bitget: log symbol status
c9s Jan 8, 2024
11309ac
Merge pull request #1487 from c9s/c9s/bitget-ignore-offline-symbols
c9s Jan 8, 2024
006256a
FEATURE: add callbacks and shutdown function
kbearXD Dec 27, 2023
05870c5
move EmitReady and add go:generate
kbearXD Jan 2, 2024
b965dbe
use OrderExecutor.GracefulCancel to replace cancelAllOrders
kbearXD Jan 3, 2024
0d6c666
fix
kbearXD Jan 3, 2024
faaaaab
FEATURE: rename and use specific profit stats
kbearXD Jan 2, 2024
468b73a
bbgo.Sync profit stats
kbearXD Jan 3, 2024
21e8707
FEATURE: ProfitStats for dca2
kbearXD Jan 8, 2024
2e34f78
pkg/exchange: support market trade streaming
bailantaotao Jan 8, 2024
f33ed6a
Merge pull request #1485 from c9s/narumi/xgap/improve-log
c9s Jan 8, 2024
2ff74a5
autoborrow: add repaid alert
c9s Jan 9, 2024
c36975e
Merge pull request #1488 from c9s/c9s/autoborrow-repay-slack-mention
c9s Jan 9, 2024
a680df2
Merge pull request #1486 from c9s/edwin/okx/add-market-trade-stream
bailantaotao Jan 9, 2024
147b31d
pkg/exchange: refactor account stream
bailantaotao Jan 9, 2024
ba5882f
pkg/exchange: generate instrument request by requestgen
bailantaotao Jan 9, 2024
6e160e7
pkg/exchange: add rate limiter to QueryMarkets
bailantaotao Jan 9, 2024
caef31d
pkg/exchange: early return if error
bailantaotao Jan 9, 2024
2beec1d
Merge pull request #1490 from c9s/edwin/okx/query-mkts
bailantaotao Jan 9, 2024
6d7a01f
pkg/exchange: generate ticker request by requestgen
bailantaotao Jan 9, 2024
188b781
pkg/exchange: add rate limiter to ticker/tickers
bailantaotao Jan 9, 2024
0bf1e4e
Merge pull request #1489 from c9s/edwin/okx/refactor-account-info
bailantaotao Jan 9, 2024
c2e3fed
Merge pull request #1492 from c9s/edwin/okx/refactor-tickers
bailantaotao Jan 9, 2024
a463c02
pkg/exchange: generate account by requestgen
bailantaotao Jan 9, 2024
9297293
pkg/exchange: refactor query account balance
bailantaotao Jan 9, 2024
d3bc37f
use CommonCallback and pull PersistenceTTL out
kbearXD Jan 9, 2024
08fa1e9
Merge pull request #1493 from c9s/edwin/okx/refactor-account
bailantaotao Jan 9, 2024
1786e6f
DOCS: Translate the README into zh_TW
huang47 Jan 7, 2024
90ae233
doc: fix frontend path
huang47 Jan 10, 2024
7305661
Merge pull request #1495 from huang47/doc/build-from-source
c9s Jan 10, 2024
ce6073b
Merge pull request #1491 from huang47/doc/README-zh-TW
huang47 Jan 10, 2024
1dedd32
pkg/exchange: support unsubscribe and resubscribe
bailantaotao Jan 10, 2024
a7aa34c
pkg/exchange: add comment
bailantaotao Jan 10, 2024
6e661c8
fix
kbearXD Jan 10, 2024
4a0c9ca
Merge pull request #1474 from c9s/kbearXD/dca2/callbacks-and-close
kbearXD Jan 10, 2024
260eef3
pkg/exchange: generate place order request by requestgen
bailantaotao Jan 10, 2024
9da9130
Merge pull request #1496 from c9s/edwin/pkx/fix-sub-events
bailantaotao Jan 10, 2024
8eb5556
Merge pull request #1494 from c9s/edwin/okx/place-order
bailantaotao Jan 11, 2024
373242d
pkg/exchange: generate cancel order by requestgen
bailantaotao Jan 10, 2024
2bd93b4
Merge pull request #1497 from c9s/edwin/okx/cancel-order
c9s Jan 11, 2024
905148a
maxapi: use fastjson parser pool
c9s Jun 26, 2021
68be0ba
max: improve depth parsing speed
c9s Jun 28, 2021
c01be14
max: remove unused var
c9s Jun 28, 2021
b352ae8
pkg/exchange: add query open orders
bailantaotao Jan 11, 2024
228bfba
pkg/fixedpoint: support "" on fixedpoint.Value.unmarshalJson
bailantaotao Jan 11, 2024
03449d0
Merge pull request #1498 from c9s/edwin/okx/query-open-orders
bailantaotao Jan 14, 2024
fa145a3
pkg/exchange: refactor query closed order
bailantaotao Jan 12, 2024
cee61c1
Merge pull request #1500 from c9s/edwin/okx/query-closed-order
bailantaotao Jan 15, 2024
11506fb
pkg/exchange: fix queryTrades and queryOrderTrade api
bailantaotao Jan 15, 2024
735123b
Merge pull request #1501 from c9s/edwin/okx/query-trade
bailantaotao Jan 16, 2024
91913f0
pkg/exchange: refactor order trade event by json.Unmarshal
bailantaotao Jan 16, 2024
c5d2047
pkg/exchange: emit balance snapshot after authed
bailantaotao Jan 17, 2024
7f90620
Merge pull request #1503 from c9s/edwin/okx/push-balance-snapshot
bailantaotao Jan 17, 2024
a363377
[dca2] new struct profit stats and its recover
kbearXD Jan 12, 2024
9836dc6
truncate notional when open position
kbearXD Jan 17, 2024
80d8c00
pkg/exchange: set ping interval
bailantaotao Jan 17, 2024
62c19b4
Merge pull request #1502 from c9s/edwin/okx/order-trade-event
bailantaotao Jan 17, 2024
44dc5c5
remove balance checker
kbearXD Jan 17, 2024
465206a
use cancel api not GracefulCancel in CleanUp
kbearXD Jan 17, 2024
8ceadd8
Merge pull request #1504 from c9s/edwin/okx/implement-ping-interval
bailantaotao Jan 18, 2024
ac649b3
pkg/exchange: add cash trade mode to place order req
bailantaotao Jan 18, 2024
1c0333b
Merge pull request #1505 from c9s/edwin/okx/fix-bugs
bailantaotao Jan 18, 2024
1b33308
fix bug and new field running to help to test
kbearXD Jan 18, 2024
9a1b50d
upgrade rockhopper to v2
c9s Jan 18, 2024
3e23362
add migration package name
c9s Jan 18, 2024
611b2a9
improve bbgo db migration process
c9s Jan 18, 2024
cfa0468
for create table statement dont use txn
c9s Jan 19, 2024
0e5ff14
Merge pull request #1506 from c9s/feature/rockhopper-v2
c9s Jan 19, 2024
7841813
pkg/exchange: fix okx query open order time param
bailantaotao Jan 23, 2024
d13d882
remove unused log
kbearXD Jan 23, 2024
4152926
Merge pull request #1508 from c9s/edwin/okx/fix-query-open-order-param
bailantaotao Jan 23, 2024
e6f9113
max: set max websocket book default level
c9s Jan 24, 2024
ea70544
add environment config example
c9s Jan 24, 2024
59713fa
support extra migration packages
c9s Jan 24, 2024
3d7371a
github: add go test count 3 to ci
c9s Jan 24, 2024
930d73c
add contributor license agreement file
c9s Jan 24, 2024
c7027db
update CLA.md
c9s Jan 24, 2024
eb8bc94
Merge pull request #1510 from c9s/c9s/feature/extra-migration-packages
c9s Jan 24, 2024
884b8f2
Merge pull request #1509 from c9s/kbearXD/dca2/profit-stats-and-recover
c9s Jan 24, 2024
ee1a272
compile and update migration package
c9s Jan 24, 2024
f184334
Merge pull request #1511 from c9s/c9s/update-migrations
c9s Jan 24, 2024
dd07bc7
fix bollinger indicator history kline push
c9s Jan 24, 2024
cb1133b
Merge pull request #1512 from c9s/c9s/fix-boll-history-kline-push
c9s Jan 24, 2024
fcd367b
max: pre-allocate price volume slice memory
c9s Jun 29, 2021
e67155d
max: optimize book parsing
c9s Jul 8, 2021
6cf5300
max: preallocate fastjson array object var memory
c9s Jul 8, 2021
805fea3
types: avoid using defer unlock in CopyDepth
c9s Jan 24, 2024
07eb723
binance: support more depth level
c9s Jan 24, 2024
18ccc78
binance: apply DefaultDepthLimit to 5000
c9s Jan 24, 2024
3aa6b0c
max: remove unused parseBookEntries function
c9s Jun 28, 2021
c148477
binance: make the error message clear
c9s Jan 24, 2024
df9036f
improve/refactor-kline-table: kline tables per exchange per symbol
andycheng123 Jan 25, 2024
935882c
improve/refactor-kline-table: dynamically create kline tables
andycheng123 Jan 25, 2024
3ebdca5
improve/refactor-kline-table: order by after union
andycheng123 Jan 25, 2024
aa0fc1b
improve/refactor-kline-table: order by for only 1 symbol
andycheng123 Jan 25, 2024
375a29e
improve/refactor-kline-table: fix sql for query multiple kiline table
andycheng123 Jan 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/contracts
.env.*
/linode
/frontend
/desktop
/data
/output
13 changes: 13 additions & 0 deletions .env.local.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
SLACK_TOKEN=YOUR_TOKEN
SLACK_CHANNEL=CHANNEL_NAME

# DB_DRIVER="sqlite3"
# DB_DSN="bbgo.sqlite3"
DB_DRIVER=mysql
DB_DSN=root@tcp(127.0.0.1:3306)/bbgo

MAX_API_KEY=YOUR_API_KEY
MAX_API_SECRET=YOUR_API_SECRET

BINANCE_API_KEY=YOUR_API_KEY
BINANCE_API_SECRET=YOUR_API_SECRET
3 changes: 3 additions & 0 deletions .evans.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[default]
protoFile = ["pkg/pb/bbgo.proto"]
package = "bbgo"
Empty file added .gitattributes
Empty file.
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These are supported funding model platforms

github: c9s
custom: [https://etherscan.io/address/0x5ed8508e3d046cbe9ff44d6063e29349000c8ddd]
60 changes: 60 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Docker Image

on:
workflow_dispatch:
inputs:
ref:
description: 'ref to build'
required: false
default: 'main'
push:
# Sequence of patterns matched against refs/tags
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
branches:
- "main"

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
# list of Docker images to use as base name for tags
images: |
yoanlin/bbgo
quay.io/yoanlin/bbgo
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to Quay Container Registry
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
# tags: yoanlin/bbgo:latest
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
104 changes: 104 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Go

on:
push:
branches: [ main ]
pull_request:
branches:
- "main"
- "v*"

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15

strategy:
matrix:
redis-version:
- "6.2"
go-version:
- "1.20"
env:
MYSQL_DATABASE: bbgo
MYSQL_USER: "root"
MYSQL_PASSWORD: "root" # pragma: allowlist secret

steps:

- uses: actions/checkout@v2
with:
# lfs: 'true'
ssh-key: ${{ secrets.git_ssh_key }}

- uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Set up MySQL
run: |
sudo /etc/init.d/mysql start
mysql -e 'CREATE DATABASE ${{ env.MYSQL_DATABASE }};' -u${{ env.MYSQL_USER }} -p${{ env.MYSQL_PASSWORD }}

- name: Set up redis
uses: shogo82148/actions-setup-redis@v1
with:
redis-version: ${{ matrix.redis-version }}
# auto-start: "false"

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

- name: Install Migration Tool
run: go install github.com/c9s/rockhopper/cmd/[email protected]

- name: Test Migration SQL Files For MySQL
run: |
rockhopper --config rockhopper_mysql.yaml up

- name: Test Migration SQL Files For SQLite
run: |
rockhopper --config rockhopper_sqlite.yaml up

- name: Build
run: go build -v ./cmd/bbgo

- name: Link Market Data
run: |
mkdir -p ~/.bbgo/cache
ln -s $PWD/data/binance-markets.json ~/.bbgo/cache/binance-markets.json
touch data/binance-markets.json

- name: Test
run: |
go test -count 3 -race -coverprofile coverage.txt -covermode atomic ./pkg/...
sed -i -e '/_requestgen.go/d' coverage.txt

- name: TestDnum
run: |
go test -race -coverprofile coverage_dnum.txt -covermode atomic -tags dnum ./pkg/...
sed -i -e '/_requestgen.go/d' coverage_dnum.txt

- name: Revive Check
uses: morphy2k/[email protected] # https://github.com/mgechev/revive/issues/956
with:
reporter: github-pr-review
fail_on_error: true

- name: Upload Coverage Report
uses: codecov/codecov-action@v3
with:
files: ./coverage.txt,./coverage_dnum.txt

- name: Create dotenv file
run: |
echo "DB_DRIVER=mysql" >> .env.local
echo "DB_DSN=root:root@/bbgo" >> .env.local

22 changes: 22 additions & 0 deletions .github/workflows/golang-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: golang-lint
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: read

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
with:
go-version: 1.21
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.54
40 changes: 40 additions & 0 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Node.js CI

on:
push:
branches: [ main ]
paths:
- apps/backtest-report
- frontend
pull_request:
branches: [ main ]
paths:
- apps/backtest-report
- frontend

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [ 16.x ]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install -g yarn
- name: Install
run: yarn install
working-directory: "apps/backtest-report"
- name: Build
run: yarn run next build
working-directory: "apps/backtest-report"
- name: Export
run: yarn run next export
working-directory: "apps/backtest-report"
- run: yarn export
working-directory: "frontend"
48 changes: 48 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Python

on:
push:
branches: [ main ]
paths:
- python

pull_request:
branches: [ main ]
paths:
- python

jobs:

build:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: [ 3.8 ]

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install poetry
run: pip install poetry==1.1.13

- name: Install package
run: |
cd python
poetry install

- name: Test
run: |
cd python
poetry run pytest -v -s tests

- name: Lint
run: |
cd python
poetry run flake8 .
Loading