Commit Graph

5619 Commits

Author SHA1 Message Date
c9s
cf31796224
Merge pull request #1318 from c9s/narumi/common-risk
CHORE: add IsHalted method to common.Strategy for CircuitBreakRiskControl
2023-09-25 18:07:57 +08:00
c9s
8f40478c74
Merge pull request #1313 from c9s/fix/grid2-active-orders
FIX: [grid2] only do active order update when grid is recovered
2023-09-25 17:53:07 +08:00
c9s
94f6cefd70
grid2: improve active order recover logs 2023-09-25 17:43:38 +08:00
c9s
fdaa92c6ca
Merge pull request #1320 from c9s/feature/logging
FEATURE: add log fields support to the core
2023-09-25 17:30:14 +08:00
c9s
b6d0e3ef27
grid2: only do active order update when grid is recovered 2023-09-25 17:19:53 +08:00
c9s
550b010499
bbgo: add log fields support to the core 2023-09-25 17:16:27 +08:00
c9s
db7a0df254
types: change websocket error to warnf 2023-09-25 13:55:59 +08:00
bailantaotao
e86a75c406
Merge pull request #1317 from bailantaotao/edwin/waiting-all-routines-closed
FIX: Wait for all routines to close while streaming is reconnecting
2023-09-21 21:19:03 +08:00
narumi
4a231b10c6 pull out ishalted method 2023-09-21 15:06:09 +08:00
Edwin
294e5111dc pkg/types: ensure all routines are done 2023-09-21 14:43:06 +08:00
c9s
49e9c8bbcf
Merge pull request #1315 from c9s/narumi/fixedmaker/common
REFACTOR: use common strategy in fixedmaker
2023-09-21 14:35:53 +08:00
bailantaotao
a3df61dca4
Merge pull request #1311 from bailantaotao/edwin/add-on-raw-message-callback
FEATURE: emit regardless of whether there is an error or not on subscription.
2023-09-20 11:33:33 +08:00
narumi
c8316a36a0 use common strategy in fixedmaker 2023-09-19 15:00:39 +08:00
chiahung
fdfa3639ff FEATURE: use retry query order until successful 2023-09-19 11:12:14 +08:00
kbearXD
6d0c266513
Merge pull request #1302 from c9s/feature/grid2/use-quote-quantity
FEATURE: use quote quantity if there is QuoteQuantity in trade
2023-09-19 10:41:34 +08:00
c9s
a22c41f47d
Merge pull request #1307 from MengShue/add_QueryOrderTrades_for_okex
FEATURE: add QueryOrderTrades() for okex
2023-09-18 16:14:41 +08:00
Edwin
42ee9618b5 pkg/exchange: emit regardless of whether there is an error or not. 2023-09-18 13:11:22 +08:00
c9s
542944b4cc
max: use websocket update time (TU) field 2023-09-17 18:29:14 +08:00
c9s
89c88c48a3
bbgo: log filled order 2023-09-17 18:25:21 +08:00
c9s
797ee4402c
types: fix pending order update comparison 2023-09-17 18:20:29 +08:00
c9s
4b78bfcdfa
types: improve order string format 2023-09-17 18:08:57 +08:00
c9s
8314a7e750
types: improve order string format 2023-09-17 18:03:57 +08:00
c9s
5f8a5e47d5
activeorderbook: add pending order logs 2023-09-17 18:03:56 +08:00
Alan.sung
a47c846fa5 add QueryOrderTrades() for okex 2023-09-14 14:54:02 +08:00
Edwin
e56d8d1607 pkg/exchange: emit auth in each exchange 2023-09-14 12:01:20 +09:00
Edwin
faa259623d pkg/exchange: add auth callback to standard stream 2023-09-13 17:06:57 +09:00
bailantaotao
388b9c3f9f
Merge pull request #1308 from bailantaotao/edwin/add-trade-stream
FEATURE: [bybit] support market trade
2023-09-11 18:02:03 +08:00
c9s
4f82843b40
Merge pull request #1306 from andycheng123/improve/binance-api
Improve: Update Binance futures account api to v2
2023-09-11 11:14:56 +08:00
Edwin
1c5ad1d1f0 pkg/exchange: support market trade for bybit 2023-09-11 00:54:02 +08:00
bailantaotao
439f45bdf9
Merge pull request #1304 from bailantaotao/edwin/support-unsubscribe
FEATURE: [bybit] support unsubscribe
2023-09-08 18:22:53 +08:00
bailantaotao
e5c3b8cccb
Merge pull request #1301 from bailantaotao/edwin/add-new-func-for-subscriptions
FEATURE: add Reconnect and Resubscribe for stream
2023-09-08 18:22:35 +08:00
Andy Cheng
40dbfd5b42
improve/binance: rename variable to comply with golang naming convention 2023-09-08 18:14:51 +08:00
c9s
09ed7b141c
Merge pull request #1305 from MengShue/refactor_okex_for_future
FEATURE: refactor okex to future use
2023-09-07 22:57:29 +08:00
bailantaotao
d91199d3ad
Merge branch 'c9s:main' into edwin/add-new-func-for-subscriptions 2023-09-07 15:29:54 +08:00
Andy Cheng
c9d67f8131
improve/binance: update futures account api to v2 2023-09-07 15:21:47 +08:00
Alan.sung
9a66f82d8c remove err since handling init for client 2023-09-07 11:25:12 +08:00
Alan.sung
dbf29f8cd2 add constructor to check url error 2023-09-06 21:21:13 +08:00
Alan.sung
7550ea2be1 refactor okex to future use 2023-09-06 19:14:21 +08:00
bailantaotao
1338499e3f
Merge pull request #1303 from bailantaotao/edwin/add-default-time
FEATURE: set default 30d for closed order batch query
2023-09-06 12:41:47 +08:00
Edwin
da13bb680e pkg/exchange: support unsubscribe for bybit 2023-09-06 12:18:47 +08:00
Edwin
83cdd4e1a4 pkg/exchange: update add reconnect and resubscribe func for stream 2023-09-06 12:18:17 +08:00
Edwin
f5a66baad3 pkg/exchage: set default 30d for closed order batch query 2023-09-05 22:04:16 +08:00
chiahung
db376f8483 FEATURE: use quote quantity if there is QuoteQuantity in trade 2023-09-05 18:28:10 +08:00
bailantaotao
7461b60b6b
Merge pull request #1299 from bailantaotao/edwin/add-server-time
pkg/exchange: add time to SliceOrderBook
2023-09-05 16:36:20 +08:00
kbearXD
79d98e857d
Merge pull request #1295 from c9s/feature/grid2/amount-round-down
FEATURE: round down executed amount to avoid insufficient balance
2023-09-05 14:35:53 +08:00
なるみ
9c104f5776
Merge pull request #1297 from c9s/narumi/reset-profit-stats
FIX: reset profit stats when over given duration in circuit break risk control
2023-09-05 14:00:52 +08:00
narumi
57198cc6b0 fix: reset profit stats when over given duration in circuit break risk control 2023-09-01 18:57:40 +08:00
c9s
8adb0df656
Merge pull request #1298 from c9s/c9s/grid2-fix-recover-active-orders
FIX: [grid2] fix active order recover, add start process delay
2023-09-01 18:48:58 +08:00
c9s
415a28c32b
Merge pull request #1300 from bailantaotao/edwin/fix-okex-bid-ask
pkg/exchange: fix okex bookticker bug
2023-09-01 18:07:59 +08:00
Edwin
412d0e0558 *: fix lint 2023-09-01 17:54:43 +08:00
Edwin
50bfd8ee0e pkg/exchange: add time to SliceOrderBook 2023-09-01 17:54:40 +08:00
Edwin
594ab9cbaf pkg/exchange: fix okex bookticker bug 2023-09-01 17:12:32 +08:00
c9s
e74da87e51
grid2: delay start process by 5s 2023-08-31 17:08:00 +08:00
narumi
52412d9ead refactor: add IsOver to check the since time is over given duration 2023-08-31 14:31:25 +08:00
c9s
f24bd3532c
grid2: add 5s delay and <10seconds jitter 2023-08-31 14:08:33 +08:00
c9s
7de6c3d8e4
grid2: add more update logs 2023-08-31 13:59:44 +08:00
c9s
cb0285544e
add lock to recoverActiveOrders 2023-08-31 13:48:56 +08:00
chiahung
9dc7244d8a FEATURE: round down executed amount to avoid insufficient balance 2023-08-31 12:40:01 +08:00
c9s
2c4b6e8cd1
Merge pull request #1238 from MengShue/add_unit_test_for_okex
TEST: add unit test for okex exchange
2023-08-24 12:44:45 +08:00
Alan.sung
f8ae408fad add continue in err != nil 2023-08-23 16:16:38 +08:00
Alan.sung
26cde5d57c use multierr to handle err return from toGlobalOrder 2023-08-23 15:44:51 +08:00
Alan.sung
a0946fbd42 use lower case in error string and add comment for IOC, FOK 2023-08-22 17:23:16 +08:00
Alan.sung
a4aa9c2eda remove mmp and mmp_post_only 2023-08-22 15:14:18 +08:00
bailantaotao
edfcbb01c0
Merge pull request #1293 from bailantaotao/edwin/fix-quantity-in-buy-market-order
FIX: [bybit] quantity in buy market order
2023-08-22 11:42:08 +08:00
c9s
20bdf191c3
Merge pull request #1290 from c9s/c9s/grid-disconnect-recover
FEATURE: [grid2] update local active orders after re-connected
2023-08-21 18:16:05 +08:00
Edwin
9ee7377f36 pkg/exchange: fix quantity for buy market order 2023-08-21 15:59:13 +08:00
Alan.sung
3dce63710a Fix to fit all reviews last time 2023-08-21 15:31:30 +08:00
Edwin
3ad7075ace pkg/exchange: fix quantity coin unit 2023-08-18 01:08:09 +08:00
c9s
ed948b2642
max: fix QuerySpotAccount method return value 2023-08-17 17:42:54 +08:00
c9s
9105ebce78
deposit2transfer: fix err msg 2023-08-17 17:42:05 +08:00
c9s
c91861ca9a
bbgo: add order update time check 2023-08-17 17:31:24 +08:00
c9s
1cadaf9265
bbgo: add mutex lock to ActiveOrderBook 2023-08-17 17:16:27 +08:00
c9s
2669c3a5db
bbgo: check order exists 2023-08-17 16:28:42 +08:00
c9s
dda3f25c61
grid2,bbgo: refactor active order book and update order status when re-connected 2023-08-17 16:26:06 +08:00
bailantaotao
6f4f1ad558
Merge pull request #1287 from bailantaotao/edwin/add-bybit-kline-backtest
FEATURE: [bybit] add kline backtest
2023-08-16 22:08:31 +08:00
bailantaotao
3eeba521f6
Merge pull request #1289 from bailantaotao/edwin/fix-misc-2
FIX: [bybit] fix misc
2023-08-16 22:07:57 +08:00
bailantaotao
b6c9f14dcc
Merge pull request #1285 from bailantaotao/edwin/query-order
FEATURE: [bybit] implement ExchangeOrderQueryService interface
2023-08-16 22:07:36 +08:00
Edwin
6cfbb84bb5 pkg/exchange: fix order id check for the submitted orders 2023-08-16 14:47:35 +08:00
c9s
52f9cbd48d
Merge pull request #1288 from c9s/c9s/strategy-deposit2transfer
FIX: [deposit2transfer] call QuerySpotAccount for getting the spot balance
2023-08-16 12:36:35 +08:00
c9s
5cc09dfb9a
deposit2transfer: improve log format 2023-08-16 12:26:01 +08:00
c9s
252f4fbccc
deposit2transfer: call QuerySpotAccount for getting the spot balance 2023-08-16 12:02:18 +08:00
c9s
874b647191
cmd: document tradeStats binding 2023-08-15 17:54:24 +08:00
Edwin
adf5805de5 compile and update migration package 2023-08-15 17:39:32 +08:00
c9s
5f54c303fb
bitget: fix fixedpoint.Value init value 2023-08-15 16:40:15 +08:00
c9s
4a64701e16
bitget: implement QueryAccount 2023-08-15 16:38:48 +08:00
c9s
40762cad35
bitget: implement QueryTicker 2023-08-15 16:38:48 +08:00
c9s
2fda4477bd
bitget: implement QueryMarkets 2023-08-15 16:38:47 +08:00
Alan.sung
672a878194 update toGlobalOrder by referencing toGlobalOrders 2023-08-15 14:26:27 +08:00
Edwin
e4ebe1cffd pkg/exchange: supprot queryOrderTrades 2023-08-15 14:23:34 +08:00
Edwin
3207a8227c pkg/exchange: add QueryOrder api 2023-08-15 14:23:31 +08:00
Andy Cheng
10185ee715
Merge pull request #1283 from andycheng123/improve/profitStatsTracker
Improve: profitStatsTracker, Add a parameter for window to sum up trades
2023-08-15 13:12:32 +08:00
Edwin
ed47d5064a pkg/exchange: fix the order id check for cancel order 2023-08-14 18:13:24 +08:00
Edwin
187429081f pkg/exchange: fix orderId json tag 2023-08-14 18:06:14 +08:00
c9s
255718a54a
deposit2transfer: apply rate limiter on checkDeposits 2023-08-11 19:11:18 +08:00
Andy Cheng
a74562ed31
improve/profitStatsTracker: Add a parameter for window to sum up trades 2023-08-11 13:16:53 +08:00
Alan.sung
ea5b45bfe4 queryOrder() and test for it 2023-08-11 09:28:58 +08:00
Edwin
54e7065d8a pkg/exchange: implement trade event 2023-08-10 19:58:27 +08:00
Edwin
affff32599 pkg/exchange: get fee rate before connect 2023-08-10 17:57:47 +08:00
Edwin
509f9ac8ca pkg/types: add BeforeConnect hook function 2023-08-10 15:26:54 +08:00
Edwin
0b03336fb0 pkg/exchange: support GetFeeRates on bybit exchange 2023-08-10 15:26:51 +08:00
Edwin
ace2c55a17 exchange/bybit: add fee rate restful api 2023-08-10 15:02:30 +08:00
bailantaotao
6379cab65e
Merge pull request #1277 from bailantaotao/edwin/add-kline-api
FEATURE: [bybit] add k line api
2023-08-10 11:44:28 +08:00
Edwin
4cee22ce31 pkg/exchage: support k line websocket event 2023-08-10 11:07:13 +08:00
Edwin
e9d0ce5bbf pkg/exchage: support k line rest api 2023-08-10 11:07:10 +08:00
c9s
ecc0928ef5
Merge pull request #1281 from c9s/c9s/strategy-deposit2transfer
FIX: [deposit2transfer] add lastAssetDepositTimes for immediate success deposits
2023-08-09 16:41:29 +08:00
c9s
6103a9350f
deposit2transfer: add lastAssetDepositTimes for immediate success deposits 2023-08-09 15:54:28 +08:00
bailantaotao
24d240b1f3
Merge pull request #1279 from bailantaotao/edwin/add-query-acct
FEATURE: [bybit] support query account/balance api
2023-08-09 15:33:04 +08:00
Alan.sung
1c5d2dc759 add QueryOrder in okex exchange.go 2023-08-09 15:05:26 +08:00
Edwin
65b06ff401 pkg/exchange: add query account function 2023-08-09 14:05:57 +08:00
Edwin
dfead5ebed pkg/exchange: add query account balance api 2023-08-09 14:05:57 +08:00
Edwin
8c22863334 pkg/exchange: mv BalanceEvent to bybitapi and rename to WalletBalances 2023-08-09 14:05:55 +08:00
c9s
4ed402b775
max: update deposit states and add more fields to deposit 2023-08-08 20:51:48 +08:00
c9s
b711e1e439
Merge pull request #1275 from c9s/c9s/strategy-deposit2transfer
FEATURE: [strategy] add deposit2transfer tool
2023-08-08 15:13:06 +08:00
Edwin
b27395f6f4 pkg/exchange: avoiding GC panic caused by a rapid creation/removal slice of pointers 2023-08-08 14:11:19 +08:00
c9s
25298720d0
max: implement TransferMarginAccountAsset on max 2023-08-08 13:16:11 +08:00
c9s
5460ebdbf4
max: add margin transfer request 2023-08-08 12:49:05 +08:00
c9s
ece8cacd9e
deposit2transfer: use watchingDeposits instead of just deposits 2023-08-08 12:38:59 +08:00
c9s
4a28843a0a
deposit2transfer: fix mutex lock 2023-08-08 12:38:23 +08:00
c9s
073c4562fd
deposit2transfer: refactor deposit check and add more logs 2023-08-08 12:23:17 +08:00
c9s
29727c12be
add deposit2transfer config 2023-08-08 12:14:14 +08:00
c9s
423cb27288
deposit2transfer: add more log messages 2023-08-08 12:08:14 +08:00
c9s
241ce657c3
binance: remove isMargin check 2023-08-08 12:01:30 +08:00
c9s
c7845477b4
deposit2transfer: remove binance spot struct field 2023-08-08 11:58:36 +08:00
c9s
33b3d0ff57
types: use consistent receiver for MarginSettings 2023-08-08 11:48:06 +08:00
Edwin
f664ef2262 pkg/exchange: add order event 2023-08-08 11:42:02 +08:00
bailantaotao
5349e5afbe
Merge pull request #1274 from bailantaotao/edwin/add-account-info
FEATURE: [bybit] add balance snapshot event
2023-08-08 11:41:02 +08:00
c9s
c55a6a46af
deposit2transfer: check confirmation for deposits 2023-08-08 11:20:17 +08:00
c9s
4c4b9db47a
types,binance: add confirmation and unlockConfirm fields to Deposit 2023-08-08 11:20:17 +08:00
c9s
5f40dfa462
deposit2transfer: scan deposit history 2023-08-08 11:20:17 +08:00
c9s
9248f8ac24
binance: define DepositStatus for binance 2023-08-08 11:20:17 +08:00
c9s
9346e7d1f6
binance: replace emptyTime with IsZero 2023-08-08 11:20:17 +08:00
c9s
0118f33bfc
binance: finalize TransferMarginAccountAsset method 2023-08-08 11:20:17 +08:00
c9s
8b1cefc699
binance: integerate isolated margin / cross margin transfer 2023-08-08 11:20:17 +08:00
c9s
92691eda24
binanceapi: add margin transfer api 2023-08-08 11:20:17 +08:00
c9s
0c6b68c4f6
add deposit2transfer strategy 2023-08-08 11:20:17 +08:00
c9s
85201d0b57
Merge pull request #1271 from c9s/c9s/strategy-convert
REFACTOR: apply market.GreaterThanMinimalOrderQuantity on both convert and xalign
2023-08-08 11:14:08 +08:00
Edwin
8b68354d89 pkg/exchange: add balance snapshot event 2023-08-08 10:04:25 +08:00
Edwin
3e4e46de20 pkg/exchange: to de-pointer the value in WsOpEvent and fix test assertion 2023-08-07 15:59:50 +08:00
Edwin
84fa19afee pkg/exchange: add auth function for ws 2023-08-07 14:58:20 +08:00
bailantaotao
a8697abf93
Merge pull request #1268 from bailantaotao/edwin/stream-query-book
FEATURE: [bybit] implement order book streaming
2023-08-07 11:29:10 +08:00
c9s
c3cce05bdd
xalign: apply market.GreaterThanMinimalOrderQuantity on xalign 2023-08-05 16:49:25 +08:00
c9s
8b6a8aeb7b
convert: move moq check/adjustment to types.Market 2023-08-05 16:39:03 +08:00
c9s
ce8063654d
tradingutil: add test on CollectTradeFee 2023-08-05 16:38:46 +08:00
c9s
616e9397d4
Merge pull request #1270 from c9s/c9s/strategy-convert
FEATURE: [strategy] Add convert strategy
2023-08-05 02:46:56 +08:00
c9s
4d293121d7
convert: fix pending quantity collector with trade query 2023-08-05 02:37:53 +08:00
c9s
bc8fe22e70
convert: fix collectPendingQuantity and use graceful order cancel 2023-08-05 02:15:16 +08:00
c9s
430b22f5e9
cmd: register convert strategy 2023-08-05 02:00:22 +08:00
c9s
951672fc82
improve cancelOrders method 2023-08-05 02:00:07 +08:00
c9s
eaaab914e0
refactor order executor accessors 2023-08-05 01:59:52 +08:00
c9s
c605761c4f
add tradingutil package 2023-08-05 01:59:36 +08:00