Commit Graph

197 Commits

Author SHA1 Message Date
c9s
57bc65a729 avoid calling EmitConnect and EmitStart outside of the kline feeding goroutine
this causes 2 goroutine running in the same time hence cause the
concurrent map read / write

should fix #399, #401
2021-12-25 21:05:50 +08:00
c9s
49e516b80e backtest: allocate public exchange (with empty key secret) for backtesting 2021-12-24 00:24:19 +08:00
c9s
a3e3e1d177 bbgo: do not sync trades when running backtest 2021-12-23 23:20:35 +08:00
austin362667
f9cf71cef3 indicator: add kline close volatility
indicator: add kline close volatility
2021-12-19 14:20:09 +08:00
TonyQ
c0b9cc0f0b exchange: make ftx kline event more reliable 2021-12-15 11:23:07 +08:00
TonyQ
51e23b6a0c Merge branch 'main' of github.com:c9s/bbgo into feature/302-record-assets-review 2021-12-14 10:39:51 +08:00
TonyQ
4eb5a099ae account: add nav_history_details and account_service for #302 2021-12-14 08:09:18 +08:00
austin362667
36c6d39612 bbgo: add session Futures & types: add FuturesExchange 2021-12-13 23:16:58 +08:00
austin362667
1703fff8b2 types: refactor Position and related files 2021-12-11 19:16:16 +08:00
c9s
d52edce40b fix markets info cache 2021-12-08 17:26:43 +08:00
c9s
ca3f438288 show symbol name in the error message 2021-12-07 14:35:00 +08:00
c9s
0472b7f21e avoid recording trades in backtest by default
introducing a RecordTrades option
2021-12-06 01:42:53 +08:00
c9s
513a799ced fix ewma calculation 2021-11-22 02:14:44 +08:00
c9s
d763a3c415 bbgo: add debug ewma and sma 2021-10-18 17:26:03 +08:00
c9s
30b82390b7 bbgo: add EMA and SMA debug var 2021-10-18 15:23:22 +08:00
c9s
30c7c34826 bbgo: fix kline backward query for backtest 2021-10-16 13:49:00 +08:00
c9s
47e4847034 fix kline query endtime 2021-10-14 14:21:38 +08:00
c9s
44a0b10240 bbgo: load last price from 1m interval kline only 2021-10-14 00:37:40 +08:00
c9s
e23c459697 bbgo: move orderbook to the session level so that we can access it eaiser 2021-06-16 13:04:23 +08:00
c9s
2614b25de3 types: move fiat currency list to types 2021-06-16 13:04:23 +08:00
c9s
c84d59734c clear all trades before running backtests 2021-05-30 15:25:00 +08:00
c9s
38fd5422ab xmaker: use uncovered position 2021-05-30 14:46:48 +08:00
c9s
7d62a7634b set market data stream to public 2021-05-27 15:11:44 +08:00
c9s
b7c87c7744 core: move market data subscription to market data stream 2021-05-27 15:09:18 +08:00
c9s
45f1a13870 rename Stream field to UserDataStream and add MarketDataStream 2021-05-27 14:45:06 +08:00
zenix
3d2a27fc10 Fix: nil pointer exception in indicator creation, add stoch util func 2021-05-26 00:20:31 +00:00
c9s
e7c718ee15 assign fee rate to position 2021-05-16 17:58:51 +08:00
c9s
0a016cba75 split maker fee and taker fee 2021-05-16 16:50:26 +08:00
c9s
a4381a54a3 add fee rate field 2021-05-16 15:03:36 +08:00
c9s
a49cf531b5 fix cross exchange order executor for the basic risk control 2021-05-12 19:02:09 +08:00
c9s
df11112d64 refactor exchange session initialization 2021-05-12 12:05:54 +08:00
c9s
29b7326f19 add withdrawal property to the exchange session 2021-05-12 12:05:54 +08:00
c9s
d01abffde3 add todo for the backtest trades 2021-05-08 01:09:06 +08:00
c9s
494a270c54 insert trades to db only when backtest service is nil 2021-05-07 01:50:38 +08:00
c9s
584a4c2ef8 move fiat currency definition out 2021-05-07 01:30:09 +08:00
c9s
50db944053 fix initSymbol stages 2021-05-02 23:58:34 +08:00
c9s
822a010932 add moving average configuration to the schedule strategy 2021-05-02 20:58:32 +08:00
c9s
9f77236999 fix and improve position accessor 2021-04-28 19:32:49 +08:00
c9s
34fe915a9f fix sync issue for pnl command 2021-04-09 12:43:13 +08:00
c9s
088b22f338 support bbgo-no-cache option 2021-03-22 17:32:21 +08:00
c9s
2eda012f43 add SubAccount field to the exchange session config 2021-03-15 10:13:41 +08:00
c9s
5a7cf05701 integrate reward service into the sync service 2021-02-23 16:39:48 +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
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
c219dc7be0 add test code for testing migration scripts 2021-02-15 21:04:44 +08:00
c9s
f8378957ee add more checks for bollgrid
related to #93
2021-02-13 16:03:31 +08:00
c9s
57435419b4 add marketData label 2021-02-10 22:40:36 +08: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
c9s
098a966813 add test case for config.Map method 2021-02-03 09:34:53 +08:00
c9s
8aa96c4546 integrate strateg adding api 2021-02-03 02:26:41 +08:00
c9s
17d5e301dc refine setup steps 2021-02-02 17:26:35 +08:00
c9s
a60aeb4771 pull out .Subscribe from trader.Run 2021-02-01 20:44:15 +08:00
c9s
ddcc8ae4ee move ExchangeOrderExecutor into exchange session 2021-02-01 20:44:15 +08:00
c9s
de8e717a41 refactor session initialization function 2021-02-01 20:44:15 +08:00
c9s
95129e94d7 add lastPrcieUpdatedAt timestamp for checking last price cache 2021-01-26 17:23:40 +08:00
c9s
df17c4b1b6 add trading volume query api 2021-01-26 17:21:18 +08:00
c9s
09b3046feb lower case fields are not exported to json 2021-01-25 14:32:46 +08:00
c9s
42b66d6898 add OrderStore accessor on ExchangeSession 2021-01-24 19:08:12 +08:00
c9s
eccc2c6e0f implement session config api and server 2021-01-24 18:42:36 +08:00
c9s
1892d03326 make session trades map thread safe 2021-01-24 14:14:25 +08:00
c9s
84b6982033 add order store to exchange session 2021-01-24 14:14:25 +08:00
c9s
0051dbc78a add Position accessor 2021-01-20 16:29:15 +08:00
c9s
079fcf08e3 initialize position map 2021-01-20 16:28:27 +08:00
c9s
d3f6841a27 improve sync command for margin trades and orders 2021-01-20 01:46:17 +08:00
c9s
9223b2ba47 move FormatOrder to ExchangeSession since it depends on Market 2020-12-21 13:47:40 +08:00
c9s
d226ec2e01 change field names to lower case so that we can use shorter name for the accessors 2020-12-02 22:21:13 +08:00
c9s
f4512f031c improve cross exchange strategy mounting behavior and add fixedpoint atomic ops 2020-11-17 08:19:22 +08:00
c9s
0264baa922 refactor and improve bollgrid 2020-11-11 23:18:53 +08:00
c9s
04f6da3cb8 add traditional grid strategy 2020-11-10 19:06:20 +08:00
c9s
ec9b5230aa refactor trade report and move trade reporter to the environment layer 2020-10-31 18:35:48 +08:00
c9s
8867ceb951 initialize Notifiability for exchange session 2020-10-31 18:35:48 +08:00
c9s
dc547aa818 fix BOLL map allocation 2020-10-31 18:29:58 +08:00
c9s
e60127090b add GetBOLL access to standard indicator sets 2020-10-31 18:29:58 +08:00
c9s
d49b2be543 add bollinger indicator 2020-10-29 17:51:20 +08:00
c9s
5f45d18ae2 fix struct composition 2020-10-29 13:08:33 +08:00
c9s
c71f013916 let SMA indicator and EWMA indicator use IntervalWindow type 2020-10-29 07:51:23 +08:00
c9s
33257c591e refactor swing strategy with types IntervalWindow 2020-10-29 07:44:22 +08:00
c9s
6d8ec7894e refactor standard indicator set with store 2020-10-29 07:40:02 +08:00
c9s
67446670ac finalize swing strategy and fix trade reporter issue 2020-10-28 17:48:16 +08:00
c9s
2680ad5072 refactor environment, market data store, injection and add swing strategy 2020-10-28 17:48:16 +08:00
c9s
e2df24f31c support standard indicatorset 2020-10-28 09:43:19 +08:00
c9s
50693ae845 implement ewma and sma 2020-10-28 09:13:57 +08:00
c9s
ea3e9e7d05 add per-session-based trade reporter 2020-10-22 10:54:03 +08:00
c9s
b1a9a66dba assign account and stream when allocating session object 2020-10-21 17:42:37 +08:00
c9s
c1590786e8 integrate orderbook updates to market data store 2020-10-18 20:44:12 +08:00
c9s
75115774f6 rename kline store to market data store back 2020-10-18 20:44:12 +08:00
c9s
f9940a9c2f rename market data store to kline store 2020-10-18 12:32:43 +08:00
c9s
f826bb014a make markets field private 2020-10-18 12:30:13 +08:00
c9s
dab264a4ad add more accessors to exchange session, so that we can make it as an interface 2020-10-18 12:29:38 +08:00
c9s
168cb355fc add accessor to MarketDataStore 2020-10-18 12:27:11 +08:00
c9s
028aef9402 move marketdata store to store package 2020-10-18 12:23:00 +08:00
c9s
73e17730d7 move account type into types package 2020-10-18 11:30:37 +08:00
c9s
9ebccc72ba add exchange session constructor 2020-10-17 23:51:44 +08:00
c9s
ee86a71ebb split files 2020-10-16 10:14:36 +08:00