Commit Graph

210 Commits

Author SHA1 Message Date
c9s
eaad414706 adjust max api call rate limiting 2021-02-22 15:01:05 +08:00
c9s
a8516edb98 add Get method to the persistence service facade 2021-02-21 16:55:45 +08:00
c9s
fa4e813729 resolve cyclic imports 2021-02-21 01:01:39 +08:00
c9s
12ed5a1efe move persistence service into the service package 2021-02-21 00:45:56 +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
3a89b0a714 improve trade sync 2021-02-18 18:20:18 +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
b9564690b5 fix go migration loader 2021-02-17 19:06:55 +08:00
c9s
bc3754d989 check if limit is set 2021-02-16 16:39:56 +08:00
c9s
bf0ba89aee convert StrategyID field to NullString 2021-02-16 16:00:14 +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
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
72044a63fd remove query trades default limit 200 2021-02-08 13:40:47 +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
c9s
8e0778a095 fix trading volume query for sqlite3 2021-02-06 16:05:21 +08:00
Yo-An Lin
597dd21865 Merge pull request #116 from c9s/feature/sqlite3
convert time struct for sqlite driver
2021-02-06 15:05:49 +08:00
c9s
26f9e5488d apply datatype.Time to order time fields 2021-02-06 14:30:00 +08:00
c9s
3abdb3dd7b convert time struct for sqlite driver 2021-02-06 12:32:21 +08:00
Yo-An Lin
5a5e64cc8d Merge pull request #111 from c9s/feature/sqlite3
add sqlite3 migration support
2021-02-06 11:52:03 +08:00
c9s
32117af4b0 service: remove the ignore keyword to make the sql compatible with sqlite3 2021-02-06 11:44:49 +08:00
c9s
dd9dbee903 refactor database configuration with env vars 2021-02-06 11:33:49 +08:00
c9s
de51eb29e4 refactor db stuff with database service 2021-02-06 11:22:04 +08:00
Jui-Nan Lin
8eb8fb105d test: fix query trading test 2021-02-05 12:42:59 +08:00
Jui-Nan Lin
893b513605 feat: add limit option for pnl command 2021-02-05 10:12:10 +08:00
YC
d821d2ef95 Merge pull request #103 from ycdesu/minor/order/tests 2021-02-03 18:52:11 +08:00
ycdesu
72b1877e4a order: extract query order sql generator 2021-02-03 18:31:32 +08:00
ycdesu
220da92f48 trade: extract sql generator function and test it 2021-02-03 16:51:02 +08:00
ycdesu
1522c3d7a6 trade: create a separate sql gen function 2021-02-03 15:44:02 +08:00
c9s
fbbe304dfb add trades query api 2021-01-29 18:48:00 +08:00
c9s
cc8133a90e print order query sql 2021-01-29 18:34:03 +08:00
c9s
b8d7ae7687 add AggOrder for market orders 2021-01-29 17:52:13 +08:00
c9s
32645f228b add order query api 2021-01-29 13:15:44 +08:00
c9s
78890834b5 support symbol segment 2021-01-28 18:51:35 +08:00
c9s
df17c4b1b6 add trading volume query api 2021-01-26 17:21:18 +08:00
c9s
c79c7d1b11 fix margin order/trade sync 2021-01-20 02:09:12 +08:00
c9s
334eff4682 update sync service for margin fields 2021-01-19 23:33:06 +08:00
c9s
0bdfd0f04b check if err is nil 2021-01-18 21:59:02 +08:00
c9s
ddc33f633f check if err is nil 2021-01-18 21:57:57 +08:00
c9s
321b4812ca supporting otp key restore from key url 2020-12-11 17:12:16 +08:00
c9s
45bc4dc9eb refactor telegram notifier with interaction component 2020-12-11 14:40:04 +08:00
c9s
0a5bac803c ignore duplicated trade 2020-12-03 08:51:57 +08:00
c9s
04f6da3cb8 add traditional grid strategy 2020-11-10 19:06:20 +08:00
c9s
6bd3573287 add exchange field in the table so that we can reuse the kline objects for backtest 2020-11-08 12:13:34 +08:00
c9s
f1db12eb10 add done channel for backtest exchange 2020-11-07 20:11:07 +08:00
c9s
22a214328d implement backtest command, stream and add backtest config 2020-11-07 02:57:50 +08:00
c9s
8823a39fc2 support backtesting kline verification 2020-11-07 00:49:17 +08:00
c9s
555fe57341 implement kline sync function from command 2020-11-06 21:40:48 +08:00
c9s
f78fefb3b0 implement QueryCh on kline service 2020-11-06 20:58:45 +08:00
c9s
78d7c71ecc add kline service and extend kline struct fields 2020-11-06 19:07:07 +08:00
c9s
7e47f754c5 use channel to sync trades 2020-11-05 13:35:04 +08:00
c9s
7fab2e24de improve order persistence and support order data sync 2020-11-05 11:14:14 +08:00
c9s
fe16f9aa4d add is_working column 2020-11-05 11:14:14 +08:00
c9s
bb0ff263c8 assign order_id to the trade object 2020-11-05 11:14:14 +08:00
c9s
3d5507a053 move files into pkg 2020-10-11 16:46:15 +08:00