mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
pivotshort: add symbol name
This commit is contained in:
parent
fcdc26e188
commit
9b8239abba
|
@ -263,7 +263,7 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se
|
||||||
session.UserDataStream.OnStart(func() {
|
session.UserDataStream.OnStart(func() {
|
||||||
if price, ok := session.LastPrice(s.Symbol); ok {
|
if price, ok := session.LastPrice(s.Symbol); ok {
|
||||||
limitPrice := s.getValidPivotLow(price)
|
limitPrice := s.getValidPivotLow(price)
|
||||||
log.Infof("init place limit sell start from %f adds up to %f percent with %f layers of orders", limitPrice.Float64(), s.Entry.CatBounceRatio.Mul(fixedpoint.NewFromInt(100)).Float64(), s.Entry.NumLayers.Float64())
|
log.Infof("init %s place limit sell start from %f adds up to %f percent with %f layers of orders", s.Symbol, limitPrice.Float64(), s.Entry.CatBounceRatio.Mul(fixedpoint.NewFromInt(100)).Float64(), s.Entry.NumLayers.Float64())
|
||||||
s.placeLayerOrder(ctx, s.LastLow, limitPrice, price, orderExecutor)
|
s.placeLayerOrder(ctx, s.LastLow, limitPrice, price, orderExecutor)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -307,7 +307,7 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se
|
||||||
}
|
}
|
||||||
|
|
||||||
limitPrice := s.getValidPivotLow(kline.Close)
|
limitPrice := s.getValidPivotLow(kline.Close)
|
||||||
log.Infof("place limit sell start from %f adds up to %f percent with %f layers of orders", limitPrice.Float64(), s.Entry.CatBounceRatio.Mul(fixedpoint.NewFromInt(100)).Float64(), s.Entry.NumLayers.Float64())
|
log.Infof("%s place limit sell start from %f adds up to %f percent with %f layers of orders", s.Symbol, limitPrice.Float64(), s.Entry.CatBounceRatio.Mul(fixedpoint.NewFromInt(100)).Float64(), s.Entry.NumLayers.Float64())
|
||||||
s.placeLayerOrder(ctx, s.LastLow, limitPrice, kline.Close, orderExecutor)
|
s.placeLayerOrder(ctx, s.LastLow, limitPrice, kline.Close, orderExecutor)
|
||||||
//s.placeOrder(ctx, lastLow.Mul(fixedpoint.One.Add(s.CatBounceRatio)), s.Quantity, orderExecutor)
|
//s.placeOrder(ctx, lastLow.Mul(fixedpoint.One.Add(s.CatBounceRatio)), s.Quantity, orderExecutor)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user