mirror of
https://github.com/c9s/bbgo.git
synced 2024-09-20 08:11:08 +00:00
fix LowerShadowTakeProfit kline filter condition
This commit is contained in:
parent
8ac21fa16e
commit
b643b8ed0d
|
@ -36,11 +36,7 @@ func (s *CumulatedVolumeTakeProfit) Bind(session *ExchangeSession, orderExecutor
|
|||
|
||||
store, _ := session.MarketDataStore(position.Symbol)
|
||||
|
||||
session.MarketDataStream.OnKLineClosed(func(kline types.KLine) {
|
||||
if kline.Symbol != position.Symbol || kline.Interval != s.Interval {
|
||||
return
|
||||
}
|
||||
|
||||
session.MarketDataStream.OnKLineClosed(types.KLineWith(s.Symbol, s.Interval, func(kline types.KLine) {
|
||||
closePrice := kline.Close
|
||||
if position.IsClosed() || position.IsDust(closePrice) {
|
||||
return
|
||||
|
@ -79,5 +75,5 @@ func (s *CumulatedVolumeTakeProfit) Bind(session *ExchangeSession, orderExecutor
|
|||
_ = orderExecutor.ClosePosition(context.Background(), fixedpoint.One, "cumulatedVolumeTakeProfit")
|
||||
return
|
||||
}
|
||||
})
|
||||
}))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user