Commit Graph

2180 Commits

Author SHA1 Message Date
chiahung.lin
05870c5d60 move EmitReady and add go:generate 2024-01-08 18:25:11 +08:00
chiahung.lin
006256a9df FEATURE: add callbacks and shutdown function 2024-01-08 18:25:11 +08:00
narumi
9c108380e8 xgap: print currency 2024-01-07 18:56:57 +08:00
narumi
36aadf74a1 xgap: check balance before placing orders 2024-01-06 22:55:45 +08:00
c9s
9dd4de0755
Merge pull request #1482 from c9s/narumi/xgap/log
CHORE: [xgap] improve log message
2024-01-06 20:28:40 +08:00
narumi
dc2895c4dc rename cronExpression to schedule 2024-01-06 17:37:13 +08:00
なるみ
6367bd79d3
Merge pull request #1402 from c9s/narumi/fixedmaker/inventory-skew
FEATURE: inventory skew
2024-01-06 17:00:18 +08:00
narumi
3ee5bf29ef xgap: improve log message 2024-01-06 15:53:16 +08:00
narumi
012fc33376 xgap: refactor with common strategy 2024-01-06 14:49:26 +08:00
c9s
9f8bdeb3e9
Merge pull request #1475 from c9s/narumi/rebalance/fix-instance-id
REFACTOR: [rebalance] refactor MultiMarketStrategy.Initialize
2024-01-06 14:30:12 +08:00
narumi
94fb883a0f xgap: fix order cancel error 2024-01-04 18:53:23 +08:00
c9s
3dca9aaf98
Merge pull request #1470 from c9s/narumi/xnav/schedule
FEATURE: [xnav] add cron schedule
2024-01-03 16:38:19 +08:00
chiahung.lin
57282c30d2 FEATURE: remove Short 2023-12-28 23:04:09 +08:00
なるみ
e35795943d
Merge pull request #1468 from c9s/narumi/autobuy/init
FEATURE: add autobuy strategy
2023-12-28 17:44:53 +08:00
c9s
60043d6239
Merge pull request #1464 from c9s/kbearXD/dca2/run-state-and-recover
FEATURE: [dca2] run state machine
2023-12-28 17:35:57 +08:00
narumi
030c6c1ca5 fix instance id 2023-12-28 17:31:15 +08:00
chiahung.lin
59b1bb68cb use stateTransition 2023-12-27 11:41:29 +08:00
narumi
687df81784 add autobuy strategy 2023-12-26 17:53:14 +08:00
narumi
5592d93c13 add cron schedule to xnav 2023-12-26 17:07:03 +08:00
c9s
d0f9052cf2
Merge pull request #1472 from c9s/c9s/grid2-check-price-for-subscribe
FIX: [grid2] subscribe 1m kline only when one of the trigger price is set
2023-12-26 12:01:29 +08:00
c9s
4d17d7e049
grid2: subscribe 1m kline only when one of the trigger price is set 2023-12-26 10:56:08 +08:00
c9s
c250fec2dc
Merge pull request #1463 from c9s/c9s/bollmaker-ema-crosssignal 2023-12-23 01:17:30 +08:00
chiahung.lin
b30b023858 FEATURE: check every cuerrent state and next state is valid 2023-12-22 15:27:31 +08:00
narumi
7f0a4a9953 apply inventory-skew to xfixedmaker 2023-12-21 16:39:23 +08:00
narumi
f160ea856f apply inventory-skew to fixedmaker 2023-12-21 16:29:46 +08:00
narumi
8ecba4378c inventory skew 2023-12-21 16:03:35 +08:00
なるみ
7f8a331373
Merge pull request #1465 from c9s/narumi/rebalance/fix-position-and-profit
FIX: [rebalance] fix position map and profit stats map
2023-12-20 23:59:05 +08:00
c9s
3ba1621590
xdepthmaker: simplify covered handler registration 2023-12-20 22:28:20 +08:00
c9s
58321e8aa5
xdepthmaker: update instance id format 2023-12-20 22:20:40 +08:00
c9s
eb36ed6926
xdepthmaker: remove the shared trade collector and order store, add mutex for covered position 2023-12-20 21:54:32 +08:00
narumi
7b121b10be rebalance on order filled 2023-12-20 20:35:43 +08:00
narumi
762a09042a graceful cancel orders 2023-12-20 20:26:34 +08:00
narumi
da02c926be fix profit stats and position 2023-12-20 20:21:34 +08:00
chiahung.lin
bfd9c8ac64 FEATURE: run state machine
FEATURE: support recover

FEATURE: add order into orderStore and recover position

recover position/budget

