Commit Graph

418 Commits

Author SHA1 Message Date
c9s
553fe3abf9 remove config flag constrant 2022-03-16 13:51:31 +08:00
c9s
334e3a3940 fix build cmd --config option 2022-03-16 12:26:27 +08:00
c9s
322f31a56a bbgo: improve RecordPosition method 2022-03-14 21:21:58 +08:00
zenix
7e92f0f4e5 fix: remove requirements on config flag 2022-03-11 19:56:59 +09:00
zenix
25b5eddc03 feature: add multiple exchange support in backtest
fix: change doc, since --exchange removed from backtest

fix: test for config changes
2022-03-07 13:18:56 +09:00
Yo-An Lin
f8b257d490
Merge branch 'main' into fix/cmd-required 2022-03-03 19:53:27 +08:00
c9s
f190cc4f6c cmd: fix account command usage 2022-03-03 19:40:18 +08:00
c9s
f14694c65f cmd: remove config file check from the account command 2022-03-03 19:39:55 +08:00
zenix
a33b748563 fix: mark flags as required during PreRunE 2022-03-03 18:03:15 +09:00
c9s
3843bda7c2 cmd: remove incorrect MarkPersistentFlagRequired usage 2022-03-03 15:37:17 +08:00
c9s
7d08263cdb fix: fix required flag marking issue 2022-03-03 15:34:16 +08:00
c9s
da54fbb676 cmd: remove extra config option check 2022-03-03 11:39:28 +08:00
c9s
21ae48c975 cmd: use MarkFlagRequired 2022-03-03 11:36:06 +08:00
c9s
688445d7e7 cmd: add get-order cmd 2022-03-03 00:30:52 +08:00
c9s
127de0d81c cmd: update executeOrderCmd description 2022-03-03 00:30:52 +08:00
Yo-An Lin
2108003f9b
Merge pull request #454 from zenixls2/fix/pnl
fix: #287 init environ before querying balance
2022-02-23 11:46:11 +08:00
zenix
06e9450859 feature: add cmd document
add documentation index
2022-02-22 19:36:45 +09:00
zenix
52cc047673 fix: #287 init environ before querying balance 2022-02-22 14:32:35 +09:00
zenix
8648528435 fix go fmt, fix convert.go (the legacy fixedpoint implementation) in all tests 2022-02-15 14:55:19 +09:00
zenix
05521a98b6 add skeleton strategy. fix most of the tests. fix final asset value 2022-02-15 12:01:39 +09:00
zenix
abc1d535d8 fix bollmaker, fix pnl issues 2022-02-15 12:01:39 +09:00
c9s
bf8558e9ad bollmaker: add BuyBelowNeutralSMA option 2022-02-01 01:40:51 +08:00
c9s
17187c70e7 cmd: print realized profit in colored text 2022-02-01 01:05:11 +08:00
c9s
c0beca78f5 include terminal color for back-test report 2022-02-01 01:00:26 +08:00
c9s
82adff338e cmd/backtest: calculate performance in quote asset 2022-02-01 00:54:55 +08:00
c9s
547f4c400a cmd: call BindSync when running strategy 2022-01-27 18:19:25 +08:00
c9s
44efbce8eb cmd: change trades cmd time range to just 1 day 2022-01-27 09:26:24 +08:00
c9s
c3c2822c82 cmd/trades: avoid passing since and until at the same time 2022-01-27 08:57:31 +08:00
c9s
880d806736 cmd: add --no-sync option to the run command 2022-01-27 08:30:31 +08:00
c9s
70f02a1c19 cmd: handle user config sync options in the run command 2022-01-27 08:21:19 +08:00
c9s
cfc17acd20 config: use looseFormatTime type for since field 2022-01-27 00:24:19 +08:00
c9s
ab07768a6d cmd: apply config to sync 2022-01-27 00:17:11 +08:00
c9s
007207e24f all: use types.LooseFormatTime to parse loose format date time string 2022-01-25 00:24:12 +08:00
c9s
1f18c36870 cmd: improve build command 2022-01-23 14:44:17 +08:00
austin362667
d0e26c66e4 strategy: add funding strategy 2022-01-15 08:28:02 +08:00
c9s
255ee40c98 bbgo: when calling order cancel we should use background context 2022-01-15 00:49:27 +08:00
c9s
09592755cc cmd: add dump-update option to orderbook cmd 2022-01-12 22:00:29 +08:00
c9s
8c2228f428 cmd: use time.Local for the local timezone 2022-01-12 15:33:04 +08:00
c9s
e5b4af53e6 all: clean up SubmitOrder fields 2022-01-11 01:36:19 +08:00
c9s
5103088675 cmd: fix submitOrder cmd 2022-01-10 17:16:07 +08:00
c9s
4cdb5b607b rename bollpp to bollmaker 2022-01-09 01:20:47 +08:00
c9s
42f22e0ef3 add prometheus metrics server 2021-12-27 16:27:14 +08:00
c9s
f7c39290a0 call tradeCollector process to check trades 2021-12-27 00:51:57 +08:00
c9s
30a7ca1ce1 rename gap to xgap 2021-12-26 15:13:51 +08:00
c9s
0cef2c52ef all: improve cancel command and add uuid field to order struct 2021-12-26 01:27:22 +08:00
c9s
471d86c801 kucoin: implement order submit 2021-12-26 00:27:52 +08:00
c9s
dd22776a7e cmd: refactor the exchange factory function 2021-12-25 23:27:05 +08:00
c9s
442afe8eb9 backtest: pull out market data feeding to a function and call it in the main thread 2021-12-25 22:57:28 +08:00
c9s
f0d4236169 all: fix and improve kucoin orderbook stream 2021-12-25 19:34:27 +08:00
c9s
217499528d binance: refactor binance depthBuffer with depth query 2021-12-25 02:14:49 +08:00
c9s
7e7115b18f replace binance.depthFrame with the extracted depth.Buffer 2021-12-25 02:14:49 +08:00
c9s
49e516b80e backtest: allocate public exchange (with empty key secret) for backtesting 2021-12-24 00:24:19 +08:00
c9s
f5bbe29ac6 cmd: fix debug flag loading and add debug log to cache function 2021-12-23 23:02:07 +08:00
c9s
e76dd1cbc4 kucoin: fix kline parsing and subscription 2021-12-23 17:49:18 +08:00
c9s
e2415857b0 cmd: graceful close the connection 2021-12-23 17:49:18 +08:00
c9s
562c287a4e all: move publicOnly to StandardStream 2021-12-23 17:49:18 +08:00
c9s
fd8b97b2ad cmd: use log category 2021-12-23 17:49:18 +08:00
TonyQ
75633dbf09 exchange/okex : implement bookticker for okex , #388 2021-12-23 12:42:13 +08:00
c9s
bd5e956892 add kucoin to the exchange factory 2021-12-22 01:28:16 +08:00
TonyQ
16933555b8 backtest : auto sync missing range 2021-12-15 01:26:05 +08:00
TonyQ
20b03fe4a5 exchange: fix ftx for wrong last kline issue 2021-12-15 00:07:54 +08:00
Yo-An Lin
6c6eb252cc Merge pull request #363 from tony1223/feature/355-ftx-backtest 2021-12-14 16:09:16 +08:00
TonyQ
8eb3eede82 fix backtest (with review) 2021-12-14 16:02:54 +08:00
なるみ
f494a0f514 Initial commit of rebalance strategy 2021-12-13 05:19:44 +08:00
c9s
06262f0172 check sync from time with start time instead of end time 2021-12-09 15:57:12 +08:00
c9s
61817e1e83 add startPrice and lastPrice in the backtest report
closes #321
2021-12-09 11:58:19 +08:00
c9s
a0f46bf9b8 improve error checking, avoid using panic inside the constructor 2021-12-08 23:30:58 +08:00
Yo-An Lin
3fb6d204aa Fix pointer check 2021-12-07 18:52:24 +08:00
c9s
5ef1ee927b improve the error message 2021-12-07 15:23:09 +08:00
c9s
f1e3cc6049 add strict start time, sync time checking for preventing back-test failure
related to #311
2021-12-07 15:21:37 +08:00
c9s
132fe893e1 use stderr for verbose log 2021-12-07 14:45:20 +08:00
c9s
0472b7f21e avoid recording trades in backtest by default
introducing a RecordTrades option
2021-12-06 01:42:53 +08:00
c9s
474be4e815 support json output for backtesting 2021-12-06 01:05:33 +08:00
c9s
df683bdf56 use position to calculate the pnl 2021-12-05 02:17:15 +08:00
TonyQ
bd325f02a5 add force parameter for backtest 2021-12-04 16:18:51 +00:00
c9s
513a799ced fix ewma calculation 2021-11-22 02:14:44 +08:00
c9s
ed1d0ea27e add xnav strategy 2021-10-29 10:40:14 +08:00
c9s
a6848a6af4 add strategy/techsignal 2021-10-14 14:24:08 +08:00
c9s
4c061439d3 rename buyandhold to pricedrop 2021-10-14 13:10:00 +08:00
c9s
768a88247b rename bpp to bollpp (bollinger pingpong) 2021-10-14 12:52:54 +08:00
c9s
6e7f12ca9f rename trailingstop to emastop 2021-10-14 12:04:56 +08:00
c9s
764a8be46a adjust grid backtest parameters 2021-10-13 10:43:56 +08:00
c9s
45c875fe7c bbgo: improve trade collect process 2021-10-05 21:30:06 +08:00
c9s
e8f0cbcff8 cmd: register etf strategy 2021-08-26 11:31:52 +08:00
c9s
5cf134a756 cmd: add account cmd --total option 2021-07-06 12:19:59 +08:00
c9s
c84d59734c clear all trades before running backtests 2021-05-30 15:25:00 +08:00
c9s
b430128ba1 okex: fix okex order cancellation 2021-05-28 03:05:59 +08:00
c9s
777701c0cb add userdatastream cmd for testing private stream 2021-05-28 00:47:34 +08:00
c9s
2844b7c3a7 okex: add kline command for testing kline data 2021-05-27 18:35:34 +08:00
c9s
2381df5009 add okex to the exchange factory 2021-05-27 00:35:51 +08:00
c9s
29ad95a639 add okex to the valid exchange name 2021-05-27 00:29:16 +08:00
c9s
4ded82c94e pull out types.Exchange interfaces to make it minimal 2021-05-27 00:05:43 +08:00
c9s
9b9643e1f9 improve order cancellation mechanisim 2021-05-22 17:44:20 +08:00
c9s
8acada76a9 replace sliceorderbook with orderbook interface 2021-05-22 16:32:29 +08:00
c9s
56b2c8845b fix preorder, postorder and inorder 2021-05-22 11:36:58 +08:00
c9s
d1ad802806 improve trade command output layout 2021-05-19 17:54:30 +08:00
c9s
2fddc9166f show bid/ask volume in the message 2021-05-19 00:41:34 +08:00
c9s
34106cf65e add cpu profile option 2021-05-18 15:38:22 +08:00
c9s
b8139e6e86 add xarb strategy 2021-05-18 10:19:35 +08:00
Jui-Nan Lin
2d5ae1dde3 fix(ftxExchange): the env variable is "FTX_ACCOUNT" 2021-05-17 12:42:04 +08:00
c9s
a4381a54a3 add fee rate field 2021-05-16 15:03:36 +08:00
c9s
236df245a2 adjust quantity bases on the balances 2021-05-15 09:46:07 +08:00
c9s
f9cb414832 twap: add update-interval option 2021-05-15 09:29:44 +08:00
c9s
445feb016a support price ticks option 2021-05-14 15:35:11 +08:00
c9s
66bc06bc5f add more order execution parameter checks 2021-05-14 14:53:26 +08:00
c9s
f69cbe9c31 add basic TwapExecution 2021-05-14 14:53:26 +08:00
c9s
3437515d6a rename placeOrder to submitOrder for making the api consistent 2021-05-14 14:53:26 +08:00
c9s
9ff7b62123 add xbalance strategy 2021-05-12 01:21:40 +08:00
c9s
dde998aced fix graceful shutdown 2021-05-10 02:17:19 +08:00
c9s
14eedecd0e fix backtest sync from time 2021-05-08 00:44:43 +08:00
c9s
3501e8f5fd refactor backtest, add BootstrapBacktestEnvironment 2021-05-08 00:14:25 +08:00
c9s
494a270c54 insert trades to db only when backtest service is nil 2021-05-07 01:50:38 +08:00
c9s
1264c50e83 improve balances, account command usability 2021-05-06 23:50:26 +08:00
c9s
1a81813e17 add --session option check 2021-05-06 23:44:05 +08:00
c9s
859bf35255 set sync-from from config by default 2021-05-05 16:45:17 +08:00
c9s
0fbc388333 add --webserver-bind option and add option to --enable-webserver 2021-05-03 17:24:39 +08:00
c9s
20d673f769 add schedule strategy 2021-05-02 18:03:41 +08:00
c9s
471e0a4c45 pass string format quantity and price 2021-04-28 19:48:17 +08:00
zenix
2bda296194 Fix: upgrade binance api, fix go fmt, add hard start time for binance to reduce sync execution time 2021-04-21 19:50:33 +09:00
c9s
34fe915a9f fix sync issue for pnl command 2021-04-09 12:43:13 +08:00
c9s
d315c12f2d call environ.Init to setup sessions 2021-04-09 00:46:36 +08:00
ycdesu
e152aa1036 ftx: trade update 2021-03-29 22:11:39 +08:00
ycdesu
f60f1ef52e ftx: authenticate websocket 2021-03-27 18:16:52 +08:00
ycdesu
24254a869d ftx: invoke SetPublicOnly in orderbook command 2021-03-27 17:37:16 +08:00
ycdesu
9e77b3afd8 ftx: support queryTrades method 2021-03-26 00:43:15 +08:00
YC
80e5144950 Merge pull request #184 from c9s/ftx/add-missing-query-string 2021-03-24 16:26:33 +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
29f77c2176 add environ.DatabaseService nil check for backtest 2021-03-22 22:48:43 +08:00
c9s
6c8babfb27 allow public session 2021-03-22 17:40:17 +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
c30a026243 ftx: support market cmd 2021-03-21 13:06:46 +08:00
c9s
814a77ea39 xmaker: improve balance checking 2021-03-21 12:55:33 +08:00
ycdesu
a7bdcdff38 fix: fix placeorder cmd 2021-03-19 10:07:39 +08:00
ycdesu
8a75b21a38 ftx: support account info 2021-03-18 23:53:55 +08:00
Larry850806
28f4584191 Use empty config if config file doesn't exist 2021-03-18 10:04:41 +08:00
Larry850806
4dc478590f Remove configuring database in balances cmd 2021-03-17 14:35:00 +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
714d61a829 add grid restore behavior 2021-03-16 20:04:06 +08:00
ycdesu
c08899f7fb ftx: add ftx to supported exchange 2021-03-15 20:40:04 +08:00
c9s
7b7811bbc3 revise orderbook command options 2021-03-15 10:23:53 +08:00
c9s
97d427a9ca add ftx into the standard exchange factory 2021-03-15 10:22:45 +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
4b49fda463 refactor sync service 2021-03-14 11:18:22 +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