mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +00:00
pivotshort: get the correct pivot low value
This commit is contained in:
parent
854af6b4bd
commit
b746f801f7
|
@ -96,13 +96,13 @@ func (s *BreakLow) Bind(session *bbgo.ExchangeSession, orderExecutor *bbgo.Gener
|
|||
|
||||
// update pivot low data
|
||||
session.MarketDataStream.OnStart(func() {
|
||||
lastLow := fixedpoint.NewFromFloat(s.pivot.Lows.Last())
|
||||
lastLow := fixedpoint.NewFromFloat(s.pivot.Last())
|
||||
if lastLow.IsZero() {
|
||||
return
|
||||
}
|
||||
|
||||
if lastLow.Compare(s.lastLow) != 0 {
|
||||
bbgo.Notify("%s found new pivot low: %f", s.Symbol, s.pivot.Lows.Last())
|
||||
bbgo.Notify("%s found new pivot low: %f", s.Symbol, s.pivot.Last())
|
||||
}
|
||||
|
||||
s.lastLow = lastLow
|
||||
|
@ -127,7 +127,7 @@ func (s *BreakLow) Bind(session *bbgo.ExchangeSession, orderExecutor *bbgo.Gener
|
|||
})
|
||||
|
||||
session.MarketDataStream.OnKLineClosed(types.KLineWith(symbol, s.Interval, func(kline types.KLine) {
|
||||
lastLow := fixedpoint.NewFromFloat(s.pivot.Lows.Last())
|
||||
lastLow := fixedpoint.NewFromFloat(s.pivot.Last())
|
||||
if lastLow.IsZero() {
|
||||
return
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ func (s *BreakLow) Bind(session *bbgo.ExchangeSession, orderExecutor *bbgo.Gener
|
|||
return
|
||||
}
|
||||
|
||||
bbgo.Notify("%s new pivot low: %f", s.Symbol, s.pivot.Lows.Last())
|
||||
bbgo.Notify("%s new pivot low: %f", s.Symbol, s.pivot.Last())
|
||||
}))
|
||||
|
||||
session.MarketDataStream.OnKLineClosed(types.KLineWith(symbol, types.Interval1m, func(kline types.KLine) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user