Commit Graph

1176 Commits

Author SHA1 Message Date
Andy Cheng
d350806cdc fix/risk: remove balance check in the futures part of CalculateBaseQuantity() 2022-10-17 12:07:58 +08:00
austin362667
763bb45842 interval: avoid syncing 1s klines as default from backtest config syncSecKLines 2022-10-14 23:14:30 +08:00
c9s
7204e2550b
pull out shutdown timeout context 2022-10-11 14:23:02 +08:00
Andy Cheng
5ad247c8fe fix/order-executor: check for short position 2022-10-07 13:28:24 +08:00
Andy Cheng
7a80b90dac fix/order-executor: ClosePosition() works on futures position 2022-10-07 13:06:32 +08:00
c9s
e92219194f
bbgo: configure persistence facade into the isolation context 2022-10-05 18:48:12 +08:00
c9s
673304bcf1
bbgo: refactor ConfigurePersistence 2022-10-05 18:46:26 +08:00
c9s
4caa457fbe
bbgo: pull out ConfigurePersistence method to simple function 2022-10-05 18:42:55 +08:00
c9s
a8d9911e36
bbgo: refactor isolation and add more tests 2022-10-04 17:23:43 +08:00
c9s
2b953ad2d1
bbgo: make PersistenceServiceFacade private 2022-10-03 18:46:02 +08:00
c9s
8a50474ad1
all: add context parameter to Sync() 2022-10-03 18:45:24 +08:00
c9s
ce318fff3b
add persistenceServiceFacade to isolation 2022-10-03 18:40:49 +08:00
c9s
60956e0157
bbgo: add NewContextWithDefaultIsolation 2022-10-03 18:39:45 +08:00
c9s
198683d141
bbgo: add NewContextWithIsolation function 2022-10-03 18:39:07 +08:00
c9s
f7e76c0518
all: remove bbgo.Persistence 2022-10-03 18:37:53 +08:00
c9s
4a37273065
bbgo: remove Persistence injection 2022-10-03 16:31:04 +08:00
c9s
315f7da8f4
bbgo: remove context suffix from the isolation struct 2022-10-03 16:22:41 +08:00
c9s
59287b5116
all: support context isolation 2022-10-03 16:01:08 +08:00
c9s
a940e88016
add IsolationContext 2022-10-03 15:33:46 +08:00
c9s
77ca1a9c75
bbgo: register onShutdown from the trader 2022-10-03 15:33:46 +08:00
c9s
76b0f5518d
bbgo: let trader handles the shutdown handlers 2022-10-03 15:33:46 +08:00
zenix
58736b1b2d refactor: extract stoploss, fix highest/lowest in trailingExit 2022-09-29 20:15:10 +09:00
zenix
5086af2886 fix: reduce Quantity precheck, drift condition, ewo refactor 2022-09-28 20:06:37 +09:00
c9s
bfc4cc0db1
bbgo: check options.price when limit order taker ratio is given 2022-09-24 01:27:28 +08:00
c9s
14c941c9f3
bbgo: add submitOrder retry limit 2022-09-24 01:25:28 +08:00
c9s
90303b38e2
remove unused NotifyFunc 2022-09-24 01:15:18 +08:00
zenix
fdbcaef2ca fix: use ZeroAssetError, refactor 2022-09-22 20:26:18 +09:00
zenix
ac2f7decdf fix: dup naming, remove Leverage from drift field 2022-09-22 13:48:01 +09:00
zenix
fd875c7060 fix: add series.filter, fix fixedpoint.Four, fix modifiable for embedded fields, change drift to use openPosition, modify openPosition behavior 2022-09-22 13:01:26 +09:00
Yo-An Lin
17b5e3566a
Merge pull request #960 from c9s/refactor/notification
improve: improve the existing notification switch settings
2022-09-20 12:25:06 +08:00
Yo-An Lin
1086845522
Merge pull request #961 from frin1/fix/exit_protective_stop_loss-repay
Feature: Add auto-repay to exit_protective_stop_loss
2022-09-20 12:04:24 +08:00
Fredrik
2dfa27d934 Add auto-repay 2022-09-19 21:39:13 +02:00
c9s
4387b078c0
bbgo: add basic notification switch 2022-09-19 19:28:29 +08:00
c9s
75b61ea285
bbgo: add NotificationSwitches 2022-09-19 19:25:18 +08:00
c9s
b067d67eab
bbgo: drop legacy notification routing 2022-09-19 19:22:08 +08:00
Yo-An Lin
29376defa3
Merge pull request #958 from c9s/strategy/pivotshort
WIP: strategy/pivotshort: more improvements
2022-09-19 17:27:31 +08:00
c9s
c8f5bf8b08
bbgo: check e.session.Margin flag 2022-09-19 16:00:12 +08:00
c9s
b3ae4929be
bbgo: make the max borrowing error message clear 2022-09-19 14:56:13 +08:00
Yo-An Lin
cddc70fb0d
Merge pull request #957 from c9s/fix/submit-order-notify
bbgo: remove submitOrder notification
2022-09-19 14:23:38 +08:00
c9s
1c23881da9
bbgo: check closing flag to avoid double closing 2022-09-19 13:23:23 +08:00
c9s
05defc3aad
bbgo: fix base amount borrow check 2022-09-19 13:12:49 +08:00
c9s
d4398bbbf9
bbgo: add more simple slice types to FilterSimpleArgs 2022-09-19 13:07:56 +08:00
c9s
e48ae215e5
bbgo: remove Notifiability from the order executor 2022-09-19 09:51:48 +08:00
Yo-An Lin
8e8979645d
Merge pull request #956 from c9s/improve/max-borrowable
improve: bbgo: use margin asset borrowable amount to adjust the quantity
2022-09-19 09:47:23 +08:00
c9s
5800eab165
bbgo: remove submitOrder notification 2022-09-19 09:40:52 +08:00
c9s
59b1e52439
bbgo: remove submitOrder notification 2022-09-19 09:38:57 +08:00
c9s
1d1d5d497f
bbgo: init call to updateMarginAssetMaxBorrowable 2022-09-19 09:25:54 +08:00
c9s
8180153e9c
bbgo: use margin asset borrowable amount to adjust the quantity 2022-09-19 09:10:59 +08:00
Yo-An Lin
39c347f0a0
Merge pull request #950 from c9s/strategy/pivotshort
strategy/pivotshort
2022-09-17 18:14:41 +08:00
Zenix
44de961ea1
Merge pull request #942 from zenixls2/feature/modifiable
feature: add modify tg command. fix wdrift ma length
2022-09-16 15:23:38 +09:00
c9s
be40ed7410
bbgo: refactor marginAssetUpdater 2022-09-16 12:19:30 +08:00
c9s
d4f74822ad
bbgo/exit_protective_stop_loss: use types.KLineWith 2022-09-16 11:20:39 +08:00
c9s
2f575488c2
pivotshort: fix log format and notification 2022-09-16 11:18:11 +08:00
c9s
427723dcaf
bbgo: improve trendEMA condition 2022-09-16 01:20:48 +08:00
zenix
b66bcb1f67 fix: add more test cases on reflect.Value.Set 2022-09-14 20:11:38 +09:00
c9s
3ab5d35b77
bbgo: fix macdIndicators map initialization 2022-09-14 18:44:38 +08:00
c9s
7fd2b7472c
bbgo: integrate MACD indicator into standard indicator set 2022-09-14 18:33:06 +08:00
c9s
88696bc6d2
bbgo: add more interface implementation for order executor 2022-09-14 15:54:43 +08:00
Yo-An Lin
54782e763b
Merge pull request #947 from c9s/fix/acc-vol-stop
improve: accumulated volume stop method
2022-09-14 12:42:16 +08:00
c9s
1880553a65
bbgo: cumulated volume stop - compare shadow height 2022-09-14 12:32:36 +08:00
c9s
d022c80727
bbgo: add strict condition for CumulatedVolumeTakeProfit 2022-09-14 12:04:12 +08:00
zenix
aaa657dcc3 fix: move some modify implementation to dynamic 2022-09-14 12:38:22 +09:00
zenix
d40b34e4d6 feature: add modify tg command. fix wdrift ma length 2022-09-14 11:08:10 +09:00
c9s
b855267604
bbgo: wrap keyboard removal in defer func 2022-09-14 02:53:32 +08:00
c9s
1d1ec12417
bbgo: fix telegram message error, there must be one message to send 2022-09-14 02:51:07 +08:00
c9s
02dab542c4
bbgo: add USDTTWD price test case 2022-09-14 02:18:39 +08:00
c9s
c9b064f0ac
types: define PriceMap type 2022-09-14 02:18:39 +08:00
c9s
809294b054
bbgo: add test case for calculateNetValueInQuote 2022-09-14 02:18:39 +08:00
c9s
8d4eb611f3
bbgo: add more open position doc comments 2022-09-12 23:48:40 +08:00
c9s
776f89b2f2
pivotshort: apply OpenPositionOptions to breakLow 2022-09-12 23:24:37 +08:00
c9s
424a1dec3f
bbgo: add lightweight mode 2022-09-12 14:24:18 +08:00
Yo-An Lin
2214920b37
Merge pull request #935 from c9s/fix/open-position
bbgo: add price check and add max leverage for cross margin
2022-09-12 00:42:12 +08:00
c9s
b8e18dd75c
notifier: redirect error, panic, fatal error to telegram 2022-09-12 00:29:12 +08:00
c9s
caf57010a6
bbgo: move up base balance variable 2022-09-12 00:13:49 +08:00
c9s
53c4178ae2
bbgo: fix reverse pair price lookup and add tests 2022-09-12 00:05:22 +08:00
c9s
3b1725014b
bbgo: fix account value calculation for mixed usd fiat 2022-09-11 23:51:24 +08:00
c9s
307c5f2a8d
bbgo: add price check and add max leverage for cross margin 2022-09-11 23:26:48 +08:00
c9s
db94b2690a
bbgo: check base balance only for long position 2022-09-11 17:49:24 +08:00
c9s
7b68e5ee27
bbgo: fix balance lock issue 2022-09-11 17:46:23 +08:00
Andy Cheng
df7d768b94 strategy/pivotshort: add trendema test case 2022-09-11 14:42:05 +08:00
Andy Cheng
f132666738 strategy/pivotshort: fix trendema 2022-09-11 13:56:36 +08:00
Yo-An Lin
42a358fd34
Merge pull request #928 from c9s/refactor/iteract-filter
refactor: refactor interact strategy filter functions
2022-09-11 12:20:38 +08:00
c9s
7b58460d00
bbgo/interact: move strategy filter functions to the bottom 2022-09-11 03:15:11 +08:00
c9s
8961c940b2
bbgo: add two test cases for reflect 2022-09-11 03:13:10 +08:00
Yo-An Lin
d45bc9e509
Merge pull request #927 from c9s/refactor/submit-order
refactor: simplify submit order
2022-09-11 02:58:47 +08:00
c9s
278aa026f2
bbgo/interact: refactor strategy filter functions 2022-09-11 02:55:58 +08:00
c9s
442ca9287d
bbgo: implement position reset 2022-09-11 02:46:58 +08:00
c9s
3be801ab6b
bbgo/interact: add /resetposition command 2022-09-11 02:41:59 +08:00
c9s
9474c2779c
bbgo: call notify when opening new position 2022-09-11 02:36:45 +08:00
c9s
5c18bc4d41
bbgo: notify closing position 2022-09-11 02:33:32 +08:00
c9s
6c22c3799e
bbgo: Add ClosePosition doc comment 2022-09-11 02:01:48 +08:00
Yo-An Lin
e0228f80f4
Merge pull request #926 from c9s/feature/open-position
fix: handle created orders before we retry
2022-09-10 13:37:16 +08:00
c9s
c484c1f176
reformat code 2022-09-10 13:31:31 +08:00
c9s
29105eb57f
all: simplify underlying exchange submitOrder method
- Replace SubmitOrders with SubmitOrder
- Accept only one submit order and return one created order
- Add bbgo.BatchPlaceOrders helper method and bbgo.BatchRetryPlaceOrders method
2022-09-09 18:41:06 +08:00
Yo-An Lin
e86df62daf
Merge pull request #925 from c9s/feature/open-position
feature: order executor open position method
2022-09-09 17:58:12 +08:00
c9s
94780b39e6
bbgo: order executor should collect the created orders first before we retry 2022-09-09 17:55:51 +08:00
c9s
5f2254e2cb
bbgo: add description to the open position options 2022-09-09 17:50:21 +08:00
c9s
8dca24e9ee
all: solve cyclic import 2022-09-09 17:40:17 +08:00
c9s
2e95246687
bbgo: add OpenPosition method 2022-09-09 13:57:39 +08:00
Zenix
afad9cca47
Merge pull request #910 from zenixls2/feature/ewo_renew
SerialMarketDataStore, elliottwave renewal
2022-09-07 18:54:01 +09:00
zenix
e7a5669018 fix: lowestPrice in elliottwave, add more logs 2022-09-07 15:02:38 +09:00
c9s
33fdcefba3
bbgo: add notification tag 2022-09-07 01:05:43 +08:00
c9s
c2eec1e72b
bbgo: move fixedpoint one const to consts.go 2022-09-07 00:50:54 +08:00
c9s
62fb09c8d9
bbgo: protective stop should send notification when it's activated 2022-09-07 00:50:16 +08:00
zenix
66c8a3bb0d fix: rename getSource to sourceGetter 2022-09-06 19:15:13 +09:00
zenix
36a5579660 fix: SourceSelector json marshal/unmarshal without Init from strategy. smartCancel check on order status 2022-09-06 19:08:05 +09:00
c9s
8f363677bc
move bootstrap functions 2022-09-06 16:50:45 +08:00
zenix
67e57b49eb fix: move sourceselector to bbgo folder 2022-09-06 14:43:05 +09:00
zenix
6c8902dd9c fix: export kline query limit as a variable for preload decisions from strategy 2022-09-05 20:36:41 +09:00
zenix
4a878b5596 fix: rename generalorderexecutor.cancel to gracefulcancelorder 2022-09-05 19:32:35 +09:00
zenix
81084ddea6 feature: SerialMarketDataStore from session 2022-09-05 19:32:35 +09:00
zenix
fad9dedd1f fix: active order book cancel message 2022-09-05 19:32:35 +09:00
zenix
938dc3c497 feature: add serialmarketdatastore, add elliottwave strategy to replace ewoDgtrd, add active cancel on general order executor, add pca 2022-09-05 19:32:35 +09:00
Raphanus Lo
65cd17dbbb bbgo: add G-H & Kalman filters to the standard indicator set 2022-09-05 17:13:50 +08:00
Larry Lu
269529afa4
Fix typo 2022-09-04 13:35:01 +08:00
c9s
5c8d2a019a
backtest: rename BackTest to Backtest 2022-09-02 14:16:16 +08:00
c9s
8cd646668a
bbgo: use enumer to generate enumer parser 2022-09-02 14:16:16 +08:00
c9s
3d32faff46
backtest: add fee mode config 2022-09-02 14:16:15 +08:00
c9s
51972e9e28
bbgo: fix indicator load key duplicate issue 2022-08-31 01:45:06 +08:00
c9s
8fcc3ee368
indicator: update pivot low and pivot high indicator 2022-08-31 01:44:38 +08:00
c9s
179a9b1ddb
fix: ensure that orders.tsv are rendered in local timezone 2022-08-26 19:09:11 +08:00
c9s
17ba1c142d
bbgo: fix support take profit field type 2022-08-26 18:12:42 +08:00
c9s
fb9a4994c0
bbgo: add supportTakeProfit method to the core exit methods 2022-08-26 18:11:45 +08:00
c9s
11854db51a
pivotshort: move SupportTakeProfit to the core api 2022-08-26 18:09:46 +08:00
c9s
a48471d4c8
pivotshort: refactor trend ema and stop ema 2022-08-26 17:52:46 +08:00
c9s
8b7f4c6222
bbgo: add ProtectiveStopLoss doc comment 2022-08-26 17:52:46 +08:00
c9s
09cc91bab8
bbgo: update VWMA and add VWMA to the indicator method 2022-08-24 17:45:43 +08:00
c9s
469c6bfb28
bbgo: move rightWindow to the IntervalWindow struct 2022-08-24 17:43:28 +08:00
c9s
d930065bea
bbgo: move stoch to the simple indicator set 2022-08-24 17:34:19 +08:00
c9s
8a020c34e3
bbgo: add package doc to bbgo 2022-08-24 16:54:31 +08:00
c9s
c86b29e6dc
all: resolve import cycle 2022-08-23 02:12:26 +08:00
zenix
2720ee90b1 fix: equation of exit dump 2022-08-18 17:38:27 +09:00
zenix
5e7ea71613 feature: withdraw print config functionality from drift to be a general function 2022-08-18 17:38:27 +09:00
c9s
df8a4bef93
bbgo: remove unused trade store symbol argument 2022-08-17 16:02:42 +08:00
zenix
da28750313 feature: dump parameter to tg, esp series, fix: order tag, position calculation and bp/sp of drift 2022-08-15 21:05:29 +09:00
zenix
6a4eec71d6 feature: create simpleinteract and remove command in notification 2022-08-15 21:03:48 +09:00
zenix
90e596f463 feature: send photo through telegram, register handler dynamically in strategy, fix canvas rendering 2022-08-15 21:03:14 +09:00
Andy Cheng
62d450b92d
Merge pull request #872 from andycheng123/fix/trailing-stop
fix: trailing stop properly works on both long and short positions
2022-08-11 17:37:07 +08:00
Andy Cheng
8527d4996e trailingstop: add default case 2022-08-11 17:23:42 +08:00
Andy Cheng
8d3dfd17c7 trailingstop: add side both 2022-08-11 16:39:16 +08:00
Andy Cheng
6f2eb1688b generalorderexecutor: retry submit/cancel order once 2022-08-11 13:49:16 +08:00
Andy Cheng
df0e527e1e exits/trailingstop: properly works on both long and short positions 2022-08-11 13:36:31 +08:00
c9s
677b122964
bbgo: use types.KLineWith for roi take profit 2022-08-10 23:45:21 +08:00
Yo-An Lin
62aff676da
Revert "feature: add smart cancel to drift" 2022-08-09 16:25:36 +08:00
Yo-An Lin
55b4edc595
Merge pull request #853 from zenixls2/feature/smartcancel_drift
feature: add smart cancel to drift
2022-08-09 16:23:33 +08:00
Raphanus Lo
ed975b7ed9
Merge pull request #860 from COLDTURNIP/feature/exchange_order_amount_protection
exchange: order fee-amount protection
2022-08-09 15:01:53 +08:00
c9s
0283f2ad55
bbgo: fix doneTrades lock 2022-08-09 14:52:05 +08:00
zenix
45e819ebe7 feature: create simpleinteract and remove command in notification 2022-08-09 13:26:56 +09:00
zenix
4117a83cd1 feature: send photo through telegram, register handler dynamically in strategy, fix canvas rendering 2022-08-09 13:26:56 +09:00
Andy Cheng
ef18791c6a
Merge pull request #865 from andycheng123/fix/protective-stoploss
fix: protectivestoploss not working on long position
2022-08-09 12:15:33 +08:00
c9s
9867aa9c68
bbgo: add mutex protection to tradecollector 2022-08-09 11:37:44 +08:00
c9s
f191d3c091
bbgo: make position object optional for trade collector 2022-08-09 11:36:17 +08:00
c9s
cae8bc2882
bbgo: add mutli symbol support to active order book 2022-08-09 11:36:10 +08:00
Andy Cheng
6c2fc3fee0 exits/protectivestoploss: fix shouldStop() 2022-08-08 17:57:05 +08:00
Andy Cheng
b133767e47 exit/protectivestoploss: works in long position 2022-08-08 16:49:19 +08:00
Raphanus Lo
d76245cb43 exchange: adjust tests for order fee-amount protection 2022-08-02 15:12:14 +08:00
Raphanus Lo
ed7df4ddbe exchange: order fee-amount protection
Reduce the order amount to prevent submit rejection because of balance exceeding.

  submit_amount = original_amount / (1 + fee_rate)

