Commit Graph

502 Commits

Author SHA1 Message Date
Andy Cheng
8f18b414b6 optimizer: move klines to shared/ 2022-06-13 13:14:39 +08:00
Andy Cheng
70d6d8f5db optimizer: share klines in report 2022-06-13 12:26:47 +08:00
c9s
f8dbd26736
move cpu profile option to global cmd 2022-06-09 15:49:52 +08:00
c9s
854661bc71
backtest: move info log suppress after sync 2022-06-08 15:15:57 +08:00
c9s
99bf914415
add warning logs to pnl cmd 2022-06-08 15:10:43 +08:00
c9s
8c6331073d
cmd: fix pnl cmd 2022-06-08 15:10:43 +08:00
c9s
e023d0be5b
service: rewrite kline sync check 2022-06-08 15:10:43 +08:00
c9s
fc8d3ea59f
register dca strategy to builtin 2022-06-07 20:26:56 +08:00
Andy Cheng
34465fac89
Merge pull request #653 from andycheng123/strategy/supertrend
strategy: add supertrend strategy
2022-06-07 16:25:49 +08:00
Yo-An Lin
16e9535b8c
Merge pull request #638 from austin362667/strategy/f1
strategy: add fmaker
2022-06-07 12:24:26 +08:00
c9s
53e74b6262
fix timezone issue for sqlite and mysql 2022-06-07 00:48:13 +08:00
c9s
022775d0a2
service: use batch insert for kline 2022-06-06 17:21:31 +08:00
c9s
dae4afec10
fix verify() time range 2022-06-06 14:58:26 +08:00
c9s
f65b343ea6
service: clean up Verify method signature 2022-06-06 06:24:25 +08:00
c9s
39fcf1a51b
refactor sync command and add integration tests 2022-06-05 01:01:59 +08:00
c9s
9083881442
refactor exchange factory and solve the incorrect pkg import dependency from ftx 2022-06-04 11:47:55 +08:00
c9s
a7bd9239f2
fix: pull out time.now variable 2022-06-02 21:27:28 +08:00
c9s
991d13cb32
cmd/sync: support multiple session names 2022-06-01 19:40:29 +08:00
c9s
63ad635f62
cmd: rewrite sync command 2022-06-01 19:40:29 +08:00
austin362667
c904f9f0f7 strategy: add fmaker
fmaker: cleanup
2022-05-29 21:39:11 +08:00
c9s
11075b0d1a
cmd: add marginInterestsCmd 2022-05-29 12:01:20 +08:00
c9s
4a4699a4bc
cmd: add margin repays cmd 2022-05-29 11:53:36 +08:00
c9s
70f0dccb9f
binance: convert loans and repays to global types 2022-05-29 11:52:25 +08:00
Andy Cheng
bf26076112 strategy: prototype of supertrend strategy 2022-05-27 14:36:48 +08:00
c9s
b8eb036556
simplify ftx kline sync call 2022-05-20 14:06:37 +08:00
c9s
b9b2b8727a
avoid emitting duplicated kline 2022-05-20 13:37:28 +08:00
c9s
b61af0db39
optimizer: add metrics label 2022-05-20 01:53:51 +08:00
c9s
95c9fe4502
return metrics as a optimizer result 2022-05-20 01:42:32 +08:00
c9s
369afa8ab1
merge used intervals 2022-05-20 00:50:58 +08:00
c9s
590748b71d
tsv writer already flush the content before close handle 2022-05-20 00:37:29 +08:00
c9s
b3da6caddb
optimizer: fix op builder 2022-05-19 20:31:25 +08:00
c9s
960f967c34
aggregate total profit and total unrealized profit 2022-05-19 18:45:45 +08:00
c9s
7056853ecd
implement grid optimizer and local process executor 2022-05-19 18:23:12 +08:00
c9s
32ce36fda7
implement json patch for optimizer 2022-05-19 17:27:59 +08:00
c9s
13bf5d69a3
use types.Interval instead of string 2022-05-19 10:04:03 +08:00
Yo-An Lin
e57c39e665
Merge pull request #605 from c9s/feature/backtest-report
feature: add web-based back-test report
2022-05-18 02:21:55 +08:00
c9s
f3f6e4e68b
collect symbols 2022-05-18 02:05:57 +08:00
c9s
7dffccb3bf
clean up unused code 2022-05-18 00:50:14 +08:00
c9s
b51d6b4ba1
refactor report structure and rewrite manifest paths 2022-05-17 22:59:34 +08:00
c9s
620e465bcf
refactor symbol report 2022-05-17 22:31:50 +08:00
austin362667
8ab696deaa pivotshort: rename strategy & fix pivot indicator 2022-05-17 19:18:21 +08:00
austin362667
04ae49263d cmd: add built-in pivot strategy 2022-05-17 19:18:21 +08:00
c9s
b5f9f86944
define DefaultBacktestAccount 2022-05-17 18:45:06 +08:00
c9s
6acd426f07
refactor backtest report index function 2022-05-17 18:25:05 +08:00
c9s
1cc4c69c66
move and refactor functions 2022-05-17 18:23:09 +08:00
c9s
6c0165afe4
add report index file 2022-05-17 18:10:37 +08:00
c9s
f99e874072
add tsv writer 2022-05-17 01:33:43 +08:00
c9s
e950ee9559
add wall strategy 2022-05-12 22:51:39 +08:00
c9s
0ae8c295e2
refactor csv writer 2022-05-11 14:58:52 +08:00
c9s
e947a05cbd
add defer close 2022-05-11 14:37:45 +08:00
c9s
479de002a6
record equity curve 2022-05-11 14:36:18 +08:00
c9s
11d0823782
cmd: refactor back-test command 2022-05-11 13:59:44 +08:00
c9s
6e1f9d6a4e
add backtest exchange to the kline handler function 2022-05-10 19:10:16 +08:00
c9s
5f68064ac6
pull out writeJsonFile function 2022-05-10 18:27:23 +08:00
c9s
6fbb082d5f
support manifest json encoding in backtest report 2022-05-10 14:05:44 +08:00
c9s
7b17b1a757
integrate state recorder 2022-05-10 13:31:23 +08:00
c9s
2ddff59de6
add report header 2022-05-10 01:10:36 +08:00
c9s
f4991dbbfa
fix time printing 2022-05-10 01:09:40 +08:00
c9s
f6d95a49be
print start time and end time 2022-05-10 01:07:30 +08:00
c9s
5b443f0aeb
add start time and end time to the report struct 2022-05-10 01:06:16 +08:00
c9s
6965baa8dd
cmd: add directory error checking 2022-05-09 19:40:49 +08:00
c9s
bff73a3a80
format backtest report session name 2022-05-09 19:27:02 +08:00
c9s
428e208120
cmd: add backtest --session option to make it backward compatible 2022-05-09 19:14:24 +08:00
c9s
0780dafdc3
add IsBackTesting method for checking environment mode 2022-05-09 18:58:09 +08:00
c9s
234932bc0c
add kline dumper 2022-05-09 18:03:03 +08:00
c9s
6f16f32e16
optimize single exchange back-test 2022-05-09 17:03:01 +08:00
zenix
c81af9ce91 fix: binance futures sync issue 2022-05-09 15:04:51 +09:00
c9s
7378c63cb7
cmd: call SaveState and LoadState for normal run 2022-05-05 14:28:42 +08:00
Yo-An Lin
9c08bea065
Fix accounts field 2022-05-03 17:32:10 +08:00
c9s
f2edd24029
add --sync-exchange option to override backtest sync exchanges 2022-05-03 12:12:39 +08:00
c9s
18da434e92 all: use thread-safe GetAccount method to get account 2022-04-23 15:43:11 +08:00
c9s
fd247cf7d7 cmd: add autoborrow to built-in 2022-04-23 15:00:53 +08:00
austin362667
da51d56624 cmd: add built-in factorzoo strategy 2022-04-20 18:10:27 +08:00
zenix
6f04789111 fix: rename packae name 2022-04-14 20:01:13 +09:00
zenix
42a3737f2e fix: use series in ewo to predict values 2022-04-13 21:10:07 +09:00
c9s
12ce854150 grpc: integrate market trade 2022-04-13 11:53:09 +08:00
zenix
d0c3390f84 fix log message to be lowercases 2022-04-11 17:04:56 +09:00
zenix
fac61f27dc feature: add pinescript series interface 2022-04-11 17:04:56 +09:00
c9s
830503941e cmd: fix backtest sync 2022-04-10 00:57:55 +08:00
c9s
e51fb641af backtest: show symbols 2022-04-10 00:57:55 +08:00
Yo-An Lin
4cd646e346
feature: basic grpc server (#514) 2022-04-08 19:21:57 +08:00
Yo-An Lin
fae4f181b5
Merge pull request #485 from zenixls2/feature/backtest_sig
feature: add CancelOrders and CancelOrdersTo to executor
2022-03-16 21:22:32 +08:00
zenix
77a88aabe4 feature: add CancelOrders and CancelOrdersTo to executor 2022-03-16 21:38:09 +09:00
c9s
ed94b8a8d8 remove config flag constraint 2022-03-16 13:52:46 +08:00
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