mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +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)
|
store, _ := session.MarketDataStore(position.Symbol)
|
||||||
|
|
||||||
session.MarketDataStream.OnKLineClosed(func(kline types.KLine) {
|
session.MarketDataStream.OnKLineClosed(types.KLineWith(s.Symbol, s.Interval, func(kline types.KLine) {
|
||||||
if kline.Symbol != position.Symbol || kline.Interval != s.Interval {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
closePrice := kline.Close
|
closePrice := kline.Close
|
||||||
if position.IsClosed() || position.IsDust(closePrice) {
|
if position.IsClosed() || position.IsDust(closePrice) {
|
||||||
return
|
return
|
||||||
|
@ -79,5 +75,5 @@ func (s *CumulatedVolumeTakeProfit) Bind(session *ExchangeSession, orderExecutor
|
||||||
_ = orderExecutor.ClosePosition(context.Background(), fixedpoint.One, "cumulatedVolumeTakeProfit")
|
_ = orderExecutor.ClosePosition(context.Background(), fixedpoint.One, "cumulatedVolumeTakeProfit")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
})
|
}))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user