Currently supported only by FTX Pro.
2022-08-02 13:35:24 +08:00
Andy Cheng
4bc70820c4 positionmodifier: move functions into types.Position 2022-07-29 14:40:54 +08:00
Andy Cheng
9588a6f6bd positionupdater: update command flow 2022-07-29 13:45:33 +08:00
Andy Cheng
2724949678 positionupdater: update avaerage cost 2022-07-29 12:05:39 +08:00
Andy Cheng
32b91b67dd positionupdater: update quote position 2022-07-29 12:00:11 +08:00
Andy Cheng
8c53c7e575 positionupdater: update base position 2022-07-29 11:52:20 +08:00
zenix
d46267aff9 feature: use ma for tp coefficient, rewrite trailing stop for drift, export all window param to yaml 2022-07-28 19:34:12 +09:00
c9s
93593ffa06
bbgo: add close position tag log 2022-07-28 10:27:04 +08:00
Yo-An Lin
3aeb6912c9
Merge pull request #846 from c9s/strategy/pivotshort
strategy/pivotshort: refactor breaklow + add fake break stop
2022-07-27 12:18:50 +08:00
c9s
7438798390
bbgo: add ClosedKLineStop trigger 2022-07-27 11:47:12 +08:00
Yo-An Lin
4fd571d712
Merge pull request #813 from zenixls2/feature/drift_study
feature: drift study
2022-07-27 11:29:48 +08:00
c9s
3fbc634d81
bbgo: narrow down indicator interface type 2022-07-27 02:21:25 +08:00
c9s
3959e288fd
all: refactor standard indicator helper and fix tests 2022-07-26 18:35:50 +08:00
c9s
0456cdc7a9
bbgo: add hull to the standard indicator 2022-07-26 18:27:22 +08:00
c9s
808d742efc
bbgo: add CCI helper 2022-07-26 18:07:43 +08:00
c9s
f5e64e8e70
bbgo: add ATR, ATRP, EMV to the standard indicator set 2022-07-26 18:07:43 +08:00
c9s
1d6b1de8ba
bbgo: rename standard indicator receiver name 2022-07-26 18:07:43 +08:00
c9s
46afc54559
bbgo: refactor standard indicator set 2022-07-26 18:07:43 +08:00
c9s
0df321c880
indicator: drop the legacy CalculateAndUpdate for standard indicators 2022-07-26 17:30:41 +08:00
zenix
a5039de6aa feature: add omega ratio, print sharpe/omega/interval profit from trade_stats, use stdev for high/low diff for drift to estimate the variance and improve profit, add yaml marshal for dnum fixedpoint 2022-07-26 18:00:05 +09:00
zenix
f2d37650a5 fix: drift bias on long entry position condition, make cancel faster 2022-07-26 18:00:05 +09:00
zenix
6a9e00ebd4 fix: update drift strategy 2022-07-26 18:00:05 +09:00
c9s
83c8bc819a
all: drop the legacy smart stops 2022-07-26 12:08:47 +08:00
c9s
76def2fe9d
pull out AccountValueCalculator 2022-07-21 19:46:58 +08:00
c9s
763ae1f62f
bbgo: fix missing var 2022-07-21 12:36:26 +08:00
c9s
1079757833
bbgo: bind market data store to market data stream when allocating new instance 2022-07-21 12:35:38 +08:00
c9s
de62d9dd67
bbgo: fix injection 2022-07-21 12:33:29 +08:00
c9s
c78ba6a539
bbgo: fix strategy struct field injection phase 2022-07-21 12:18:09 +08:00
c9s
946fb96b03
bbgo: reformat 2022-07-21 01:32:09 +08:00
c9s
02c978b812
bbgo: remove volatility from the standard indicator set 2022-07-21 01:31:42 +08:00
c9s
9f937f529e
bbgo: refactor standard indicator 2022-07-21 01:05:08 +08:00
c9s
ab83805b34
bbgo: add StrategyShutdown interface 2022-07-19 17:13:35 +08:00
c9s
8af2f2f83f
add defaulter interface 2022-07-19 16:59:56 +08:00
c9s
808ba2fc02
bbgo: make slack-app-token optional 2022-07-19 11:41:49 +08:00
c9s
9302474d51
add 1m subscribe to RoiTakeProfit 2022-07-19 11:00:45 +08:00
c9s
6e4c28ed1b
disable marketTrade stop 2022-07-17 00:59:35 +08:00
c9s
2d0fbe4b99
fix ProtectiveStopLoss subscribe 2022-07-16 14:45:02 +08:00
c9s
2a3118a086
indicator: clean up and update calculator method names 2022-07-14 09:18:42 +08:00
Yo-An Lin
8119afbb44
Merge branch 'main' into strategy/pivotshort 2022-07-12 23:38:23 +08:00
c9s
5bd292d0b2
bbgo: add notify(profit) 2022-07-08 16:43:32 +08:00
c9s
81560746bd
all: reformat code 2022-07-07 02:26:39 +08:00
c9s
3131786c02
bbgo: fix trailing stop binding 2022-07-07 02:26:39 +08:00
c9s
74593720a7
add ExitMethodSet.Bind method 2022-07-07 02:26:39 +08:00
c9s
d2637ce261
trailing stop: apply ClosePosition parameter 2022-07-07 02:26:39 +08:00
c9s
b3e04a68da
bbgo: fix trailing stop binding 2022-07-06 21:50:38 +08:00
c9s
3d9db2786d
add trailing stop to the exit method 2022-07-06 10:56:10 +08:00
c9s
b49f12300c
add long position test for trailing stop
Signed-off-by: c9s <yoanlin93@gmail.com>
2022-07-06 10:54:53 +08:00
c9s
03481000cc
reset activated flag when stop order is submitted
Signed-off-by: c9s <yoanlin93@gmail.com>
2022-07-06 03:09:57 +08:00
c9s
2bc12c0522
add trailing stop and it's test cases with gomock
Signed-off-by: c9s <yoanlin93@gmail.com>
2022-07-06 03:04:01 +08:00
c9s
4de5b0bc9b
add TrailingStop2 2022-07-05 16:10:55 +08:00
c9s
b643b8ed0d
fix LowerShadowTakeProfit kline filter condition 2022-07-05 12:15:31 +08:00
c9s
8ac21fa16e
fix LowerShadowTakeProfit kline filter condition 2022-07-05 12:14:53 +08:00
c9s
193703a9a0
all: use tradeStats constructor 2022-07-05 11:14:50 +08:00
c9s
ecd4df86f9
backtest: assign user data stream to backtest.Exchange before we call EmitStart 2022-07-04 02:21:14 +08:00
c9s
b158c44b95
fix profit stats notification 2022-07-01 17:32:40 +08:00
c9s
1af18a5fac
pivotshort: fix breakLow handle event 2022-07-01 15:30:06 +08:00
c9s
910c17a567
dynamic: implement CallWithMatch for dynamic calls
Signed-off-by: c9s <yoanlin93@gmail.com>
2022-07-01 13:09:30 +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
6aa6e57d96
add ema condition to the lower shadow take profit 2022-06-30 17:42:23 +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
e2ab363e64
dynamic: add CallStructFieldsMethod for map struct field call
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
cf0ca70d24
move and rename isSymbolBasedStrategy 2022-06-30 15:49:18 +08:00
c9s
3013eeccc7
move dynamic stuff to the pkg/dynamic package 2022-06-30 15:49:18 +08:00
c9s
a74decc47d
add more test case for reflect 2022-06-30 15:49:18 +08:00
c9s
fa917b0b77
bbgo: implmenet reflectMergeStructFields so that we can merge field values 2022-06-30 15:49:17 +08:00
c9s
84083f56b7
bbgo: add ExchangeSession param to the subscribe method 2022-06-29 15:16:56 +08:00
c9s
cb1c5634a2
pivotshort: remove redundant notification 2022-06-29 15:14:24 +08:00
c9s
fc3e76204a
bbgo: add todo for the reflect Subscribe call 2022-06-29 02:03:00 +08:00
c9s
95c2711b0d
bbgo: call Subscribe method dynamically 2022-06-29 02:02:23 +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
2784408b8b
add submit order tag 2022-06-27 18:17:57 +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
2e49a95d32
bbgo: remove unused context object
Signed-off-by: c9s <yoanlin93@gmail.com>
2022-06-25 17:02:53 +08:00
c9s
b25be3d702
add doc comments 2022-06-25 16:55:54 +08:00
c9s
751085f8ff
clean up todo comment 2022-06-24 19:24:49 +08:00
c9s
027f1f01cf
improve callID fallback for persistence 2022-06-22 15:19:30 +08:00
c9s
6ef54bf2fb
call bbgo.Sync to sync persistence 2022-06-22 13:46:03 +08:00
c9s
7c9ad535fd
bbgo: call global persistence facade to sync data 2022-06-21 14:32:43 +08:00
c9s
19d8013f49
bbgo: optimize order cancel for back-testing 2022-06-21 01:12:16 +08:00
c9s
58c819bd75
bbgo: pull out PersistenceServiceFacade to singleton 2022-06-21 01:05:13 +08:00
c9s
b6d1b4309b
refactor and update the support strategy 2022-06-19 15:57:59 +08:00
c9s
cb9ce753e2
strategy/bollmaker: refactor and clean up 2022-06-19 13:40:10 +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
6cae9e7449
move GeneralOrderExecutor into bbgo package 2022-06-18 16:31:53 +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
Yo-An Lin
24fc5c2baf
Merge pull request #736 from zenixls2/feature/lint_fmt_check
fix: gosimple alert
2022-06-18 02:48:47 +08:00
c9s
ac404b20a5
make default sync simple 2022-06-18 01:42:24 +08:00
zenix
a5ffca7fe8 fix: gosimple alert 2022-06-17 20:19:51 +09:00
zenix
ba1342cbc3 feature: add pre-commit 2022-06-17 16:07:00 +09:00