trade time

This commit is contained in:
ying liu 2024-08-05 17:47:44 +08:00
parent 79ae41c0cc
commit c9b8636a48
2 changed files with 8 additions and 6 deletions

View File

@ -18,12 +18,14 @@ exchangeStrategies:
symbols: symbols:
- ARUSDT - ARUSDT
- ORDIUSDT - ORDIUSDT
- XRPUSDT
- OPUSDT - OPUSDT
- OMUSDT - OMUSDT
- WIFUSDT - WIFUSDT
- DYDXUSDT - DYDXUSDT
- XRPUSDT - XRPUSDT
- PEOPLEUSDT - PEOPLEUSDT
- WLDUSDT
# - STXUSDT # - STXUSDT
# - WLDUSDT # - WLDUSDT
# - FILUSDT # - FILUSDT
@ -39,7 +41,7 @@ exchangeStrategies:
interval: 15m interval: 15m
nrInterval: 15m nrInterval: 15m
cciInterval: 15m cciInterval: 15m
atrInterval: 2h atrInterval: 1h
nrCount: 4 nrCount: 4
cciWindow: 20 cciWindow: 20
atrWindow: 14 atrWindow: 14
@ -51,14 +53,14 @@ exchangeStrategies:
leverage: 5.0 leverage: 5.0
profitRange: 5% profitRange: 5%
lossRange: 1% lossRange: 1%
amount: 20 amount: 10
placePriceType: 2 placePriceType: 2
lossType: 1 lossType: 1
profitOrderType: 0 profitOrderType: 0
atrProfitRange: 1.0 atrProfitRange: 1.0
atrLossRange: 2.0 atrLossRange: 3.0
tradeStartHour: 0 tradeStartHour: 8
tradeEndHour: 8 tradeEndHour: 23
pauseTradeLoss: -10.0 pauseTradeLoss: -10.0
# recalculate: false # recalculate: false
# dry_run: false # dry_run: false

View File

@ -426,7 +426,7 @@ func (s *Strategy) isTradeTime(ctx context.Context) bool {
now := time.Now().In(location) now := time.Now().In(location)
hour := now.Hour() hour := now.Hour()
return !(hour >= s.TradeStartHour && hour < s.TradeEndHour) return hour >= s.TradeStartHour && hour < s.TradeEndHour
} }
func (s *Strategy) isPauseTrade(ctx context.Context) bool { func (s *Strategy) isPauseTrade(ctx context.Context) bool {