FEATURE: support recover budget
2023-12-20 16:02:37 +08:00
c9s
a4f996c963
Merge pull request #1393 from c9s/strategy/emacross
STRATEGY: add emacross strategy
2023-12-20 15:50:52 +08:00
c9s
311ba3b2ac
bollmaker: fix ema cross subscription 2023-12-20 12:09:19 +08:00
c9s
46329c3a24
bollmaker: add ema cross signal to bollmaker strategy 2023-12-19 22:17:33 +08:00
c9s
6a07af80d8
bollmaker: define EMACrossSetting 2023-12-19 22:04:24 +08:00
c9s
4894a59756
fixedmaker, liquiditymaker: update initialize method 2023-12-19 21:59:44 +08:00
c9s
3dd93b65db
emacross, scmaker: fix strategy initialization 2023-12-19 21:58:50 +08:00
c9s
6abb320bce
emacross: clean up and update config 2023-12-19 21:57:51 +08:00
c9s
25c895bb09
add emacross strategy 2023-12-19 21:57:51 +08:00
c9s
ec4f43b100
bollmaker: support custom quantity 2023-12-19 21:55:38 +08:00
c9s
47b12edc4d
xdepthmaker: call bbgo.Sync on shutdown 2023-12-18 22:32:13 +08:00
c9s
84085e09b5
xdepthmaker: fix duplicated binding 2023-12-18 22:32:13 +08:00
c9s
2c9583cccb
xdepthmaker: remove redundant notification 2023-12-18 22:32:13 +08:00
c9s
98468feb73
Merge pull request #1458 from c9s/feature/xdepthmaker
FIX: [xdepthmaker] final fix
2023-12-18 17:59:38 +08:00
chiahung.lin
eda072327c FIX: move common.Strategy to Initialize 2023-12-18 14:48:13 +08:00
c9s
f19ed7abe0
xdepthmaker: initialize s.CrossExchangeMarketMakingStrategy in Initialize() 2023-12-18 14:31:51 +08:00
chiahung.lin
e86b1bb90f REFACTOR: make all common.Strategy from pointer to value 2023-12-13 17:36:30 +08:00
c9s
6dd3766776
Merge pull request #1451 from c9s/feature/xdepthmaker
CHORE: [xdepthmaker] improve shutdown process
2023-12-13 16:47:01 +08:00
c9s
c870defd47
xdepthmaker: improve shutdown process 2023-12-13 16:29:07 +08:00
chiahung.lin
e3d51777d3 rename 2023-12-13 14:16:02 +08:00
chiahung.lin
092d5cfb07 FEATURE: cancel maker orders and open take profit order 2023-12-13 14:16:02 +08:00
c9s
c5282a8f9b
bitget: add more debug logs 2023-12-12 16:37:43 +08:00
c9s
8c6724b264
xdepthmaker: fix pricing book copy by avoiding using CopyDepth 2023-12-11 17:59:16 +08:00
c9s
98468b39c7
xdepthmaker: change priceHeartBeat alert to warning 2023-12-11 17:05:07 +08:00
c9s
cedd790066
xdepthmaker: add lastOrderReplenishTime to prevent replacing orders too frequent 2023-12-11 17:02:17 +08:00
c9s
de7eb8453b
xdepthmaker: refactor auth binding to bindAuthSignal 2023-12-11 17:00:25 +08:00
c9s
2c3ccdf030
xdepthmaker: more improvements
- place orders with balance quota calculation
- wait for authed event
- clean up open orders on start
2023-12-11 16:56:19 +08:00
c9s
3048a13f0b
xdepthmaker: replace AtomicAdd with Add 2023-12-08 00:21:53 +08:00
c9s
cd06ffd21f
xdepthmaker: fix order call 2023-12-07 17:38:58 +08:00
c9s
e82605f658
xdepthmaker: skip test for dnum 2023-12-07 16:18:24 +08:00
c9s
35dabe8a72
xdepthmaker: fix aggregatePrice quantity issue 2023-12-07 16:18:24 +08:00
c9s
d14527b5cf
xdepthmaker: apply FullReplenishInterval from config 2023-12-07 16:18:24 +08:00
c9s
25b04cb36c
xdepthmaker: add fullReplenishTicker 2023-12-07 16:18:24 +08:00
c9s
888a550c80
xdepthmaker: support partial maker order replenish 2023-12-07 16:18:24 +08:00
c9s
a82bc86455
xdepthmaker: update updateQuote method 2023-12-07 16:18:23 +08:00
c9s
2f1a700b89
remove xpuremaker 2023-12-07 16:18:23 +08:00
c9s
e0e9876902
improve price hart beat usage 2023-12-07 16:18:23 +08:00
c9s
46b3a81b07
xdepthmaker: add tests to the generateMakerOrders 2023-12-07 16:18:23 +08:00
c9s
d123e89a1b
xdepthmaker: document covered position 2023-12-07 16:18:23 +08:00
c9s
1e27f53891
xdepthmaker: use hedge order executor 2023-12-07 16:18:23 +08:00
c9s
2c3792b290
xdepthmaker: update Validate() method 2023-12-07 16:18:23 +08:00
c9s
18968c67a1
xdepthmaker: remove disable hedge option 2023-12-07 16:18:23 +08:00
c9s
10a71d83f1
xdepthmaker: move global position profit handling 2023-12-07 16:18:23 +08:00
c9s
99723fc1f4
xdepthmaker: remove legacy s.activeMakerOrders 2023-12-07 16:18:23 +08:00
c9s
e0686d11c8
xdepthmaker: clean up duplicated code 2023-12-07 16:18:23 +08:00
c9s
6b28910139
xdepthmaker: refactor CrossSubscribe 2023-12-07 16:18:23 +08:00
c9s
ed63b23e2a
xdepthmaker: refactor CrossRun with CrossExchangeMarketMakingStrategy 2023-12-07 16:18:22 +08:00
c9s
df2daf33a7
types: add PeriodProfitStats 2023-12-07 16:18:22 +08:00
c9s
53bf443b1d
xdepthmaker: first commit 2023-12-07 16:18:22 +08:00
chiahung.lin
6857734282 rename 2023-12-07 11:29:42 +08:00
chiahung.lin
2982be1cbc rename dca maker orders to open position orders 2023-12-07 11:27:28 +08:00
chiahung.lin
c67737a6d6 use retry package 2023-12-06 16:16:17 +08:00
chiahung.lin
4aa6ea3a46 FEATURE: use notional based to crease dca maker orders 2023-12-06 11:28:45 +08:00
chiahung.lin
60003fc472 rename somme part 2023-12-06 11:28:45 +08:00
chiahung.lin
445f0f1c4c FEATURE: prepare open maker orders function 2023-12-06 11:28:45 +08:00
kbearXD
45c2ee0ed8
Merge pull request #1432 from c9s/chiahung/recover-with-origin-stats
FIX: use original status for recover
2023-11-30 15:10:52 +08:00
chiahung
19be49fca8 FIX: use original status for recover 2023-11-24 14:17:19 +08:00
chiahung.lin
800148b271 remain only template part 2023-11-23 16:45:28 +08:00
chiahung.lin
aea3abae07 FEATURE: new strategy dca2 perparation 2023-11-23 16:32:34 +08:00
kbearXD
75b8be5e17
Merge pull request #1405 from c9s/chiahung/grid2/use-rest-quote
FIX: [grid2] use rest quote to place the last order when opening grid
2023-11-23 12:46:53 +08:00
chiahung
102eb61188 remove unused log 2023-11-21 17:06:20 +08:00
c9s
e5033c093a
grid2: check order's original status for updating 2023-11-17 17:14:52 +08:00
chiahung
c8c9659dd1 use PricePrecision for quote round up 2023-11-09 17:17:59 +08:00
chiahung
80ea46ca92 FEATURE: use rest quote to place the last order when opening grid 2023-11-09 16:20:11 +08:00
c9s
3563c0b986
liquiditymaker: filterAskOrders by base balance 2023-11-09 11:56:07 +08:00
c9s
cc5c033af7
liquiditymaker: use order generator 2023-11-09 11:56:07 +08:00
c9s
533907894e
liquiditymaker: implement order generator 2023-11-09 11:56:07 +08:00
c9s
dda2cfb73d
liquiditymaker: first commit 2023-11-09 11:56:07 +08:00
c9s
d2dab58193
scmaker: clean up scmaker risk control 2023-11-09 11:56:07 +08:00
c9s
2c842e54e8
scmaker: fix scmaker stream book binding 2023-11-09 11:56:07 +08:00
kbearXD
20dccc05f9
Merge pull request #1396 from c9s/chiahung/grid2/persistence-ttl
FEATURE: add ttl for position/grid2.profit_stats persistence
2023-11-08 13:50:29 +08:00
chiahung
52d4f50c88 remove sync every ticker 2023-11-08 11:15:06 +08:00
chiahung
4a40c8bea2 refactor 2023-11-07 17:00:29 +08:00
chiahung
e6fc006747 recoverC back to size 1 2023-11-07 15:21:48 +08:00
chiahung
df2fd170db return bool to let syncActiveOrderBook really sync or skip 2023-11-07 14:39:29 +08:00
chiahung
7de49155eb fix 2023-11-07 13:30:58 +08:00
chiahung
c8becbe4f5 bbgo.sync when syncActiveOrders 2023-11-07 10:56:19 +08:00
chiahung
dcff850c64 FEATURE: add ttl for position/grid2.profit_stats persistence 2023-11-06 18:52:01 +08:00
chiahung
358aef770f FIX: fix skip syncing active order 2023-11-06 17:13:16 +08:00
c9s
e614741a48
grid2: add another test case for 0 baseGridNum 2023-11-04 12:56:11 +08:00
c9s
6cce5a2268
grid2: respect s.BaseGridNum and add a failing test case 2023-11-04 12:56:11 +08:00
narumi
ffea4901ed fix buy quantity 2023-11-03 15:07:24 +08:00
c9s
9dc57f01cd
wall: refactor wall strategy with common.Strategy 2023-11-01 16:57:07 +08:00
narumi
7c19bb9e20 submit one order at a time 2023-10-31 13:53:12 +08:00
chiahung
d33240ec83 rename and simplify import 2023-10-30 17:17:36 +08:00
chiahung
671772a767 FIX: retry to get open orders only for 5 times and do not sync orders updated in 3 min 2023-10-30 16:28:34 +08:00
kbearXD
be4c69c365
Merge pull request #1368 from c9s/feature/grid2/merge-recover
FEATURE: merge grid recover and active orders recover logic
2023-10-30 16:11:23 +08:00
narumi
e8c9801535 adjust quantity by max amount 2023-10-27 15:01:41 +08:00
chiahung
40ca323b2d merge recover logic 2023-10-26 16:29:05 +08:00
chiahung
f31d829294 FEAUTRE: merge grid recover and active orders recover 2023-10-26 14:55:33 +08:00
chiahung
ab1bc998f9 FEATURE: prepare query trades funtion for new recover 2023-10-25 13:34:11 +08:00
chiahung
3710c33670 REFACTOR: rename file and variable 2023-10-24 13:03:14 +08:00
kbearXD
7d97f573c5
Merge pull request #1350 from c9s/feature/grid2/twin-orderbook
FEATURE: [grid2] twin orderbook
2023-10-24 13:00:25 +08:00
chiahung
c977b8e295 add lock to protect twin orderbook and add more comments 2023-10-23 17:42:39 +08:00
chiahung
3150f6b3f5 fix 2023-10-23 13:00:17 +08:00
chiahung
e9078a71c8 FEATURE: twin orderbook 2023-10-20 16:23:31 +08:00
chiahung
c9fca56723 MINOR: remove profit entries from profit stats 2023-10-20 15:17:31 +08:00
narumi
900db74fb9 skip public session 2023-10-19 15:14:28 +08:00
kbearXD
3bc03ff8c5
Merge pull request #1328 from c9s/feature/grid2/recover-active-order-periodically
FEATURE: recover active orders with open orders periodically
2023-10-17 04:33:40 -05:00
c9s
98b294424a
Merge pull request #1341 from c9s/narumi/random/amount
REFACTOR: [random] remove adjustQuantity from config
2023-10-17 17:19:53 +08:00
chiahung
ccb7308263 fix 2023-10-17 16:13:05 +08:00
chiahung
243b90aaf9 fix nil metrics error 2023-10-17 15:20:28 +08:00
chiahung
c257bc8ccf sleep 100ms to avoid DDOS 2023-10-17 13:51:51 +08:00
chiahung
5ff3828ec1 move to onAuth 2023-10-16 16:02:43 +08:00
c9s
4c69dccf09
make rightWindow possible to be set as zero 2023-10-16 12:36:52 +08:00
narumi
badadafa2d remove adjustQuantity from config 2023-10-13 18:11:21 +08:00
chiahung
c5449374cd add test and remove recovered atmoic bool 2023-10-13 16:50:59 +08:00
chiahung
de1a884153 not add non existing open orders into active orderbook if updated in 5 min 2023-10-13 16:50:21 +08:00
chiahung
136c2cd36f add open orders metrics 2023-10-13 16:50:21 +08:00
chiahung
c6d4ebf57b also sync orders already in active orderbook if the open orders are expired 2023-10-13 16:50:21 +08:00
c9s
a39925b912 grid2: invert if 2023-10-13 16:50:21 +08:00
c9s
5f9d020ac8 grid2: improve some logging 2023-10-13 16:50:21 +08:00
c9s
1347c8ef87 grid2: refactor recoverActiveOrdersPeriodically 2023-10-13 16:50:21 +08:00
chiahung
27294ac9b6 FIX: fix some error and use chan to trigger active orders recover when on auth 2023-10-13 16:50:21 +08:00
chiahung
4c9b1e78fe remove checker 2023-10-13 16:50:21 +08:00
chiahung
ca80bdb282 FEATURE: recover active orders with open orders periodically 2023-10-13 16:50:20 +08:00
c9s
a0a7b0ffdc
grid2: set max retries 2023-10-11 17:33:07 +08:00