Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
6796 commits
Select commit Hold shift + click to select a range
43cd25c
Merge pull request #1278 from c9s/c9s/strategy-deposit2transfer
c9s Aug 9, 2023
1c5d2dc
add QueryOrder in okex exchange.go
Aug 9, 2023
24d240b
Merge pull request #1279 from bailantaotao/edwin/add-query-acct
bailantaotao Aug 9, 2023
6103a93
deposit2transfer: add lastAssetDepositTimes for immediate success dep…
c9s Aug 9, 2023
ecc0928
Merge pull request #1281 from c9s/c9s/strategy-deposit2transfer
c9s Aug 9, 2023
e9d0ce5
pkg/exchage: support k line rest api
bailantaotao Aug 9, 2023
4cee22c
pkg/exchage: support k line websocket event
bailantaotao Aug 9, 2023
6379cab
Merge pull request #1277 from bailantaotao/edwin/add-kline-api
bailantaotao Aug 10, 2023
ace2c55
exchange/bybit: add fee rate restful api
bailantaotao Aug 10, 2023
0b03336
pkg/exchange: support GetFeeRates on bybit exchange
bailantaotao Aug 10, 2023
509f9ac
pkg/types: add BeforeConnect hook function
bailantaotao Aug 10, 2023
affff32
pkg/exchange: get fee rate before connect
bailantaotao Aug 10, 2023
54e7065
pkg/exchange: implement trade event
bailantaotao Aug 10, 2023
ea5b45b
queryOrder() and test for it
Aug 11, 2023
a74562e
improve/profitStatsTracker: Add a parameter for window to sum up trades
andycheng123 Aug 11, 2023
d43c358
Merge pull request #1282 from bailantaotao/edwin/add-trade-info
bailantaotao Aug 11, 2023
255718a
deposit2transfer: apply rate limiter on checkDeposits
c9s Aug 11, 2023
bc9f7b7
Merge pull request #1284 from c9s/c9s/strategy-deposit2transfer
c9s Aug 11, 2023
1874290
pkg/exchange: fix orderId json tag
bailantaotao Aug 14, 2023
ed47d50
pkg/exchange: fix the order id check for cancel order
bailantaotao Aug 14, 2023
10185ee
Merge pull request #1283 from andycheng123/improve/profitStatsTracker
andycheng123 Aug 15, 2023
3207a82
pkg/exchange: add QueryOrder api
bailantaotao Aug 15, 2023
e4ebe1c
pkg/exchange: supprot queryOrderTrades
bailantaotao Aug 15, 2023
672a878
update toGlobalOrder by referencing toGlobalOrders
Aug 15, 2023
2fda447
bitget: implement QueryMarkets
c9s Aug 9, 2023
40762ca
bitget: implement QueryTicker
c9s Aug 9, 2023
4a64701
bitget: implement QueryAccount
c9s Aug 9, 2023
5f54c30
bitget: fix fixedpoint.Value init value
c9s Aug 15, 2023
fb5cc41
migrations: add bybit klines
bailantaotao Aug 15, 2023
adf5805
compile and update migration package
bailantaotao Aug 15, 2023
874b647
cmd: document tradeStats binding
c9s Aug 15, 2023
252f4fb
deposit2transfer: call QuerySpotAccount for getting the spot balance
c9s Aug 16, 2023
5cc09df
deposit2transfer: improve log format
c9s Aug 16, 2023
52f9cbd
Merge pull request #1288 from c9s/c9s/strategy-deposit2transfer
c9s Aug 16, 2023
6cfbb84
pkg/exchange: fix order id check for the submitted orders
bailantaotao Aug 15, 2023
b6c9f14
Merge pull request #1285 from bailantaotao/edwin/query-order
bailantaotao Aug 16, 2023
3eeba52
Merge pull request #1289 from bailantaotao/edwin/fix-misc-2
bailantaotao Aug 16, 2023
6f4f1ad
Merge pull request #1287 from bailantaotao/edwin/add-bybit-kline-back…
bailantaotao Aug 16, 2023
dda3f25
grid2,bbgo: refactor active order book and update order status when r…
c9s Aug 17, 2023
2669c3a
bbgo: check order exists
c9s Aug 17, 2023
1cadaf9
bbgo: add mutex lock to ActiveOrderBook
c9s Aug 17, 2023
c91861c
bbgo: add order update time check
c9s Aug 17, 2023
9105ebc
deposit2transfer: fix err msg
c9s Aug 16, 2023
ed948b2
max: fix QuerySpotAccount method return value
c9s Aug 17, 2023
ca698f8
Merge pull request #1291 from c9s/c9s/strategy-deposit2transfer
c9s Aug 17, 2023
3ad7075
pkg/exchange: fix quantity coin unit
bailantaotao Aug 17, 2023
3dce637
Fix to fit all reviews last time
Aug 21, 2023
9ee7377
pkg/exchange: fix quantity for buy market order
bailantaotao Aug 18, 2023
20bdf19
Merge pull request #1290 from c9s/c9s/grid-disconnect-recover
c9s Aug 21, 2023
edfcbb0
Merge pull request #1293 from bailantaotao/edwin/fix-quantity-in-buy-…
bailantaotao Aug 22, 2023
a4aa9c2
remove mmp and mmp_post_only
Aug 22, 2023
a0946fb
use lower case in error string and add comment for IOC, FOK
Aug 22, 2023
26cde5d
use multierr to handle err return from toGlobalOrder
Aug 23, 2023
f8ae408
add continue in err != nil
Aug 23, 2023
2c4b6e8
Merge pull request #1238 from MengShue/add_unit_test_for_okex
c9s Aug 24, 2023
9dc7244
FEATURE: round down executed amount to avoid insufficient balance
kbearXD Aug 31, 2023
cb02855
add lock to recoverActiveOrders
c9s Aug 31, 2023
7de6c3d
grid2: add more update logs
c9s Aug 31, 2023
f24bd35
grid2: add 5s delay and <10seconds jitter
c9s Aug 31, 2023
52412d9
refactor: add `IsOver` to check the since time is over given duration
narumiruna Aug 31, 2023
e74da87
grid2: delay start process by 5s
c9s Aug 31, 2023
594ab9c
pkg/exchange: fix okex bookticker bug
bailantaotao Sep 1, 2023
50bfd8e
pkg/exchange: add time to SliceOrderBook
bailantaotao Sep 1, 2023
412d0e0
*: fix lint
bailantaotao Sep 1, 2023
415a28c
Merge pull request #1300 from bailantaotao/edwin/fix-okex-bid-ask
c9s Sep 1, 2023
8adb0df
Merge pull request #1298 from c9s/c9s/grid2-fix-recover-active-orders
c9s Sep 1, 2023
57198cc
fix: reset profit stats when over given duration in circuit break ris…
narumiruna Aug 31, 2023
9c104f5
Merge pull request #1297 from c9s/narumi/reset-profit-stats
narumiruna Sep 5, 2023
79d98e8
Merge pull request #1295 from c9s/feature/grid2/amount-round-down
kbearXD Sep 5, 2023
7461b60
Merge pull request #1299 from bailantaotao/edwin/add-server-time
bailantaotao Sep 5, 2023
db376f8
FEATURE: use quote quantity if there is QuoteQuantity in trade
kbearXD Sep 5, 2023
f5a66ba
pkg/exchage: set default 30d for closed order batch query
bailantaotao Sep 5, 2023
83cdd4e
pkg/exchange: update add reconnect and resubscribe func for stream
bailantaotao Sep 6, 2023
da13bb6
pkg/exchange: support unsubscribe for bybit
bailantaotao Sep 6, 2023
1338499
Merge pull request #1303 from bailantaotao/edwin/add-default-time
bailantaotao Sep 6, 2023
7550ea2
refactor okex to future use
Sep 6, 2023
dbf29f8
add constructor to check url error
Sep 6, 2023
9a66f82
remove err since handling init for client
Sep 7, 2023
c9d67f8
improve/binance: update futures account api to v2
andycheng123 Sep 7, 2023
d91199d
Merge branch 'c9s:main' into edwin/add-new-func-for-subscriptions
bailantaotao Sep 7, 2023
09ed7b1
Merge pull request #1305 from MengShue/refactor_okex_for_future
c9s Sep 7, 2023
40dbfd5
improve/binance: rename variable to comply with golang naming convention
andycheng123 Sep 8, 2023
e5c3b8c
Merge pull request #1301 from bailantaotao/edwin/add-new-func-for-sub…
bailantaotao Sep 8, 2023
439f45b
Merge pull request #1304 from bailantaotao/edwin/support-unsubscribe
bailantaotao Sep 8, 2023
1c5ad1d
pkg/exchange: support market trade for bybit
bailantaotao Sep 10, 2023
4f82843
Merge pull request #1306 from andycheng123/improve/binance-api
c9s Sep 11, 2023
388b9c3
Merge pull request #1308 from bailantaotao/edwin/add-trade-stream
bailantaotao Sep 11, 2023
faa2596
pkg/exchange: add auth callback to standard stream
bailantaotao Sep 13, 2023
e56d8d1
pkg/exchange: emit auth in each exchange
bailantaotao Sep 14, 2023
a47c846
add QueryOrderTrades() for okex
Sep 8, 2023
4a8407b
Merge pull request #1309 from bailantaotao/edwin/add-auth-event
c9s Sep 14, 2023
5f8a5e4
activeorderbook: add pending order logs
c9s Sep 17, 2023
8314a7e
types: improve order string format
c9s Sep 17, 2023
4b78bfc
types: improve order string format
c9s Sep 17, 2023
797ee44
types: fix pending order update comparison
c9s Sep 17, 2023
89c88c4
bbgo: log filled order
c9s Sep 17, 2023
542944b
max: use websocket update time (TU) field
c9s Sep 17, 2023
907bf1f
Merge pull request #1310 from c9s/c9s/fix-pending-order-update-for-max
c9s Sep 17, 2023
42ee961
pkg/exchange: emit regardless of whether there is an error or not.
bailantaotao Sep 18, 2023
a22c41f
Merge pull request #1307 from MengShue/add_QueryOrderTrades_for_okex
c9s Sep 18, 2023
6d0c266
Merge pull request #1302 from c9s/feature/grid2/use-quote-quantity
kbearXD Sep 19, 2023
fdfa363
FEATURE: use retry query order until successful
kbearXD Sep 19, 2023
f2cb458
Merge pull request #1314 from c9s/feature/grid2/use-retry-until-succe…
c9s Sep 19, 2023
c8316a3
use common strategy in fixedmaker
narumiruna Sep 19, 2023
a3df61d
Merge pull request #1311 from bailantaotao/edwin/add-on-raw-message-c…
bailantaotao Sep 20, 2023
49e9c8b
Merge pull request #1315 from c9s/narumi/fixedmaker/common
c9s Sep 21, 2023
294e511
pkg/types: ensure all routines are done
bailantaotao Sep 19, 2023
4a231b1
pull out ishalted method
narumiruna Sep 21, 2023
e86a75c
Merge pull request #1317 from bailantaotao/edwin/waiting-all-routines…
bailantaotao Sep 21, 2023
db7a0df
types: change websocket error to warnf
c9s Sep 25, 2023
1600277
Merge pull request #1319 from c9s/c9s/ws-error-to-warnf
c9s Sep 25, 2023
550b010
bbgo: add log fields support to the core
c9s Sep 25, 2023
b6d0e3e
grid2: only do active order update when grid is recovered
c9s Sep 18, 2023
fdaa92c
Merge pull request #1320 from c9s/feature/logging
c9s Sep 25, 2023
94f6cef
grid2: improve active order recover logs
c9s Sep 25, 2023
8f40478
Merge pull request #1313 from c9s/fix/grid2-active-orders
c9s Sep 25, 2023
cf31796
Merge pull request #1318 from c9s/narumi/common-risk
c9s Sep 25, 2023
99a69f4
add QueryClosedOrders() and QueryTrades() for okex, also fix conflict…
Sep 18, 2023
ad72062
QueryTrades only allow query by time interval, required
Sep 22, 2023
7ae56a8
feature: add forceOrder api for binance to show liquid info
zenixls2 Jul 14, 2023
9fffa4a
add atrpin strategy
c9s Sep 26, 2023
7a5a027
bbgo: add logging filledOrder option
c9s Sep 26, 2023
7088453
pkg/exchange: emit balance snapshot
bailantaotao Sep 26, 2023
9f83165
pkg/exchange: use balance update instead of snapshot event
bailantaotao Sep 26, 2023
13b9fc4
add forgotten emit
zenixls2 Sep 26, 2023
2e4336a
fix: listenKeyExpired event sends string timestamp
zenixls2 Sep 26, 2023
65b3d2c
Merge pull request #1324 from bailantaotao/edwin/emit-balance-snapshot
bailantaotao Sep 26, 2023
117d7f0
types: add stringer on type ticker
c9s Sep 26, 2023
716fea8
backtest: add more order checking
c9s Sep 26, 2023
2d578db
bbgo: simplify marketDataStore accessor
c9s Sep 26, 2023
bc7f268
indicator: check valid window value for RMA
c9s Sep 26, 2023
9a7b70d
bbgo: reformat order executor
c9s Sep 26, 2023
3b6e1e3
indicator/v2/tr: use PushAndEmit instead of just EmitUpdate
c9s Sep 26, 2023
e52e53a
refine atrpin strategy
c9s Sep 26, 2023
3b63858
handle pagenation for QueryTrade
Sep 27, 2023
d4330a7
atrpin: add minPriceRange config
c9s Sep 27, 2023
9a05357
pkg/exchange: remove the limitation of query range due to bybit suppo…
bailantaotao Sep 27, 2023
08dad1c
fix: replace json.Number with MillisecondTimestamp in types
zenixls2 Sep 27, 2023
add1c73
pkg/exchange: support pagination
bailantaotao Sep 27, 2023
1117fe3
Merge pull request #1323 from c9s/c9s/strategy/atrpin
bailantaotao Sep 27, 2023
d37682e
Merge pull request #1326 from bailantaotao/ediwn/fix-bybit-query-trades
bailantaotao Sep 27, 2023
2058ce8
Merge pull request #1325 from zenixls2/fix/listenkeyexpired
c9s Sep 27, 2023
4b9c933
remove skew
narumiruna Sep 28, 2023
c5cd6bc
fix common.Strategy.IsHalted
narumiruna Sep 28, 2023
6fd86fe
add unit test for QueryTrade()
Oct 2, 2023
a40d4a6
compile and update migration package
c9s Oct 2, 2023
ca15ee6
update command doc files
c9s Oct 2, 2023
43fd404
bump version to v1.52.0
c9s Oct 2, 2023
51ac5dd
add v1.52.0 release note
c9s Oct 2, 2023
648b82e
use NewGetTransactionHistoryRequest for QueryTrades and use billID fo…
Oct 2, 2023
cc55d67
use default limit if not pass AND add more unit test
Oct 3, 2023
b1c6e01
use types.StrInt64 for billID and add more comment for QueryTrades() …
Oct 3, 2023
32b8ca9
Merge pull request #1312 from MengShue/add_two_new_receiver_for_okex
c9s Oct 4, 2023
f50d819
Merge pull request #1330 from c9s/narumi/fixedmaker/remove-atr
narumiruna Oct 4, 2023
d200232
add supported interval for okex
Oct 2, 2023
a833358
use interval [1m/3m/5m/15m/30m/1H/2H/4H] and [/6Hutc/12Hutc/1Dutc/2Du…
Oct 3, 2023
0b5ce23
fix lint and rename i with in
Oct 4, 2023
3b793b7
turn ToGlobalInterval to ToLocalInterval, use Map to turn to local in…
Oct 4, 2023
4700e75
maxapi: change default http transport settings
c9s Oct 4, 2023
42d2ffd
Merge pull request #1334 from c9s/c9s/max-http-transport
c9s Oct 4, 2023
2309bbd
print local interval in error message
Oct 4, 2023
78ea940
max: support private channel setter
c9s Oct 2, 2023
378425a
bbgo: add balance logger support
c9s Oct 2, 2023
590e164
fix: use MillisecondTimestamp instead
zenixls2 Oct 5, 2023
e01d89d
Merge pull request #1232 from zenixls2/feature/forceOrder
c9s Oct 5, 2023
a13c65e
Merge pull request #1332 from MengShue/add_supported_interval
c9s Oct 5, 2023
a40488b
add xfixedmaker strategy
narumiruna Oct 5, 2023
a0efa27
add randtrader strategy
narumiruna Oct 4, 2023
81ea074
check balances
narumiruna Oct 7, 2023
d8ff42d
Fix duplicate orders caused by position risk control
narumiruna Sep 27, 2023
4a6f6f7
add backtest config
narumiruna Oct 11, 2023
a7042c5
Merge pull request #1336 from c9s/narumi/randtrader
narumiruna Oct 11, 2023
10be0ec
Merge pull request #1331 from c9s/narumi/fixedmaker/x
c9s Oct 11, 2023
2f65793
Merge pull request #1327 from c9s/narumi/fix-position-risk
c9s Oct 11, 2023
a8d678a
rename randomtrader to random
narumiruna Oct 11, 2023
0a3baea
Merge pull request #1337 from c9s/narumi/rename-random
narumiruna Oct 11, 2023
a0a7b0f
grid2: set max retries
c9s Oct 11, 2023
d617bf8
Merge pull request #1338 from c9s/fix/add-grid2-max-retires
c9s Oct 11, 2023
ef582f6
pkg/exchange: support order book depth 200 on bybit
bailantaotao Oct 12, 2023
69b38fc
update xfixedmaker config
narumiruna Oct 12, 2023
20df2ef
Merge pull request #1335 from c9s/c9s/feature/private-channels
c9s Oct 12, 2023
42748d7
Merge pull request #1340 from c9s/narumi/xfixedmaker/config
narumiruna Oct 12, 2023
fb110a1
Merge pull request #1339 from bailantaotao/edwin/support-200-depth
bailantaotao Oct 13, 2023
ca80bdb
FEATURE: recover active orders with open orders periodically
kbearXD Sep 28, 2023
4c9b1e7
remove checker
kbearXD Oct 2, 2023
27294ac
FIX: fix some error and use chan to trigger active orders recover whe…
kbearXD Oct 6, 2023
1347c8e
grid2: refactor recoverActiveOrdersPeriodically
c9s Oct 9, 2023
5f9d020
grid2: improve some logging
c9s Oct 9, 2023
a39925b
grid2: invert if
c9s Oct 9, 2023
c6d4ebf
also sync orders already in active orderbook if the open orders are e…
kbearXD Oct 11, 2023
136c2cd
add open orders metrics
kbearXD Oct 11, 2023
de1a884
not add non existing open orders into active orderbook if updated in …
kbearXD Oct 12, 2023
c544937
add test and remove recovered atmoic bool
kbearXD Oct 13, 2023
badadaf
remove adjustQuantity from config
narumiruna Oct 13, 2023
4c69dcc
make rightWindow possible to be set as zero
c9s Oct 16, 2023
dfa3f7d
indicator: make right window optional
c9s Oct 16, 2023
d50e509
Merge pull request #1342 from c9s/improve/pivot-right-window-usage
c9s Oct 16, 2023
5ff3828
move to onAuth
kbearXD Oct 16, 2023
c257bc8
sleep 100ms to avoid DDOS
kbearXD Oct 17, 2023
243b90a
fix nil metrics error
kbearXD Oct 17, 2023
10daeab
FIX: [max] remove outdated margin fields
gx578007 Oct 17, 2023
ccb7308
fix
kbearXD Oct 17, 2023
98b2944
Merge pull request #1341 from c9s/narumi/random/amount
c9s Oct 17, 2023
3bc03ff
Merge pull request #1328 from c9s/feature/grid2/recover-active-order-…
kbearXD Oct 17, 2023
92396ca
bbgo: check symbol length for injection
c9s Oct 18, 2023
5c8c66a
Merge pull request #1343 from c9s/bhwu/max/remove-outdated-max-fields
gx578007 Oct 18, 2023
6b273ed
Merge pull request #1345 from c9s/c9s/fix-market-inject
c9s Oct 18, 2023
900db74
skip public session
narumiruna Oct 19, 2023
5dbb7bd
Merge pull request #1346 from c9s/narumi/xnav/skip-public
narumiruna Oct 19, 2023
51d86ca
pkg/exchange, types: support book stream on bitget
bailantaotao Oct 18, 2023
c268041
config: add logging sample config
c9s Oct 20, 2023
eb404a5
Merge pull request #1280 from c9s/feature/bitget
c9s Oct 20, 2023
f8c47f7
Merge pull request #1344 from bailantaotao/edwin/bitget/public-stream…
bailantaotao Oct 20, 2023
c9fca56
MINOR: remove profit entries from profit stats
kbearXD Oct 20, 2023
e9078a7
FEATURE: twin orderbook
kbearXD Oct 20, 2023
a18b1be
pkg/exchange: support market trade stream on bitget
bailantaotao Oct 19, 2023
09e2b84
Merge pull request #1347 from bailantaotao/edwin/bitget/public-stream…
bailantaotao Oct 20, 2023
2ef86e4
Update README.md
mishrasamiksha Oct 21, 2023
da5f8f5
Fixed a typo in README.md
saakshii12 Oct 22, 2023
7c1f090
Merge pull request #1352 from saakshii12/readme-fix
c9s Oct 22, 2023
7860bff
Merge pull request #1349 from c9s/feature/grid2/remove-profit-entries
c9s Oct 22, 2023
3150f6b
fix
kbearXD Oct 23, 2023
6b5dd65
go: update requestgen to v1.3.5
bailantaotao Oct 23, 2023
e03d97b
Merge pull request #1353 from bailantaotao/edwin/upgrade-rquestgen
c9s Oct 23, 2023
c977b8e
add lock to protect twin orderbook and add more comments
kbearXD Oct 23, 2023
7d97f57
Merge pull request #1350 from c9s/feature/grid2/twin-orderbook
kbearXD Oct 24, 2023
3710c33
REFACTOR: rename file and variable
kbearXD Oct 23, 2023
a9d9ef3
Add AddSubscriber method on Float64Series
c9s Oct 24, 2023
4c16546
indicator: remove unnecessary zero value push
c9s Oct 24, 2023
3fcc21c
Merge pull request #1356 from c9s/c9s/fix-rma-zero-value-issue
c9s Oct 24, 2023
22a7232
fix duplicate rma value
narumiruna Oct 24, 2023
2a9fd10
add rma test cases
narumiruna Oct 24, 2023
4f35f21
Merge pull request #1357 from c9s/narumi/rma-test-cases
narumiruna Oct 24, 2023
3e5869c
remove zero padding from RMA
narumiruna Oct 24, 2023
7557579
Update CONTRIBUTING.md
sh4d0wy Oct 24, 2023
16f4d8d
Merge pull request #1358 from c9s/narumi/remove-zero-padding
c9s Oct 24, 2023
4b9d520
Merge pull request #1355 from c9s/refactor/grid2/rename-and-move
c9s Oct 24, 2023
ea98899
Merge pull request #1351 from mishrasamiksha/main
c9s Oct 24, 2023
2d6af10
Merge pull request #1360 from sh4d0wy/patch-1
c9s Oct 24, 2023
ab1bc99
FEATURE: prepare query trades funtion for new recover
kbearXD Oct 23, 2023
7e532f5
Updated README.md
rohan37kumar Oct 25, 2023
3d4a128
Merge pull request #1362 from rohan37kumar/main
c9s Oct 25, 2023
c611cfe
pkg/exchange: add a jumpIfEmpty to batch trade option
bailantaotao Oct 25, 2023
881db49
pkg/exchange: rename tradeRateLimiter to queryOrderTradeRateLimiter
bailantaotao Oct 25, 2023
d762366
Merge pull request #1364 from bailantaotao/edwin/make-jump-to-option
bailantaotao Oct 26, 2023
55d444d
pkg/exchange: add jumpIfEmpty opts to closed order batch query
bailantaotao Oct 26, 2023
8ddb31b
Merge pull request #1365 from bailantaotao/edwin/make-jump-to-option-2
bailantaotao Oct 26, 2023
c4f1af0
Merge pull request #1361 from c9s/feature/grid2/recover-preparation-f…
kbearXD Oct 26, 2023
d9474bb
pkg/types, pkg/exchange: add ExchangeTimeRangeProvider and use it as …
bailantaotao Oct 26, 2023
1448c05
pkg/exchange: support TimeRangeProvider in bybit
bailantaotao Oct 26, 2023
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
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.18
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@v3
with:
go-version: ${{ matrix.go-version }}

- name: Install Migration Tool
run: go install github.com/c9s/rockhopper/cmd/rockhopper@v1.2.1

- 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 -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/revive-action@v2
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@v3
with:
go-version: 1.18
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.46.2
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