Commit Graph

211 Commits

Author SHA1 Message Date
c9s
3a37154737
pivotshort: fix supportTakeProfit binding 2022-07-04 02:20:15 +08:00
c9s
81f9639c85
pivotshort: bind supportTakeProfit method 2022-07-03 17:22:29 +08:00
c9s
278fbb7b51
pivotshort: fix support take profit method 2022-07-03 17:13:01 +08:00
c9s
74cac6e977
pivotshort: adjust layer price calculation 2022-07-03 15:44:37 +08:00
c9s
a408b20eda
fix resistance price calculation 2022-07-03 15:26:05 +08:00
c9s
1e8ac0d08a
pivotshort: improve price grouping 2022-07-02 18:51:17 +08:00
c9s
f940bb8e0a
implement SupportTakeProfit method 2022-07-02 13:21:27 +08:00
c9s
004e6b0e0b
pivotshort: fix findNextResistancePriceAndPlaceOrders 2022-07-02 00:28:41 +08:00
c9s
f1867b02c3
pivotshort: fix message 2022-07-01 18:10:39 +08:00
c9s
9a11fd59ed
pivotshort: fix open close price compare 2022-07-01 17:43:51 +08:00
c9s
04df515aea
pivotshort: clean up and force kline direction 2022-07-01 17:26:45 +08:00
c9s
9374125712
pivotshort: pull out break low logics
Signed-off-by: c9s <yoanlin93@gmail.com>
2022-07-01 17:22:09 +08:00
c9s
7f5e92d1b5
cancel order when shutdown 2022-07-01 16:29:03 +08:00
c9s
c792da2164
pivotshort: improve balance check for margin 2022-07-01 15:41:50 +08:00
c9s
09ba2d31c3
pivortshort: run placeResistanceOrders with margin borrow buy 2022-07-01 15:34:21 +08:00
c9s
1af18a5fac
pivotshort: fix breakLow handle event 2022-07-01 15:30:06 +08:00
c9s
503d851c9d
pivotshort: move resistance short to a single file 2022-07-01 01:24:34 +08:00
c9s
454036b166
use types.KLineWith to wrap callbacks 2022-07-01 01:06:10 +08:00
c9s
a4af4776d2
pivotshort: use active orderbook to maintain the resistance orders 2022-07-01 00:57:19 +08:00
c9s
3e6b975c2c
pivotshort: refactor ResistanceShort entry method 2022-06-30 18:29:02 +08:00
c9s
b15e8d0ce4
all: refactor exit method set and fix dynamic call/merge
Signed-off-by: c9s <yoanlin93@gmail.com>
2022-06-30 15:49:18 +08:00
c9s
527070d13d
all: rewrite and clean up graceful shutdown api 2022-06-30 15:49:18 +08:00
c9s
7d5474e3dd
pivotshort: call MergeStructValues to update the field value 2022-06-30 15:49:18 +08:00
c9s
ab3341d5ae
pivotshort: make preload pivot as a pure function 2022-06-30 15:49:17 +08:00
c9s
9733eec280
pivotshort: move pure funcs to the bottom 2022-06-30 15:49:17 +08:00
c9s
38767cd2df
move private methods to the bottom 2022-06-30 15:49:17 +08:00
c9s
ee45f154a1
pivotshort: rename bounce short to resistance short 2022-06-30 15:49:17 +08:00
c9s
4bb2e4a25f
fix stopEMA range check 2022-06-29 16:59:50 +08:00
c9s
cb1c5634a2
pivotshort: remove redundant notification 2022-06-29 15:14:24 +08:00
c9s
38920dfc7a
pivotshort: fix kline history loading 2022-06-29 11:23:05 +08:00
c9s
16f2a06b1f
all: move exit methods to the bbgo core
Signed-off-by: c9s <yoanlin93@gmail.com>
2022-06-29 01:58:15 +08:00
c9s
cfc4fd1f81
add doc for CumulatedVolumeTakeProfit 2022-06-29 01:39:33 +08:00
c9s
3d4f765678
rename protectionStopLoss to protectiveStopLoss 2022-06-29 01:31:56 +08:00
c9s
37413e4355 pivotshort: fix bounce ratio calculation 2022-06-28 23:47:34 +08:00
c9s
1617005114 pivotshort: fix pivotshort trigger condition 2022-06-28 23:47:34 +08:00
c9s
34900776f6
pivotshort: reformat code 2022-06-27 19:54:58 +08:00
c9s
10d5a8a4f2
backtest: fix stop limit order matching
Signed-off-by: c9s <yoanlin93@gmail.com>
2022-06-27 19:48:14 +08:00
c9s
2784408b8b
add submit order tag 2022-06-27 18:17:57 +08:00
c9s
b97ec7bb1e
pivotshort: remove unused struct 2022-06-27 18:14:12 +08:00
c9s
1557423229
pivotshort: improve useQuantityOrBaseBalance and add bounce short check 2022-06-26 19:45:37 +08:00
c9s
4d862a4286
pivotshort: remove market trade debug 2022-06-26 19:29:01 +08:00
c9s
e1a9df0a2d
pivotshort: add safety check 2022-06-26 19:20:46 +08:00
c9s
3604bae933
pivotshort: pull out stop price check to a single method 2022-06-26 19:06:16 +08:00
c9s
ef31e90728
pivotshort: clean up
Signed-off-by: c9s <yoanlin93@gmail.com>
2022-06-26 16:32:48 +08:00
c9s
e9b87f6f1e
pivotshort: refactor exit methods
Signed-off-by: c9s <yoanlin93@gmail.com>
2022-06-26 16:31:48 +08:00
c9s
47677e303f
pivotshort: refactor take profit and stop loss methods
Signed-off-by: c9s <yoanlin93@gmail.com>
2022-06-26 16:13:58 +08:00
c9s
4e670c67a8
pivotshort: change ratio calculation 2022-06-25 18:13:50 +08:00
c9s
09d0a9bbc7
pivotshort: clean up ClosePosition method 2022-06-22 13:46:04 +08:00
c9s
3e5d252c10
rsmaker: clean up and remove unused code
Signed-off-by: c9s <yoanlin93@gmail.com>
2022-06-22 13:46:04 +08:00
c9s
2cd44b194a
pivotshort: remove persistence from pivotshort 2022-06-22 13:46:04 +08:00
c9s
6ef54bf2fb
call bbgo.Sync to sync persistence 2022-06-22 13:46:03 +08:00
Andy Cheng
24844052d2 pivotshort: add strategy controller 2022-06-20 11:39:18 +08:00
c9s
b6d1b4309b
refactor and update the support strategy 2022-06-19 15:57:59 +08:00
c9s
88a63df186
all: clean up notifiability usage 2022-06-19 13:01:22 +08:00
c9s
eacd1f1ae6
all: rewrite notification api
Signed-off-by: c9s <yoanlin93@gmail.com>
2022-06-19 12:29:36 +08:00
c9s
88e83c944c
pivotshort: clean up log 2022-06-19 11:21:07 +08:00
c9s
c80fe1af33
pivotshort: call BindTradeStats 2022-06-18 16:32:53 +08:00
c9s
6cae9e7449
move GeneralOrderExecutor into bbgo package 2022-06-18 16:31:53 +08:00
c9s
d367186f3e
pivotshort: clean up and pull out order executor 2022-06-18 15:27:11 +08:00
c9s
47e76a9eb5
pivotshort: refactor and redesign order executor
Signed-off-by: c9s <yoanlin93@gmail.com>
2022-06-18 12:30:42 +08:00
c9s
0326c34013
pivotshort: pull out GeneralOrderExecutor 2022-06-18 11:45:24 +08:00
c9s
807a3e125c
pivotshort: split trade collector callbacks 2022-06-18 10:54:06 +08:00
zenix
a5ffca7fe8 fix: gosimple alert 2022-06-17 20:19:51 +09:00
c9s
5949c7587e
make bounce short optional 2022-06-11 16:41:56 +08:00
c9s
3d0c0717ba
pivotshort: fix bounce short 2022-06-11 16:33:21 +08:00
c9s
ec68dc2f40
reimplement placeBounceSellOrders 2022-06-11 00:26:44 +08:00
c9s
46450c0122
pivotshort: rename pivotLength to window and update indicator manually 2022-06-10 15:34:57 +08:00
c9s
91b9605884
pivotshort: manually update pivot indicator 2022-06-10 15:18:12 +08:00
c9s
a9d2a9e57a
pivotshort: add breakLow.bounceRatio option 2022-06-10 11:36:04 +08:00
c9s
35a58268cf
pivotshort: add roiMinTakeProfitPercentage option and cumulatedVolume option 2022-06-10 02:39:14 +08:00
c9s
e575236db8
pivotshort: adjust shadow ratio calculation 2022-06-10 01:21:59 +08:00
c9s
260857b5b1
pivotshort: add TradeStats 2022-06-10 00:49:32 +08:00
c9s
a8134561f5
pivotshort: add stopEMA 2022-06-09 18:16:32 +08:00
c9s
aa2ba265f1
pivotshort: refactor and add more fix 2022-06-09 17:36:22 +08:00
c9s
4f9ac6f3fb
pivotshort: move notification message to make log clean 2022-06-09 15:50:43 +08:00
c9s
5a809f60e0
pivotshort: fix order cancel step 2022-06-09 13:26:30 +08:00
c9s
4b08e93758
rename st = store 2022-06-09 12:34:23 +08:00
c9s
e17535e651
pivotshort: fix position close bugs 2022-06-09 12:34:23 +08:00
c9s
1bfc125a52
gracefully cancel order before closing position 2022-06-09 12:34:23 +08:00
c9s
77b704b6ec
move some methods back for refactoring 2022-06-09 12:34:22 +08:00
austin362667
3c40f9e90e
pivotshort: improve market sell when breaks previous pivot low only
pivotshort: improve market sell when breaks previous pivot low only
2022-06-09 12:34:22 +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
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
13bf5d69a3
use types.Interval instead of string 2022-05-19 10:04:03 +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