Commit Graph

768 Commits

Author SHA1 Message Date
zenix
7a045a48d4 fix: drift window in factorzoo, order_execution print order, refactor: use defer to mu.Unlock in depth/buffer.go 2022-06-08 12:14:53 +09:00
zenix
9dd8dbbede feature: add drift indicator, split heikinashi's Queue 2022-06-08 01:21:18 +08:00
c9s
9a29843477
add dca strategy 2022-06-07 20:26:44 +08:00
Andy Cheng
9836fbbf82 strategy: rebase 2022-06-07 16:49:43 +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
Andy Cheng
ee26d6ce34 strategy: Persistence.Sync() after position change 2022-06-07 16:04:40 +08:00
Yo-An Lin
037f2949bd
Merge pull request #678 from andycheng123/fix/interact
interact: fix missing make()
2022-06-07 12:31:53 +08:00
c9s
32837d85a0
fix fmaker 2022-06-07 12:31:06 +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
Andy Cheng
8410b1cc33 interact: update interact test 2022-06-06 17:34:39 +08:00
c9s
b209d94a9c
rename active order book constructor function 2022-06-06 06:57:25 +08:00
c9s
4dafa32e97
strategy: should always handle trade even if the strategy status is not running 2022-06-06 06:56:44 +08:00
c9s
3786fc64f1
rename LocalActiveOrderBook to just ActiveOrderBook 2022-06-06 05:43:38 +08:00
c9s
1e27caa5e2
flashcrash: update local active book usage 2022-06-05 21:45:43 +08:00
c9s
1d340256ea
fix and simplify LocalActiveOrderBook 2022-06-05 18:12:26 +08:00
c9s
016ddfd8cd
pivotshort: also check isClosed 2022-06-05 13:14:17 +08:00
c9s
f883d42c58
pivotshort: avoid market sell again if position is already opened 2022-06-05 13:13:23 +08:00
c9s
629ae39095
fix var comparison 2022-06-05 13:09:32 +08:00
c9s
defff9b01d
pivotshort: add new found return value 2022-06-05 13:04:48 +08:00
c9s
f39ba4854d
pivotshort: add notify 2022-06-05 12:58:12 +08:00
c9s
74ee92832b
pivotshort: rename pivotBuffer to pivotLowPrices 2022-06-05 12:56:40 +08:00
c9s
32f324761e
pivotshort: market sell to open short 2022-06-05 12:55:36 +08:00
c9s
4bd322feb4
pivotshort: use notify and always collect trades 2022-06-05 12:51:45 +08:00
c9s
e7078edacd
pivotshort: add kline event handler and a todo 2022-06-05 12:48:54 +08:00
c9s
b20e1335c2
pivotshort: pull out market sell to a single method 2022-06-05 12:47:15 +08:00
c9s
f0578c5fa2
pivotshort: rename place order method 2022-06-05 12:40:41 +08:00
c9s
46b766857a
pivotshort: always collect trades after submitting orders 2022-06-05 12:40:08 +08:00
c9s
b9c32c7f7e
pivotshort: numLayers should be int 2022-06-05 12:37:35 +08:00
c9s
c20e3fee4b
fix persistence unmarshalling issue 2022-06-05 01:48:56 +08:00
c9s
221a2d9dc7
fix persistence: calling type method on z zero value 2022-06-05 01:09:31 +08:00
austin362667
9b8239abba pivotshort: add symbol name 2022-06-04 02:31:04 +08:00
austin362667
fcdc26e188 pivotshort: add init place order 2022-06-04 02:31:04 +08:00
austin362667
5ca651a9b4 pivotshort: clean up field name 2022-06-03 23:28:48 +08:00
austin362667
af2d88d9a3 pivotshort: add immediate market sell 2022-06-03 23:23:26 +08:00
austin362667
9dab39849b pivotshort: clean up 2022-06-03 16:38:06 +08:00
austin362667
30be15dd34 pivotshort: add repay margin side effect 2022-06-03 15:48:49 +08:00
austin362667
2aac5bb273 pivotshort: improve post order & add margin 2022-06-03 15:48:49 +08:00
c9s
6936503cde
bollmaker: fix profit stats notification 2022-06-03 14:46:45 +08:00
c9s
4fc0687cf9
bollmaker: remove debug code 2022-06-03 03:14:19 +08:00
c9s
68d6e9e850
service: fix state loading (use correct ID method) 2022-06-03 03:10:50 +08:00
c9s
7fce6a0fca
bollmaker: call persistence.Sync when position is changed 2022-06-03 02:44:00 +08:00
c9s
50d7d235a4
bollmaker: pull out functions 2022-06-03 02:44:00 +08:00
c9s
1a85299204
bollmaker: make detectPriceTrend simple function 2022-06-03 02:44:00 +08:00
c9s
d7c8b0b127
autoborrow: render balance map as SlackAttachment 2022-06-02 19:50:39 +08:00
c9s
5277098f70
add api .UnrealizedProfit and .IsDust method on Position 2022-06-02 18:05:35 +08:00
c9s
6a25f30b39
add IsLong and IsShort method on Position 2022-06-02 17:58:18 +08:00
c9s
e2f339e641
bollmaker: fix short position order 2022-06-02 17:55:14 +08:00
Andy Cheng
bf385899b9 strategy: use private for non-exported fields and functions 2022-06-02 13:47:16 +08:00
c9s
5527b3c48a
rename Withdrawal to Withdraw since it's a noun 2022-06-02 11:42:03 +08:00
c9s
f87a0ab316
autoborrow: add json tags 2022-06-02 01:53:22 +08:00
c9s
34e1b642d1
autoborrow: add exchange name to the margin action struct 2022-06-02 01:51:03 +08:00
c9s
4f842c521a
fix log message 2022-06-02 01:47:55 +08:00
c9s
78f9c7d569
improve autoborrow checks 2022-06-02 01:27:04 +08:00
Andy Cheng
205921ea42 strategy: remove HasTradableBase() 2022-06-01 10:54:13 +08:00
Andy Cheng
cd96c01131 strategy: use Market.IsDustQuantity instead 2022-06-01 10:51:57 +08:00
Andy Cheng
237d1205e8 strategy: check update balance response in calculateQuantity 2022-06-01 10:26:04 +08:00
Andy Cheng
6285e145a7 strategy: margin side effect 2022-05-31 15:46:55 +08:00
Andy Cheng
3421423cd6 strategy: update balance for exchanges like FTX 2022-05-31 14:30:37 +08:00
Andy Cheng
a5124c743f strategy: supertrend strategy TP/SL 2022-05-31 12:53:14 +08:00
c9s
f29e8bd6d2
service: use reflect to generate insert sql 2022-05-30 18:08:54 +08:00
Andy Cheng
d72a4e8e94 strategy: supertrend strategy config example 2022-05-30 16:48:07 +08:00
Andy Cheng
756284378b strategy: supertrend strategy control 2022-05-30 16:35:10 +08:00
Andy Cheng
44469ed3aa strategy: supertrend position control 2022-05-30 16:26:17 +08:00
Andy Cheng
07fe68d740 strategy: Validate() 2022-05-30 16:22:13 +08:00
Andy Cheng
0e1e5369f2 strategy: leverage parameter 2022-05-30 16:07:36 +08:00
Andy Cheng
1d24379c17 strategy: refactor supertrend sconfig 2022-05-30 14:52:51 +08:00
Zenix
8652b4e043
Merge pull request #633 from zenixls2/fix/ewo_entry
Fix/ewo entry, backtest
2022-05-30 15:47:46 +09:00
zenix
e3a8ef4e69 fix: statistics on entry/exit on signal changes, fix position check 2022-05-30 12:45:52 +09:00
austin362667
c904f9f0f7 strategy: add fmaker
fmaker: cleanup
2022-05-29 21:39:11 +08:00
Andy Cheng
39b0013513 strategy: supertrend strategy tp/sl 2022-05-27 18:24:08 +08:00
Yo-An Lin
424c235b43
Merge pull request #617 from andycheng123/improve/bollmaker-dynamic-spread
feature: bollmaker dynamic spread
2022-05-27 16:55:20 +08:00
Andy Cheng
98b794f265 strategy: DynamicSpreadSettings struct to make it more clean 2022-05-27 16:24:50 +08:00
Andy Cheng
bf26076112 strategy: prototype of supertrend strategy 2022-05-27 14:36:48 +08:00
なるみ
c99be984d1 rebalance: place limit orders 2022-05-26 17:28:48 +08:00
zenix
e81216e678 fix: TP compare direction in ewo, feature: add trade report fro ewo, fix: db lock on insertion in sqlite3 2022-05-25 16:11:19 +09:00
zenix
99122f44bc fix: backtest kline prev close -> new open, pass exchange as pointer (for Mutex passing), ewo add filter ma34 2022-05-24 23:05:01 +09:00
zenix
dbe0fbcd4c fix: split implementation, fix code comments, add explanation on ewo params 2022-05-24 16:19:00 +09:00
Andy Cheng
944856eb72 strategy: fix typo 2022-05-23 12:58:45 +08:00
Andy Cheng
bb4d6e61b0 strategy: fix typo 2022-05-23 12:06:24 +08:00
Andy Cheng
64b1ec3780 strategy: update calculation of dynamic spread 2022-05-23 11:37:57 +08:00
c9s
13bf5d69a3
use types.Interval instead of string 2022-05-19 10:04:03 +08:00
Andy Cheng
b41cef4bd7 strategy: use scale for dynamic spread 2022-05-18 14:31:59 +08:00
austin362667
bb94d4a1bd pivotshort: clean up strategy 2022-05-17 19:18:21 +08:00
austin362667
62d11181a4 pivotshort: clean up 2022-05-17 19:18:21 +08:00
austin362667
2c4a52ba30 pivot: fix futures & spot clean up
pivot: clean up
2022-05-17 19:18:21 +08:00
austin362667
8ab696deaa pivotshort: rename strategy & fix pivot indicator 2022-05-17 19:18:21 +08:00
austin362667
1a441425b5 strategy: pivot: add shadow TP
strategy: pivot: add shadow TP
2022-05-17 19:18:21 +08:00
austin362667
60a8c1f42b WIP: strategy: pivot: pivot low shorting strategy 2022-05-17 19:18:21 +08:00
Andy Cheng
7d3181f3fd strategy: update dynamic spread after kline being filtered 2022-05-17 19:00:02 +08:00
Andy Cheng
db62352e6e strategy: temp vars for faster calculation 2022-05-17 10:43:18 +08:00
c9s
b4a79479fd
add pkg/strategy/ewoDgtrd/trylock_18.go 2022-05-17 01:33:24 +08:00
c9s
343434685b
rollback to go1.17 and make try lock backward compatible 2022-05-17 01:32:51 +08:00
Zenix
356ec71570
Merge pull request #610 from zenixls2/feature/liveSLTP
feature: SLTP from bookticker. fix: bookTicker typename, depth buffer…
2022-05-16 20:41:15 +09:00
zenix
641d08c3d2 fix: disable book tick log 2022-05-16 20:37:08 +09:00
Andy Cheng
3c094a195b strategy: check min/max spread settings 2022-05-16 12:57:00 +08:00
c9s
d326494d57
set exchange fee to position 2022-05-13 22:30:04 +08:00
zenix
382e6ee0fb fix: error exit on wrong subscription in backtest. NaN issue in stoch indicator. feature: position management in ewo 2022-05-13 22:58:35 +09:00
Andy Cheng
64a760cf32 strategy: dynamic spread for bollmaker 2022-05-13 17:58:46 +08:00
c9s
eac0117e02
add adjustment orders 2022-05-13 13:01:03 +08:00
c9s
e950ee9559
add wall strategy 2022-05-12 22:51:39 +08:00
zenix
2bea47003f feature: add InstanceID for report 2022-05-12 20:02:34 +09:00
zenix
71fe6c2d26 feature: SLTP from bookticker. fix: bookTicker typename, depth buffer error message 2022-05-12 19:43:04 +09:00
zenix
668328dd16 fix: message typo 2022-05-11 21:22:22 +08:00
zenix
51e2343299 fix: add more live logs to ewo 2022-05-11 21:22:22 +08:00
zenix
5fa9e930d3 fix: wrong balance, wrong bottom/peak, feature: stdev 2022-05-11 21:22:22 +08:00
c9s
b11c4c7337
turn off UseTickerPrice when in the back-testing environment 2022-05-09 19:42:39 +08:00
Andy Cheng
c9ba81fcbb strategy: Update bollmaker to support new strategy controller 2022-05-06 16:52:00 +08:00
c9s
82c7c024ce
bbgo: add persistence Sync api 2022-05-05 18:18:38 +08:00
c9s
6635fd749d
xmaker: migrate xmaker persistence 2022-05-05 15:05:38 +08:00
c9s
10a7928580
extract NewProfitStats method 2022-05-05 14:48:50 +08:00
c9s
c3db85443e
bollmaker: add Deprecated note 2022-05-05 14:47:06 +08:00
c9s
3140b7e2ef
bollmaker: remove unnecessary log 2022-05-05 14:41:11 +08:00
c9s
019e6a2a88
improve legacy state handling and move fnv 2022-05-05 14:39:29 +08:00
c9s
21f81dec29
implement reflect-based persistence restore and load 2022-05-05 12:53:48 +08:00
c9s
58e8da914e
bollmaker: migrating state.position to strategy.position 2022-05-05 09:54:50 +08:00
c9s
36c764efa9
refactor balance, asset and remove price cache check 2022-05-04 17:17:09 +08:00
c9s
0e417f6f71
xnav: rename assets to allAssets 2022-05-04 16:21:53 +08:00
c9s
0061a5910b
use the same price time 2022-05-04 16:21:53 +08:00
c9s
754d10c3d0
use interval instead of duration 2022-05-04 16:21:53 +08:00
c9s
d78e0c607a
xnav: pass session to the record assets method call 2022-05-04 16:21:53 +08:00
c9s
5cd7e61006
xnav: support asset recording 2022-05-04 14:23:46 +08:00
zenix
4eab82ee7b feature: add atr stoploss on ewoDgtrd strategy. remove callback. modify filter condition and add doc 2022-04-28 20:09:15 +09:00
Andy Cheng
7326a1b21d strategy: fix wrong string formatting syntax 2022-04-26 18:29:22 +08:00
Andy Cheng
7b3e369766 feature: use LocalActiveOrderBook for cancelling open orders for strategy controller in support strategy 2022-04-26 18:29:22 +08:00
Andy Cheng
26a5114182 feature: adapt callbackgen style strategy controller in support strategy 2022-04-26 18:29:22 +08:00
Andy Cheng
cf8603e30b feature: use NewFromFloat 2022-04-26 18:29:22 +08:00
Andy Cheng
324c7ea432 feature: logging with strategy symbol 2022-04-26 18:29:22 +08:00
Andy Cheng
389752161d feature: adapt new strategy controller in support strategy 2022-04-26 18:29:21 +08:00
Andy Cheng
57fdc9b120 feature: adapt new strategy controller in support strategy 2022-04-26 18:29:21 +08:00
c9s
109fdd6511
aggregate totalBorrowed 2022-04-26 16:13:07 +08:00
c9s
16227cea2f
autoborrow: call tryToRepayAnyDebt when margin level is low 2022-04-26 15:44:13 +08:00
c9s
b97588f153
autoborrow: fix max total borrow condition 2022-04-26 15:33:01 +08:00
c9s
069db1d0cb
replace margin ratio with margin level 2022-04-25 19:15:47 +08:00
c9s
333378a52a
autoborrow: change debugf to infof 2022-04-25 19:10:22 +08:00
c9s
7b2398ce39
autoborrow: use margin level instead of margin ratio 2022-04-25 19:05:16 +08:00
c9s
638d839975
autoborrow: add more logs and warning color for slack message 2022-04-25 18:46:23 +08:00
c9s
a30aac6653
autoborrow: add slack notification 2022-04-25 18:12:08 +08:00
c9s
2290d132b1
autoborrow: assign s.ExchangeSession 2022-04-25 17:54:16 +08:00
c9s
a2553ee020
autoborrow: call check and borrow 2022-04-25 17:45:16 +08:00
c9s
18da434e92 all: use thread-safe GetAccount method to get account 2022-04-23 15:43:11 +08:00
c9s
5c2274c55c put sign check back 2022-04-23 15:27:28 +08:00
c9s
7b66d36f15 autoborrow: remove extra sign check 2022-04-23 15:27:28 +08:00
c9s
743ad0455f add autoborrow strategy 2022-04-23 15:27:28 +08:00
c9s
c70317af2b add autoborrow strategy 2022-04-23 15:00:04 +08:00
austin362667
1163b89807 factorzoo: fix correlation 2022-04-20 18:10:27 +08:00
austin362667
71a032a29b factorzoo: clean up
factorzoo: clean up

factorzoo: clean up
2022-04-20 18:10:27 +08:00
austin362667
fdbb2be45c factorzoo: add cross-sectional factors model strategy 2022-04-20 18:10:27 +08:00
austin362667
a1fa23121d factorzoo: add correlation indicator 2022-04-20 18:10:27 +08:00
zenix
2a942eab0e fix: rename EVWMP to VWEMP, fix backtesting fee 2022-04-15 19:12:11 +09:00
Yo-An Lin
d6755d7ca0
Merge pull request #512 from zenixls2/feature/elliott_wave
strategy: elliott wave oscillator
2022-04-15 15:53:24 +08:00