Compare commits
2 Commits
9e3ee03976
...
79ae41c0cc
Author | SHA1 | Date | |
---|---|---|---|
79ae41c0cc | |||
0b23e9f2f0 |
|
@ -36,9 +36,9 @@ exchangeStrategies:
|
||||||
# - ETHUSDT
|
# - ETHUSDT
|
||||||
# - SOLUSDT
|
# - SOLUSDT
|
||||||
|
|
||||||
interval: 1m
|
interval: 15m
|
||||||
nrInterval: 1m
|
nrInterval: 15m
|
||||||
cciInterval: 5m
|
cciInterval: 15m
|
||||||
atrInterval: 2h
|
atrInterval: 2h
|
||||||
nrCount: 4
|
nrCount: 4
|
||||||
cciWindow: 20
|
cciWindow: 20
|
||||||
|
|
|
@ -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 {
|
||||||
|
@ -535,10 +535,10 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor qbtrade.OrderExecutor,
|
||||||
}
|
}
|
||||||
|
|
||||||
if !s.isTradeTime(ctx) || s.isPauseTrade(ctx) {
|
if !s.isTradeTime(ctx) || s.isPauseTrade(ctx) {
|
||||||
pauseMsg := fmt.Sprintf("暂停交易:总收益:%v, 暂停次数:%v, 暂停时间:%v; 暂停时间段:[%v, %v)",
|
//pauseMsg := fmt.Sprintf("暂停交易:总收益:%v, 暂停次数:%v, 暂停时间:%v; 暂停时间段:[%v, %v)",
|
||||||
s.TotalProfit.Float64(), s.PauseTradeCount.Float64(), s.PauseTradeTime, s.TradeStartHour,
|
// s.TotalProfit.Float64(), s.PauseTradeCount.Float64(), s.PauseTradeTime, s.TradeStartHour,
|
||||||
s.TradeEndHour)
|
// s.TradeEndHour)
|
||||||
qbtrade.Notify(pauseMsg)
|
//qbtrade.Notify(pauseMsg)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user