Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
4966 commits
Select commit Hold shift + click to select a range
386ab1f
refactor draw on supertrend
frin1 Sep 11, 2022
e0d3a5e
Merge pull request #929 from frin1/supertrend-draw-pnl
c9s Sep 11, 2022
3c4bad6
Merge pull request #930 from andycheng123/fix/pivotshort-trendema
c9s Sep 11, 2022
080b4de
bollmaker: add doc file for bollmaker
c9s Sep 11, 2022
a425c94
bollmaker: add trendEMA support
c9s Sep 11, 2022
ad6f07a
config: reformat config comments
c9s Sep 11, 2022
7b68e5e
bbgo: fix balance lock issue
c9s Sep 11, 2022
b805b19
config: move buyBelowNeutralSMA back
c9s Sep 11, 2022
db94b26
bbgo: check base balance only for long position
c9s Sep 11, 2022
ecdfe8c
Merge pull request #932 from c9s/feature/bolllmaker-trendEMA
c9s Sep 11, 2022
14a427d
update command doc files
c9s Sep 11, 2022
aebc6f7
bump version to v1.40.3
c9s Sep 11, 2022
cacc24f
add v1.40.3 release note
c9s Sep 11, 2022
cf16176
bollmaker: fix backward compatibility of dynamic spread settings
COLDTURNIP Sep 11, 2022
4617245
pnl: fix nil position point issue
c9s Sep 11, 2022
1ea8b79
Merge pull request #933 from COLDTURNIP/fix/bollmaker_dyn_spread_sett…
c9s Sep 11, 2022
307c5f2
bbgo: add price check and add max leverage for cross margin
c9s Sep 11, 2022
3b17250
bbgo: fix account value calculation for mixed usd fiat
c9s Sep 11, 2022
53c4178
bbgo: fix reverse pair price lookup and add tests
c9s Sep 11, 2022
caf5701
bbgo: move up base balance variable
c9s Sep 11, 2022
20dd37c
slacknotifier: drop unused code
c9s Sep 11, 2022
8286356
bollmaker: fix settings overriding
COLDTURNIP Sep 11, 2022
b8e18dd
notifier: redirect error, panic, fatal error to telegram
c9s Sep 11, 2022
5db41f4
Merge pull request #934 from c9s/fix/pnl-position
c9s Sep 11, 2022
8462054
Merge pull request #936 from COLDTURNIP/fix/bollmaker_dyn_spread_sett…
c9s Sep 11, 2022
4ea723d
Merge pull request #937 from c9s/feature/telegram-error-log-hook
c9s Sep 11, 2022
2214920
Merge pull request #935 from c9s/fix/open-position
c9s Sep 11, 2022
3f87003
update command doc files
c9s Sep 11, 2022
f729937
bump version to v1.40.4
c9s Sep 11, 2022
c489794
add v1.40.4 release note
c9s Sep 11, 2022
6e6ae6c
readme: add bollmaker stackscript link
c9s Sep 12, 2022
da5b169
readme: update linode links
c9s Sep 12, 2022
424a1de
bbgo: add lightweight mode
c9s Sep 12, 2022
ccd085a
go mod tidy -compat=1.17
c9s Sep 12, 2022
99a6daa
Merge pull request #938 from c9s/feature/lightweight-mode
c9s Sep 12, 2022
a5ba870
binance: add queryTrades rate limiter
c9s Sep 12, 2022
4b78ba1
Merge pull request #939 from c9s/fix/rate-limit-adjustment
c9s Sep 12, 2022
e23ed8c
pivotshort: add fastpivot
c9s Aug 31, 2022
04f7b96
pivotshort: add fast pivot high filtering
c9s Aug 31, 2022
776f89b
pivotshort: apply OpenPositionOptions to breakLow
c9s Sep 12, 2022
ba85e7e
pivotshort: add fastWindow parameter
c9s Sep 12, 2022
b22a48c
pivotshort: fix fast low pivot filtering
c9s Sep 12, 2022
68d40de
pivotshort/failedbreakhigh: call OpenPosition method
c9s Sep 12, 2022
8d4eb61
bbgo: add more open position doc comments
c9s Sep 12, 2022
a6e01c6
Merge pull request #940 from c9s/strategy/pivotshort
c9s Sep 13, 2022
e171932
pivotshort: fix fast high filtering
c9s Sep 13, 2022
613b23e
pivotshort: add FastWindow parameter
c9s Sep 13, 2022
608f6b3
Merge pull request #941 from c9s/strategy/pivotshort
c9s Sep 13, 2022
9af58b0
fix market error
narumiruna Sep 13, 2022
0a07a70
Merge pull request #943 from narumiruna/fix/marketcap-market-error
narumiruna Sep 13, 2022
f0ea9a3
pivotshort: add one more kline price compare condition
c9s Sep 13, 2022
fe9a546
pivotshort: improve notification
c9s Sep 13, 2022
7617679
pivotshort: add EarlyStopRatio config
c9s Sep 13, 2022
809294b
bbgo: add test case for calculateNetValueInQuote
c9s Sep 13, 2022
c9b064f
types: define PriceMap type
c9s Sep 13, 2022
02dab54
bbgo: add USDTTWD price test case
c9s Sep 13, 2022
b4990f1
xnav: fix negative usd value check
c9s Sep 13, 2022
b76d779
types: add BalanceMap_Assets test case
c9s Sep 13, 2022
5305982
Merge pull request #944 from c9s/fix/net-asset-calc
c9s Sep 13, 2022
9b5f204
get marketcap values from coinmarketcap
narumiruna Sep 13, 2022
e7a7e21
remove notifiability
narumiruna Sep 13, 2022
71ae75d
fixup! get marketcap values from coinmarketcap
narumiruna Sep 13, 2022
1d1ec12
bbgo: fix telegram message error, there must be one message to send
c9s Sep 13, 2022
7b218e6
remove unused field
narumiruna Sep 13, 2022
b855267
bbgo: wrap keyboard removal in defer func
c9s Sep 13, 2022
0b9320f
interact: fix telegram message length check
c9s Sep 13, 2022
402ac58
pivotshort: fix pilotQuantity calculation
c9s Sep 13, 2022
d40b34e
feature: add modify tg command. fix wdrift ma length
zenixls2 Sep 13, 2022
cfeb0ba
Merge pull request #946 from c9s/fix/telegram-error
c9s Sep 14, 2022
a303454
Merge pull request #945 from narumiruna/feature/marketcap/coinmarketcap
c9s Sep 14, 2022
aaa657d
fix: move some modify implementation to dynamic
zenixls2 Sep 14, 2022
d022c80
bbgo: add strict condition for CumulatedVolumeTakeProfit
c9s Sep 14, 2022
4b04beb
types: fix kline receiver type
c9s Sep 14, 2022
1880553
bbgo: cumulated volume stop - compare shadow height
c9s Sep 14, 2022
54782e7
Merge pull request #947 from c9s/fix/acc-vol-stop
c9s Sep 14, 2022
dc195e8
Merge pull request #920 from austin362667/austin362667/factorzoo
c9s Sep 14, 2022
88696bc
bbgo: add more interface implementation for order executor
c9s Sep 14, 2022
ebf4abf
pivotshort: improve last high/low invalidation
c9s Sep 14, 2022
82b4594
pivotshort: remove unused trendEMA floats
c9s Sep 14, 2022
7fd2b74
bbgo: integrate MACD indicator into standard indicator set
c9s Sep 14, 2022
67b5261
indicator/macd: fix update callback and add log in pivotshort
c9s Sep 14, 2022
3ab5d35
bbgo: fix macdIndicators map initialization
c9s Sep 14, 2022
728cb6d
pivotshort: add one more kline pattern to check the break
c9s Sep 14, 2022
53d622d
pivotshort: add the kline object to the notification
c9s Sep 14, 2022
b66bcb1
fix: add more test cases on reflect.Value.Set
zenixls2 Sep 14, 2022
528d65c
fix: hide ZeroValue from dynamic
zenixls2 Sep 14, 2022
539513a
pivotshort: fix breaklow parameters
c9s Sep 14, 2022
432f9df
indicator: refactor pivot function to floats
c9s Sep 15, 2022
d236cde
add marketcap doc
narumiruna Sep 15, 2022
0096d56
types: fix gross profit calculation
c9s Sep 15, 2022
a297b26
types: fix AccumulatedSince initialization
c9s Sep 15, 2022
8bfd1f7
indicator: refactor pivot function to floats
c9s Sep 15, 2022
0ead18a
types: fix gross profit calculation
c9s Sep 15, 2022
c231a31
Merge pull request #951 from narumiruna/marketcap-doc
c9s Sep 15, 2022
f0c0c67
types: use tradedAt time instead of time.Now
c9s Sep 15, 2022
24fd819
types: init today since if it's 0
c9s Sep 15, 2022
e2dd7c7
indicator: improve macd indicator update callback
c9s Sep 15, 2022
99f915b
Merge pull request #952 from c9s/fix/profit-stats
c9s Sep 15, 2022
3d7fc75
pivotshort: add MACDDivergence protection
c9s Sep 15, 2022
427723d
bbgo: improve trendEMA condition
c9s Sep 15, 2022
cd338f8
pivotshort: add pivotWindow parameter
c9s Sep 15, 2022
9819f09
pivotshort: clean up debug comment
c9s Sep 15, 2022
9ebb8ad
optimizer: wrap error with the output if err is not nil
c9s Sep 15, 2022
2f57548
pivotshort: fix log format and notification
c9s Sep 16, 2022
d4f7482
bbgo/exit_protective_stop_loss: use types.KLineWith
c9s Sep 16, 2022
be40ed7
bbgo: refactor marginAssetUpdater
c9s Sep 16, 2022
44de961
Merge pull request #942 from zenixls2/feature/modifiable
zenixls2 Sep 16, 2022
7044b0d
fix: drift minus weight, preloaded kline not enough
zenixls2 Sep 16, 2022
46e9862
Update slack.md
narumiruna Sep 16, 2022
02bf82e
Merge pull request #954 from narumiruna/slack-doc
c9s Sep 17, 2022
39c347f
Merge pull request #950 from c9s/strategy/pivotshort
c9s Sep 17, 2022
3230088
Merge pull request #953 from zenixls2/fix/drift
c9s Sep 17, 2022
8180153
bbgo: use margin asset borrowable amount to adjust the quantity
c9s Sep 19, 2022
1d1d5d4
bbgo: init call to updateMarginAssetMaxBorrowable
c9s Sep 19, 2022
dc0fca0
types: rename json fields to grossProfit and grossLoss
c9s Sep 19, 2022
26cf048
types: preset fixedpoint zero fields
c9s Sep 19, 2022
f9f2df2
types: use passed time to reset today pnl
c9s Sep 19, 2022
59b1e52
bbgo: remove submitOrder notification
c9s Sep 19, 2022
5800eab
bbgo: remove submitOrder notification
c9s Sep 19, 2022
d771186
types: fix net asset value display in telegram
c9s Sep 19, 2022
850f3c8
types: fix net asset value display in telegram
c9s Sep 19, 2022
8e89796
Merge pull request #956 from c9s/improve/max-borrowable
c9s Sep 19, 2022
e48ae21
bbgo: remove Notifiability from the order executor
c9s Sep 19, 2022
d4398bb
bbgo: add more simple slice types to FilterSimpleArgs
c9s Sep 19, 2022
05defc3
bbgo: fix base amount borrow check
c9s Sep 19, 2022
1c23881
bbgo: check closing flag to avoid double closing
c9s Sep 19, 2022
cddc70f
Merge pull request #957 from c9s/fix/submit-order-notify
c9s Sep 19, 2022
7ef008d
telegramnotifier: show error message in the telegram log
c9s Sep 19, 2022
b3ae492
bbgo: make the max borrowing error message clear
c9s Sep 19, 2022
c8f5bf8
bbgo: check e.session.Margin flag
c9s Sep 19, 2022
d73880d
binance: upgrade github.com/adshao/go-binance/v2 to v2.3.8
c9s Sep 19, 2022
1c58a44
binance: implement get margin max borrowable request
c9s Sep 19, 2022
29376de
Merge pull request #958 from c9s/strategy/pivotshort
c9s Sep 19, 2022
b067d67
bbgo: drop legacy notification routing
c9s Sep 19, 2022
75b61ea
bbgo: add NotificationSwitches
c9s Sep 19, 2022
4387b07
bbgo: add basic notification switch
c9s Sep 19, 2022
3133d54
config: update config for new notification switches settings
c9s Sep 19, 2022
2dfa27d
Add auto-repay
frin1 Sep 19, 2022
4f99110
stratgy: add oneliner
austin362667 Sep 19, 2022
d7b9721
oneliner: add config
austin362667 Sep 19, 2022
beb1344
strategy: refactor oneliner to irr
austin362667 Sep 20, 2022
1086845
Merge pull request #961 from frin1/fix/exit_protective_stop_loss-repay
c9s Sep 20, 2022
17b5e35
Merge pull request #960 from c9s/refactor/notification
c9s Sep 20, 2022
de1b0bc
types: fix balance filtering
c9s Sep 20, 2022
247a22c
xmaker: fix profit stats notification
c9s Sep 20, 2022
15e3e82
update command doc files
c9s Sep 20, 2022
2a9fdcc
bump version to v1.41.0
c9s Sep 20, 2022
08e6e5e
add v1.41.0 release note
c9s Sep 20, 2022
097860a
fix: add rate limit on telegram api and split messages by unicode wit…
zenixls2 Sep 20, 2022
ecc93da
update xmaker configuration
c9s Sep 20, 2022
d3cae48
doc: update configuration doc
c9s Sep 20, 2022
2fb4c7e
add limit to optimizer results
frin1 Sep 20, 2022
9cce165
fix: extract split string by length as a function
zenixls2 Sep 21, 2022
d8dea22
fix: set ctx
zenixls2 Sep 21, 2022
da6161d
Merge pull request #962 from zenixls2/fix/telegram_api_limit
c9s Sep 21, 2022
fd875c7
fix: add series.filter, fix fixedpoint.Four, fix modifiable for embed…
zenixls2 Sep 22, 2022
15308fb
fix: add FieldByIndexErr and eliminate all possible panic
zenixls2 Sep 22, 2022
ac2f7de
fix: dup naming, remove Leverage from drift field
zenixls2 Sep 22, 2022
4b1f7c6
reduce frequency of querying data from coinmarketcap
narumiruna Sep 16, 2022
29f0e0d
refactoring
frin1 Sep 22, 2022
fdbcaef
fix: use ZeroAssetError, refactor
zenixls2 Sep 22, 2022
8efc948
Merge pull request #964 from zenixls2/fix/order_executor_general
c9s Sep 23, 2022
90303b3
remove unused NotifyFunc
c9s Sep 23, 2022
14c941c
bbgo: add submitOrder retry limit
c9s Sep 23, 2022
bfc4cc0
bbgo: check options.price when limit order taker ratio is given
c9s Sep 23, 2022
1342423
binance: fix futures order conversion
c9s Sep 23, 2022
53fef0e
Update adding-new-exchange.md
c9s Sep 23, 2022
0ef565e
Merge pull request #963 from frin1/feature/limit_number_of_optimizer_…
c9s Sep 23, 2022
8d92d43
Merge pull request #955 from narumiruna/improve-marketcap
c9s Sep 23, 2022
ad4ee93
fix: wrong tag in drift
zenixls2 Sep 26, 2022
b2875ee
feature: add config dump / param dump / param modify for elliottwave,…
zenixls2 Sep 27, 2022
64751ac
Merge pull request #967 from zenixls2/fix/drift_tag
c9s Sep 28, 2022
1fa542b
Merge pull request #965 from c9s/fix/binance-futures-order-types
c9s Sep 28, 2022
bf78299
Merge pull request #968 from zenixls2/refactor/dump_param
c9s Sep 28, 2022
1b531b6
Merge pull request #959 from austin362667/austin362667/factorzoo
c9s Sep 28, 2022
7b47a51
irr: fix strategy id
c9s Sep 28, 2022
5086af2
fix: reduce Quantity precheck, drift condition, ewo refactor
zenixls2 Sep 28, 2022
ffdf2a6
Merge pull request #969 from zenixls2/fix/precheck_reduceQuantity
c9s Sep 28, 2022
58736b1
refactor: extract stoploss, fix highest/lowest in trailingExit
zenixls2 Sep 29, 2022
8e82e24
fix: drift close position with retry limit
zenixls2 Sep 29, 2022
294a58c
Merge pull request #970 from zenixls2/fix/drift_position
c9s Sep 30, 2022
5c1d0f9
fix/drift_stoploss
zenixls2 Oct 3, 2022
5ed706f
Merge pull request #972 from zenixls2/fix/drift_stoploss
zenixls2 Oct 3, 2022
76b0f55
bbgo: let trader handles the shutdown handlers
c9s Sep 30, 2022
77ca1a9
bbgo: register onShutdown from the trader
c9s Sep 30, 2022
a940e88
add IsolationContext
c9s Oct 2, 2022
59287b5
all: support context isolation
c9s Oct 3, 2022
315f7da
bbgo: remove context suffix from the isolation struct
c9s Oct 3, 2022
4a37273
bbgo: remove Persistence injection
c9s Oct 3, 2022
ef6a22d
Merge pull request #973 from c9s/refactor/shutdown-handler
c9s Oct 3, 2022
f7e76c0
all: remove bbgo.Persistence
c9s Oct 3, 2022
198683d
bbgo: add NewContextWithIsolation function
c9s Oct 3, 2022
60956e0
bbgo: add NewContextWithDefaultIsolation
c9s Oct 3, 2022
ce318ff
add persistenceServiceFacade to isolation
c9s Oct 3, 2022
8a50474
all: add context parameter to Sync()
c9s Oct 3, 2022
2b953ad
bbgo: make PersistenceServiceFacade private
c9s Oct 3, 2022
731e556
telegramnotifier: fix err check
c9s Oct 3, 2022
04453c2
Merge pull request #974 from c9s/refactor/isolation
c9s Oct 4, 2022
f1ae7b5
strategy: add harmonic shark pattern recognition
austin362667 Oct 3, 2022
60e51e1
strategy: refactor harmonic draw lib
austin362667 Oct 4, 2022
ec60c70
strategy: upgrade harmonic persistence sync
austin362667 Oct 4, 2022
26d640f
strategy: fix irr
austin362667 Oct 4, 2022
3c52e9e
strategy: refactor draw lib
austin362667 Oct 4, 2022
de3ebc2
Update back-testing.md
c9s Oct 4, 2022
a8d9911
bbgo: refactor isolation and add more tests
c9s Oct 4, 2022
070a92e
max: fix max kline api
c9s Oct 4, 2022
8ad4837
Merge pull request #979 from c9s/fix/maxapi
c9s Oct 4, 2022
a66d8df
update grid config for max
c9s Oct 4, 2022
ed8b78f
Merge pull request #978 from c9s/refactor/isolation
c9s Oct 4, 2022
22ef28b
strategy:harmonic fix drawing defer close IO issue
austin362667 Oct 4, 2022
600b174
strategy:irr fix drawing defer close IO issue
austin362667 Oct 4, 2022
06675d0
Merge pull request #977 from austin362667/austin362667/irr
c9s Oct 4, 2022
4d42a61
Merge pull request #976 from austin362667/austin362667/harmonic
c9s Oct 4, 2022
8e83fc4
fix optimizer limit
frin1 Oct 5, 2022
4caa457
bbgo: pull out ConfigurePersistence method to simple function
c9s Oct 5, 2022
673304b
bbgo: refactor ConfigurePersistence
c9s Oct 5, 2022
e922191
bbgo: configure persistence facade into the isolation context
c9s Oct 5, 2022
4c0fdee
Merge pull request #981 from frin1/fix/optimizer-limit-results
c9s Oct 5, 2022
39247bb
Merge pull request #982 from c9s/refactor/isolation
c9s Oct 5, 2022
350f6d7
config: fix maker fee rate config
c9s Oct 6, 2022
c374a56
config: fix config maker fee rate
c9s Oct 6, 2022
a515fff
backtest: add order quantity check
c9s Oct 6, 2022
34866ce
Merge pull request #983 from c9s/fix/add-quantity-check
c9s Oct 6, 2022
7a80b90
fix/order-executor: ClosePosition() works on futures position
andycheng123 Oct 7, 2022
5ad247c
fix/order-executor: check for short position
andycheng123 Oct 7, 2022
1744281
Merge pull request #986 from andycheng123/fix/protective-stop
andycheng123 Oct 7, 2022
aa492a0
fix/supertrend-strategy: LinReg baseline slope wrongly calculated as …
andycheng123 Oct 7, 2022
8287710
Merge pull request #987 from andycheng123/fix/supertrend-strategy
andycheng123 Oct 7, 2022
7204e25
pull out shutdown timeout context
c9s Oct 11, 2022
b18c35c
update command doc files
c9s Oct 12, 2022
b03687e
bump version to v1.42.0
c9s Oct 12, 2022
1d9cc54
add v1.42.0 release note
c9s Oct 12, 2022
9330b9f
change variable names
narumiruna Oct 13, 2022
ab8624c
Merge pull request #990 from c9s/narumi/rename
c9s Oct 13, 2022
905c1f2
interval: add 1s support
austin362667 Oct 3, 2022
18acd66
interval: finalize 1s support
austin362667 Oct 4, 2022
763bb45
interval: avoid syncing 1s klines as default from backtest config syn…
austin362667 Oct 4, 2022
d350806
fix/risk: remove balance check in the futures part of CalculateBaseQu…
andycheng123 Oct 17, 2022
ffae290
fix: indicator timeframe 1s
zenixls2 Oct 17, 2022
09c85d3
feature: add cancelNoWait in GeneralOrderExecutor to make cancellatio…
zenixls2 Oct 17, 2022
79c93e9
Merge pull request #991 from andycheng123/fix/risk
c9s Oct 17, 2022
9213caf
feature: add aggTrade for binance
zenixls2 Oct 17, 2022
8a66e5b
feature: telegram notify to become async
zenixls2 Oct 17, 2022
6f0c4fd
Merge pull request #994 from zenixls2/feature/binance_aggTrade
zenixls2 Oct 17, 2022
7980790
Merge pull request #993 from zenixls2/fix/indicator_for_1s
zenixls2 Oct 17, 2022
4dad967
Merge pull request #995 from zenixls2/feature/async_telegram_notify
zenixls2 Oct 17, 2022
06c95a4
fix/general-order-executor: do not check for base balance for futures…
andycheng123 Oct 18, 2022
7dd951e
Merge pull request #996 from andycheng123/fix/general-order-executor
andycheng123 Oct 18, 2022
a5555cf
feat: cancel order for exit roi take profit and loss
grorge123 Oct 28, 2022
ba98907
[ImgBot] Optimize images
ImgBotApp Oct 28, 2022
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
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/contracts
.env.*
/linode
/frontend
/desktop
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"
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]
53 changes: 53 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
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
# 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: 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 }}
93 changes: 93 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Go

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest

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

steps:

- uses: actions/checkout@v2

- 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: 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