Commit Graph

1111 Commits

Author SHA1 Message Date
YC
80e5144950 Merge pull request #184 from c9s/ftx/add-missing-query-string 2021-03-24 16:26:33 +08:00
ycdesu
241f1ee9de ftx: support lastOrderID 2021-03-23 22:27:11 +08:00
ycdesu
17b6122cf8 ftx: assign query string to order/wallet requests 2021-03-23 22:26:18 +08:00
ycdesu
bce749c13b ftx: add missing query string 2021-03-23 22:25:57 +08:00
ycdesu
33046df35b ftx: list closed orders 2021-03-23 22:25:21 +08:00
ycdesu
cb52b436cb ftx: add log 2021-03-23 22:25:05 +08:00
c9s
cbd43c159f bump version 2021-03-23 21:52:42 +08:00
c9s
29f77c2176 add environ.DatabaseService nil check for backtest 2021-03-22 22:48:43 +08:00
c9s
3a842836cd bump version 2021-03-22 18:51:32 +08:00
c9s
5de221524f adjust state and reset per day 2021-03-22 18:48:18 +08:00
c9s
6c8babfb27 allow public session 2021-03-22 17:40:17 +08:00
c9s
67bfc508c8 max: remove unnecessary log 2021-03-22 17:40:00 +08:00
c9s
2b27815929 move out groupID to the maxapi package 2021-03-22 17:32:22 +08:00
c9s
706b38efa3 gap: finalize the implementation 2021-03-22 17:32:22 +08:00
c9s
111b3ba036 max: improve multi-order request 2021-03-22 17:32:22 +08:00
c9s
3c5071b87e use uint32 for groupID 2021-03-22 17:32:22 +08:00
c9s
cd5ac1ddf5 fix convert for limit maker 2021-03-22 17:32:22 +08:00
c9s
865dda14f5 gap: accumulate fee 2021-03-22 17:32:22 +08:00
c9s
24c4d05e91 max: load websocket base url from the env var 2021-03-22 17:32:21 +08:00
c9s
088b22f338 support bbgo-no-cache option 2021-03-22 17:32:21 +08:00
c9s
e86f29b7cc add gap strategy 2021-03-22 17:32:21 +08:00
ycdesu
ab743f85c2 ftx:support deposit histories 2021-03-21 20:17:41 +08:00
ycdesu
d2a5a755be ftx: implement queryMarket 2021-03-21 13:06:46 +08:00
ycdesu
14652c6918 ftx: define market request 2021-03-21 13:06:46 +08:00
ycdesu
c30a026243 ftx: support market cmd 2021-03-21 13:06:46 +08:00
Yo-An Lin
1293dbb64b Merge pull request #180 from c9s/strategy/xmaker
feature: add strategy xmaker
2021-03-21 13:00:00 +08:00
c9s
814a77ea39 xmaker: improve balance checking 2021-03-21 12:55:33 +08:00
c9s
2a067e5cb4 add more balance check for hedging 2021-03-21 12:55:33 +08:00
c9s
1f744b0fa5 convert limit maker type to post only 2021-03-21 12:55:33 +08:00
c9s
837934e690 add post_only order type 2021-03-21 12:55:33 +08:00
c9s
6b877e1394 add limit maker order type 2021-03-21 12:55:33 +08:00
c9s
4e3f325bb6 first commit of xmaker strategy from mobydick 2021-03-21 12:55:33 +08:00
ycdesu
04870acbab fixedpoint: get num of fractional parts 2021-03-21 12:52:45 +08:00
c9s
cf1262c1a9 update version.go 2021-03-21 10:20:00 +08:00
c9s
ca27bf100d grid: use instance id for persistence 2021-03-20 23:07:04 +08:00
c9s
ef8543db8a show accumulative arbitrage profit in the message 2021-03-20 23:05:11 +08:00
c9s
b4083bdf10 fix fee calc tests 2021-03-20 22:59:53 +08:00
c9s
a52101b163 remove bps from the fee calc 2021-03-20 22:53:14 +08:00
c9s
d97275e408 query max account fee from the vip level api 2021-03-19 17:06:48 +08:00
YC
062a008674 Merge pull request #174 from c9s/ftx/fix-placeorder-init 2021-03-19 10:35:54 +08:00
ycdesu
a7bdcdff38 fix: fix placeorder cmd 2021-03-19 10:07:39 +08:00
ycdesu
c8447663db refactor: use fixedpoint to store fee 2021-03-19 08:49:24 +08:00
ycdesu
83ae943a4f ftx: calculate commission 2021-03-18 23:58:28 +08:00
ycdesu
a62481590e ftx: support PlatformCurrency 2021-03-18 23:58:28 +08:00
ycdesu
8a75b21a38 ftx: support account info 2021-03-18 23:53:55 +08:00
Yo-An Lin
9e596a0f63 Merge pull request #171 from c9s/feature/grid-profit-notification
strategy: calculate grid arbitrage profit per order
2021-03-18 18:19:09 +08:00
c9s
dffd9fc980 add VipLevel api query support 2021-03-18 17:58:18 +08:00
c9s
890324a4ad maxapi: add VipLevel 2021-03-18 17:58:18 +08:00
c9s
761d51597d add todo fee rate here 2021-03-18 17:48:05 +08:00
c9s
4975fb5498 track arbitrage orders 2021-03-18 17:20:21 +08:00
c9s
a95c3b94a0 core: set default store ID 2021-03-18 17:20:07 +08:00
c9s
0e6918a352 grid: add profit field 2021-03-18 15:46:14 +08:00
Yo-An Lin
40b376802e Merge pull request #168 from c9s/feature/mark-trade-strategy 2021-03-18 10:31:59 +08:00
Yo-An Lin
06381c250b Merge pull request #165 from Larry850806/remove-useless-code-in-balances-cmd 2021-03-18 10:31:41 +08:00
Larry850806
28f4584191 Use empty config if config file doesn't exist 2021-03-18 10:04:41 +08:00
c9s
cad8349a1a remove state OrderStateFinalizing from the order state
since we are only interested in the closed orders
2021-03-18 01:15:49 +08:00
c9s
dd87bde785 fix reward sync time range issue 2021-03-18 01:15:38 +08:00
c9s
85b6cb81a2 make local active orderbook json marshallable 2021-03-18 01:15:06 +08:00
c9s
8d784576cd put state vars into the state struct for persistence 2021-03-18 01:14:56 +08:00
c9s
72c1f55b70 fix grid price calculation 2021-03-18 00:46:25 +08:00
c9s
4a415a43b3 fix reward query 2021-03-18 00:46:10 +08:00
c9s
90477826cf implement byte parser for fixedpoint parsing 2021-03-17 22:20:25 +08:00
ycdesu
4a5a53ea28 ftx: support queryClosedOrders 2021-03-17 21:26:25 +08:00
Larry850806
4dc478590f Remove configuring database in balances cmd 2021-03-17 14:35:00 +08:00
ycdesu
54ca62ac5c ftx: define ordersHistory in rest client 2021-03-17 08:18:37 +08:00
ycdesu
342b0dd1dd ftx: cancel orders 2021-03-16 22:36:44 +08:00
Yo-An Lin
7ecb17dbe2 Merge pull request #163 from c9s/feature/mark-trade-strategy 2021-03-16 22:34:09 +08:00
c9s
216c12b49e backup and restore position 2021-03-16 20:07:54 +08:00
c9s
a1667010eb fix filled grid map assignment 2021-03-16 20:05:03 +08:00
c9s
714d61a829 add grid restore behavior 2021-03-16 20:04:06 +08:00
c9s
8c08cfebb7 rename MarkStrategyID to just Mark 2021-03-16 14:07:47 +08:00
Yo-An Lin
f5b65e795e Merge pull request #160 from c9s/feature/grid-options 2021-03-16 12:59:14 +08:00
c9s
ebcef65b01 mark trades with the strategy ID 2021-03-16 10:58:51 +08:00
c9s
478bef526d copy the position object and send notification 2021-03-16 02:22:00 +08:00
c9s
98995bc75c use debug log for skipping filled grid 2021-03-16 02:21:46 +08:00
c9s
f56df038aa fix position and add catchup mode for grid strategy 2021-03-16 02:18:17 +08:00
c9s
60aa7df69a adjust withdraw/deposit query limit since there are no many in most cases 2021-03-16 02:14:24 +08:00
c9s
40fded70b2 reformat scale.go 2021-03-16 02:14:10 +08:00
c9s
c5eb6483a5 integrate QueryTicker for backtesting 2021-03-16 02:13:52 +08:00
c9s
2f7c7d344b move emitStart method call into the stream Connect method 2021-03-16 01:32:27 +08:00
c9s
7951c38edc skip connection if there is no subscription 2021-03-16 01:31:56 +08:00
ycdesu
c08899f7fb ftx: add ftx to supported exchange 2021-03-15 20:40:04 +08:00
ycdesu
c88297117b ftx: new rest everytime 2021-03-15 19:02:14 +08:00
c9s
c3996aee2b add Backup method to the local active order book 2021-03-15 18:25:36 +08:00
c9s
46c59f5009 add both side and support json unmarshalling 2021-03-15 18:09:55 +08:00
c9s
2bf4a555ec use OnStart instead of OnConnect
this is for avoiding re-connect issue
2021-03-15 18:04:55 +08:00
c9s
e311a182fa add onStart callbacks 2021-03-15 18:04:03 +08:00
c9s
9f7af3ce82 assign SubAccount name to the new exchange session 2021-03-15 17:51:17 +08:00
c9s
c95e712420 binance: emit disconnect 2021-03-15 17:48:16 +08:00
c9s
6d249cf83c bypass disconnect event 2021-03-15 17:48:16 +08:00
c9s
61a19cbfb4 align fields and tags 2021-03-15 17:31:07 +08:00
c9s
ab6b56d91e fix taker volume parsing 2021-03-15 15:37:53 +08:00
c9s
7b7811bbc3 revise orderbook command options 2021-03-15 10:23:53 +08:00
c9s
b24c69729a improve orderbook print layout 2021-03-15 10:23:42 +08:00
c9s
3ffa319ba8 improve max websocket reconnecting issue 2021-03-15 10:23:20 +08:00
c9s
e8ccc5eabf pass SubAccount field to the factory 2021-03-15 10:23:00 +08:00
c9s
97d427a9ca add ftx into the standard exchange factory 2021-03-15 10:22:45 +08:00
c9s
2eda012f43 add SubAccount field to the exchange session config 2021-03-15 10:13:41 +08:00
c9s
b7da47411e split exchange interface into ExchangeMarketDataService, ExchangeTradingService 2021-03-15 10:06:02 +08:00
c9s
c788601856 add disconnect callbacks on stream 2021-03-15 09:49:22 +08:00
Yo-An Lin
e0d7fefbf2 Merge pull request #150 from c9s/fix/pnl
feature: add deposit service and withdraw service for sync
2021-03-15 09:01:24 +08:00
Yo-An Lin
806a32724f Merge pull request #153 from c9s/improve/balances-cmd 2021-03-14 11:51:49 +08:00
c9s
afb8105694 add reward service todo 2021-03-14 11:18:23 +08:00
c9s
38b9baf340 connect sync with deposit and withdraw services 2021-03-14 11:18:23 +08:00
c9s
54ba240317 implement deposit sync 2021-03-14 11:18:22 +08:00
c9s
0246e298d2 apply launch date if since time is empty 2021-03-14 11:18:22 +08:00
c9s
75c6a2791c reduce log 2021-03-14 11:18:22 +08:00
c9s
ccbb78ce4d migration: extend tx id and address size 2021-03-14 11:18:22 +08:00
c9s
8e85274876 fix used time field for withdraw 2021-03-14 11:18:22 +08:00
c9s
b25671c864 fix max deposits history ordering 2021-03-14 11:18:22 +08:00
c9s
75778675e3 fix withdraw query order 2021-03-14 11:18:22 +08:00
c9s
dbcf35e4a4 add FeeCurrency field 2021-03-14 11:18:22 +08:00
c9s
2d6b6e7427 fix withdrawal data ordering 2021-03-14 11:18:22 +08:00
c9s
4d3b1ec938 fix QueryWithdrawHistory and QueryDepositHistory 2021-03-14 11:18:22 +08:00
c9s
4b49fda463 refactor sync service 2021-03-14 11:18:22 +08:00
c9s
3c90aa515d add deposit service and withdraw service 2021-03-14 11:18:22 +08:00
c9s
f22a6ee697 implement sync method on the trade service 2021-03-14 11:18:22 +08:00
c9s
8fc7c4798e implement sync method on reward service 2021-03-14 11:18:22 +08:00
c9s
5a02cdbda3 implement sync method on the order service 2021-03-14 11:18:22 +08:00
c9s
877ea73435 maxapi: align fields 2021-03-14 11:18:22 +08:00
c9s
be672c89e6 max: update deposit and withdraw types 2021-03-14 11:18:22 +08:00
c9s
3f0290479b binance: update withdraw and deposit types 2021-03-14 11:18:22 +08:00
c9s
ac45bb306a types: update deposit fields and withdraw fields 2021-03-14 11:18:22 +08:00
c9s
2b485602ad split ExchangeTransferService 2021-03-14 11:18:22 +08:00
c9s
b0ea2bfe14 types: add exchange name sql value and unmarshalling 2021-03-14 11:18:22 +08:00
c9s
4e9973681a add migration files 2021-03-14 10:58:26 +08:00
c9s
22a9809327 improve balances command 2021-03-14 10:35:01 +08:00
c9s
33213746f4 cmd: add --all option to the cancel command 2021-03-14 10:29:45 +08:00
ycdesu
a83b95d262 ftx: implemenet place order func 2021-03-13 10:41:04 +08:00
ycdesu
c3a677e2b8 ftx: rename orders cmd to listorders 2021-03-13 10:41:04 +08:00
ycdesu
506fdcd84f ftx: add conversion helper 2021-03-13 09:51:16 +08:00
ycdesu
778ceb2985 ftx: define orderResponse struct 2021-03-13 09:51:03 +08:00
ycdesu
0e611dbee4 ftx: rename orders to ordersResponse 2021-03-12 23:03:08 +08:00
c9s
48fe6054b0 exchange/max: fix query reward issue 2021-03-10 14:18:01 +08:00
Yo-An Lin
b58e96a8a2 Merge pull request #148 from jnlin/fix/telegram-config 2021-03-10 12:42:28 +08:00
Jui-Nan Lin
19e523c1e9 fix: typo of telegram bot auth token 2021-03-10 12:31:26 +08:00
YC
b33402df24 Merge pull request #147 from c9s/ftx/query-open-orders 2021-03-08 18:50:56 +08:00
ycdesu
ee8ebde12d ftx: add todo 2021-03-07 12:53:41 +08:00
ycdesu
6599f276db ftx: implement query open orders 2021-03-07 12:51:13 +08:00
ycdesu
3676450e4b ftx: convert open order 2021-03-07 12:51:13 +08:00
ycdesu
16366b09a4 ftx: rename responses.go to rest_responses.go 2021-03-07 12:51:13 +08:00
ycdesu
26963ce7ab ftx: rename balance.go to rest_balance_request.go 2021-03-07 12:51:13 +08:00
ycdesu
f6f3fcab02 ftx: orderbook snapshot checksum 2021-03-06 19:23:44 +08:00
ycdesu
be7c393fcb ftx: print orderbook update 2021-03-04 10:02:40 +08:00
ycdesu
cd6457f5c0 orderbook: extract String() from Print() 2021-03-04 08:55:33 +08:00
ycdesu
43275d08bc ftx: use pure function to convert orderbook snapshot 2021-03-03 22:36:14 +08:00
ycdesu
55b9569777 ftx: use the same struct to handle orderbook snapshot/update 2021-03-03 22:33:06 +08:00
Larry850806
689734567a Remove unused conditions when generating orders 2021-03-03 14:55:11 +08:00
ycdesu
e34f68ab90 ftx: unmarshal all fields at the same time 2021-03-03 10:31:46 +08:00
ycdesu
081aa17deb doc: modify comment 2021-03-03 08:38:55 +08:00
ycdesu
160f6323e8 ftx: emit orderbook snapshot 2021-03-02 22:18:41 +08:00
ycdesu
253810556e ftx: unmarshal orderbook snapshot 2021-03-02 18:33:19 +08:00
ycdesu
45528fa219 ftx: modify log 2021-03-02 18:33:19 +08:00
ycdesu
a26c0553ee cmd: raise symbol not found err 2021-03-02 18:33:19 +08:00
ycdesu
6f81b0ee17 orderbook: fix IsValid logic
The original implementation always returns an error.
2021-03-02 10:33:46 +08:00
ben
40eadfeaca add yaml tag for mapping basic risk control order executor. 2021-03-01 13:44:58 +08:00
c9s
ea5554cf52 fix Makefile and update version file 2021-03-01 12:07:00 +08:00
Yo-An Lin
a52f487d4e Merge pull request #138 from c9s/feature/global-margin-structure
feature: convert and parse binance margin structure into global types
2021-02-28 16:13:48 +08:00
Yo-An Lin
592a8d87ae Merge pull request #137 from c9s/feature/scale
feature: add exp scale and log scale formula
2021-02-28 16:13:38 +08:00
c9s
3e616c5fac convert and parse binance margin account structure 2021-02-28 15:06:20 +08:00
c9s
32c2780b16 convert binance margin account data into the global structure 2021-02-28 15:06:20 +08:00
c9s
b71ea867c5 ignore sync if sync service is nil 2021-02-28 15:05:49 +08:00
c9s
da79920ca9 rename scale struct name to PriceVolumeScale 2021-02-28 14:51:24 +08:00
c9s
83111c9eb9 test exponential scale with reverse range 2021-02-28 12:12:03 +08:00
c9s
3c9bcd8c9d add more margin order side effect alias 2021-02-28 12:00:51 +08:00
c9s
99f236d2e0 integrate quantity scale into support strategy and grid strategy 2021-02-28 11:57:25 +08:00
c9s
bf87fbbf55 add LinearScale 2021-02-28 02:20:47 +08:00
c9s
8572df2cb3 add link to TestQuadraticScale 2021-02-28 02:07:48 +08:00
c9s
83af52c53b add QuadraticScale 2021-02-28 02:06:33 +08:00
c9s
52395fd460 add log scale graph link 2021-02-28 01:55:35 +08:00
c9s
fbb8837c5c add exp scale and log scale formula 2021-02-28 01:53:45 +08:00
ycdesu
f7ef4a8028 cmd: create orderbook command to print orderbook snapshot and updates 2021-02-27 19:28:01 +08:00
ycdesu
883b7ef028 ftx: handle message in a new struct 2021-02-27 19:27:44 +08:00
ycdesu
d9ad022a81 ftx: define subscribed msg 2021-02-27 19:27:37 +08:00
ycdesu
73d05fe7bb ftx: send subscriptions when connected 2021-02-27 18:42:46 +08:00
ycdesu
2a0bd5f962 ws: make Reconnect() public 2021-02-27 18:42:45 +08:00
ycdesu
282ce3ee99 cmd: move simple session factory to cmd/utils.go 2021-02-27 18:42:45 +08:00
ycdesu
fd5574b006 cmd: add balances testing cmd
Only support ftx
2021-02-27 17:24:59 +08:00
ycdesu
c52f918dd4 ftx: add missing types.exchange methods 2021-02-27 17:24:08 +08:00
ycdesu
45da7ca1f5 cmd: add ftx flags 2021-02-27 17:23:59 +08:00
ycdesu
8b838b9a59 ftx: make logger private 2021-02-27 17:01:20 +08:00
ycdesu
b28d9631ab ftx: return ftx stream but hasn't implement it yet 2021-02-27 16:48:50 +08:00
ycdesu
bf97af34f3 ws: implement base websocket client 2021-02-27 16:48:50 +08:00
c9s
03d7290e03 pull out time range group by clause generator 2021-02-26 17:22:08 +08:00
c9s
28a8ab34a2 pull out time range column name 2021-02-26 16:16:41 +08:00
c9s
02e7451ed6 bump version 2021-02-26 16:16:34 +08:00
c9s
1d29009133 fix max trade query ordering and sql query ordering for query last 2021-02-25 13:55:04 +08:00
c9s
854014f49a add currency position aggregation and tests 2021-02-24 10:46:42 +08:00
c9s
14830c442c refactor and implement reward sync and query 2021-02-23 22:53:00 +08:00
c9s
5a7cf05701 integrate reward service into the sync service 2021-02-23 16:39:48 +08:00
c9s
fb62af05a4 add global Reward type 2021-02-23 10:08:01 +08:00
c9s
96362a4936 max: add rewards api and example 2021-02-22 18:45:44 +08:00
c9s
507586b560 fix max websocket subscription 2021-02-22 17:36:30 +08:00
c9s
73cb80ee96 improve logging 2021-02-22 17:06:43 +08:00
c9s
21a4669905 adjust max query limiter and sync before running trader 2021-02-22 16:54:08 +08:00
c9s
e93b5a1868 add version command 2021-02-22 15:23:09 +08:00
c9s
f7c952f8ca add version files 2021-02-22 15:16:12 +08:00
c9s
59d68e7f0d max: adjust trades limit to 1000 2021-02-22 15:03:15 +08:00
c9s
eaad414706 adjust max api call rate limiting 2021-02-22 15:01:05 +08:00
c9s
724dad70bb remove trade sync from environ init 2021-02-22 14:14:39 +08:00
c9s
84775652fe remove defer wrapper func 2021-02-22 13:49:26 +08:00
c9s
cdb7ce84c8 apply rate limit 2021-02-22 13:36:39 +08:00
c9s
63ebbc0e73 fix frontend sync status checking 2021-02-21 19:36:03 +08:00
c9s
f2978fa89c pull out ping interval parameter 2021-02-21 18:58:25 +08:00
c9s
3629a1f5a2 pre-save syncing var for return 2021-02-21 18:54:48 +08:00
c9s
9ea1a22b3f wrap errors 2021-02-21 17:48:03 +08:00
c9s
a8516edb98 add Get method to the persistence service facade 2021-02-21 16:55:45 +08:00
c9s
21b092037e refactor notification configuration 2021-02-21 16:52:47 +08:00
c9s
fa4e813729 resolve cyclic imports 2021-02-21 01:01:39 +08:00
c9s
6845db6dd3 refactor database configure method 2021-02-21 00:58:34 +08:00
c9s
1763fb8904 improve the warning message 2021-02-21 00:48:26 +08:00
c9s
12ed5a1efe move persistence service into the service package 2021-02-21 00:45:56 +08:00
c9s
b7a3f2ee03 refactor telegram initialization 2021-02-20 12:33:43 +08:00
c9s
be00aae81e move trade configuration to the trader struct method 2021-02-20 12:23:31 +08:00
c9s
c72b7b2dfa add sync api for syncing trades in the background 2021-02-20 11:56:39 +08:00
c9s
7684099f01 add /api/environment/syncing api 2021-02-20 11:54:48 +08:00
c9s
4ce6e85624 add sync status to the environment 2021-02-20 11:29:33 +08:00
c9s
ff5233ba3e support: use Notfiy 2021-02-20 10:51:01 +08:00
c9s
dd13b9a8bf remove start time query condition for trade sync since starting from trade id = 1 works 2021-02-19 14:18:50 +08:00
c9s
44fa74a4c9 refactor session sync 2021-02-19 10:42:24 +08:00
c9s
390c9b1a4b move Sync method into the sync service 2021-02-19 10:26:13 +08:00
c9s
eaa8c647b5 refactor session sync 2021-02-18 22:40:46 +08:00
c9s
90069a8589 improve sync command to find possible trading symbols automatically 2021-02-18 22:07:54 +08:00
c9s
65ff2894c5 binance: calculate quote quantity manually if it's not defined 2021-02-18 18:24:00 +08:00
c9s
3a89b0a714 improve trade sync 2021-02-18 18:20:18 +08:00
c9s
654ad62f36 remove type assert 2021-02-18 17:42:14 +08:00
c9s
0ba595bd55 Fix trade sync for self trades
MAX uses one single trade for presenting self trade.

BINANCE uses two trade records for presenting self trade. the trade
creation time are the same.
2021-02-18 17:37:49 +08:00
c9s
c3dbb1b204 avoid using last trade id for syncing data 2021-02-18 16:40:47 +08:00
c9s
29bbd03836 add binance single ticker query method and fix quantity formating 2021-02-18 16:17:40 +08:00
c9s
b9564690b5 fix go migration loader 2021-02-17 19:06:55 +08:00
c9s
b2bcd3528c use sqlx for testing connection 2021-02-17 17:35:54 +08:00
c9s
88f7f0f61c compile and update migration package 2021-02-17 17:35:11 +08:00
c9s
ea27a291db compile and update migration package 2021-02-17 17:28:05 +08:00
c9s
a1cb3859c3 fix db driver setup 2021-02-17 14:57:29 +08:00
c9s
e372a53835 refactor transfer history command 2021-02-17 14:43:50 +08:00
c9s
49f4039a23 add timestamp parameter 2021-02-16 17:11:15 +08:00
c9s
9a7437de53 set default limit to 1000 2021-02-16 17:10:58 +08:00
c9s
5f759780c3 remove unused since flag 2021-02-16 17:10:48 +08:00
c9s
3867fdde91 add stringer interface to Position 2021-02-16 16:40:11 +08:00
c9s
bc3754d989 check if limit is set 2021-02-16 16:39:56 +08:00
c9s
02512805f8 set default query trade limit to 1000 for max 2021-02-16 16:32:48 +08:00
c9s
e3d3eacb78 fix trade service injection 2021-02-16 16:30:01 +08:00
c9s
8ae4cab550 inject TradeService field if we found it 2021-02-16 16:14:49 +08:00
c9s
c75eb6b5ba pull out Persistence injection to the common injection 2021-02-16 16:13:52 +08:00
c9s
5c1630f000 refactor strategy executor 2021-02-16 16:12:00 +08:00
c9s
bf0ba89aee convert StrategyID field to NullString 2021-02-16 16:00:14 +08:00
c9s
fc4419b49b refactor injection 2021-02-16 15:58:21 +08:00
c9s
1c2646b0af add Test_injectField 2021-02-16 15:49:57 +08:00
c9s
67a3c49081 add more trade service tests 2021-02-16 15:34:01 +08:00
c9s
ebe065332c allocate sqlx db from rockhopper db 2021-02-15 21:07:55 +08:00
c9s
c219dc7be0 add test code for testing migration scripts 2021-02-15 21:04:44 +08:00
c9s
3d47b3f34d update trade fields for pnl and strategy id 2021-02-15 20:55:14 +08:00
c9s
786f37e675 add MarkStrategyID for marking trade with the source strategy 2021-02-15 20:53:19 +08:00
c9s
f3d65b1281 add UpdatePnL method for updating trade pnl field 2021-02-15 20:51:34 +08:00
c9s
8224447985 fix build tags 2021-02-15 16:21:47 +08:00
c9s
0c9ca851e5 improve support strategy 2021-02-15 01:26:46 +08:00
c9s
bea750ca97 make margin order side effect json unmarshallable 2021-02-15 01:26:23 +08:00
c9s
f8378957ee add more checks for bollgrid
related to #93
2021-02-13 16:03:31 +08:00
Yo-An Lin
de195b3c17 Merge pull request #130 from Larry850806/fix/bollgrid 2021-02-11 15:38:50 +08:00
Larry850806
ca31179b40 Fix balance calculation 2021-02-11 14:48:13 +08:00
c9s
f7ef91b55c binance: set the default ping handler 2021-02-11 08:13:50 +08:00
c9s
4a0bd45301 remove order test code 2021-02-11 00:30:37 +08:00
c9s
ffa001fc29 fix quantity format 2021-02-11 00:21:56 +08:00
c9s
88411a134b add supportAndTargets strategy 2021-02-11 00:21:06 +08:00
c9s
4b66deec3d subscribe RepostInterval as well
might be related to issue #93
2021-02-10 22:45:23 +08:00
c9s
061312771c fix float formatting 2021-02-10 22:41:42 +08:00
c9s
57435419b4 add marketData label 2021-02-10 22:40:36 +08:00
Larry850806
9f6d9028fa Use fixedpoint type to calculate the balance 2021-02-10 16:01:11 +08:00
Larry850806
6d399647cf Remove unused functions 2021-02-10 11:37:37 +08:00
Larry850806
11a176145e Refactor placeGridOrders into three functions 2021-02-10 11:37:33 +08:00
Larry850806
d22a8e9c63 Improve bollgrid strategy's balance check and quote calculation 2021-02-10 10:11:32 +08:00
YC
776cd95955 Merge pull request #128 from c9s/ftx/balance 2021-02-09 19:49:38 +08:00
Yo-An Lin
bb394c8d38 Merge pull request #124 from ychi/feat/calculate-asset-with-ticker
feat/calculate asset with ticker
2021-02-09 17:49:22 +08:00
Yo-An Lin
5b06c47b2a Merge pull request #125 from c9s/fix/grid 2021-02-09 12:02:04 +08:00
ycchen
2b285c0202 fix: remove unused 2021-02-08 22:43:20 +01:00
ycchen
6655e16889 minor tweaks 2021-02-08 22:41:44 +01:00
ycchen
61c98432f2 feat: tickers for asset calculation 2021-02-08 22:41:44 +01:00
ycdesu
ed86e923df ftx: add exchange name 2021-02-08 22:33:12 +08:00
ycdesu
0eb0bdefa2 ftx: use uppercase in toGlobalCurrency 2021-02-08 22:29:50 +08:00
ycdesu
46b0315871 ftx: implement ftx balances querying 2021-02-08 19:07:18 +08:00
ycdesu
eb00720043 ftx: define empty ftx.toGlobalCurrency 2021-02-08 19:07:18 +08:00
ycdesu
7c48670c39 ftx: define rest client 2021-02-08 19:07:18 +08:00
ycdesu
8663704d6e util: create IsJSON/IsHTML type helper 2021-02-08 19:07:18 +08:00
ycdesu
565086cc2a util: extract IsError method 2021-02-08 19:07:18 +08:00
ycdesu
54ef8d3ca6 ftx: define empty exchange 2021-02-08 19:04:18 +08:00
c9s
72044a63fd remove query trades default limit 200 2021-02-08 13:40:47 +08:00
c9s
ffb6a29d0d fix startPrice value conversion 2021-02-08 13:21:22 +08:00
Yo-An Lin
f8ae8ec5b0 Merge pull request #108 from ychi/feat/exchange-ticker-api 2021-02-08 07:37:50 +08:00
ycchen
7a67083fbe Address review feedbacks 2021-02-07 22:58:30 +01:00
Jui-Nan Lin
001f0e8c2f fix(max): use global trade side here, not string 2021-02-07 14:58:44 +08:00
c9s
173074f5e4 improve grid strategy's balance check and quote calculation 2021-02-07 11:37:24 +08:00
c9s
367e9fcae1 fix price range check 2021-02-07 10:58:31 +08:00
ycchen
288f7257eb fix testcases 2021-02-06 19:39:43 +01:00
ycchen
5fed7b81de QueryTicker 2021-02-06 18:35:23 +01:00
ycchen
fa20df487e feat: ticker api for types.Exchange 2021-02-06 14:05:26 +01:00
Yo-An Lin
a738bffc07 Merge pull request #112 from jnlin/fix/pnl-amount 2021-02-06 18:26:04 +08:00
Yo-An Lin
b81eb33cad Merge pull request #117 from c9s/wizard/sqlite3
add sqlite3 driver option to the wizard user interface
2021-02-06 17:41:45 +08:00
Jui-Nan Lin
b38b65ce83 fix(pnl): do not calculate the "self" trade 2021-02-06 17:34:13 +08:00
Jui-Nan Lin
30f085fa91 fix(max): IsBuyer should check side "buy" and "bid" 2021-02-06 17:30:18 +08:00
Jui-Nan Lin
7e1825d991 Merge branch 'main' into fix/pnl-amount 2021-02-06 17:22:43 +08:00