mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +00:00
support: fix triggerEMA check
This commit is contained in:
parent
2d4ce2d41c
commit
b56e988fc9
|
@ -363,6 +363,7 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if s.triggerEMA != nil && s.longTermEMA != nil {
|
||||||
s.Notify("Found %s support: the close price %f is below trigger EMA %f and above long term EMA %f and volume %f > minimum volume %f",
|
s.Notify("Found %s support: the close price %f is below trigger EMA %f and above long term EMA %f and volume %f > minimum volume %f",
|
||||||
s.Symbol,
|
s.Symbol,
|
||||||
closePrice.Float64(),
|
closePrice.Float64(),
|
||||||
|
@ -371,6 +372,14 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se
|
||||||
kline.Volume,
|
kline.Volume,
|
||||||
s.MinVolume.Float64(),
|
s.MinVolume.Float64(),
|
||||||
kline)
|
kline)
|
||||||
|
} else {
|
||||||
|
s.Notify("Found %s support: the close price %f and volume %f > minimum volume %f",
|
||||||
|
s.Symbol,
|
||||||
|
closePrice.Float64(),
|
||||||
|
kline.Volume,
|
||||||
|
s.MinVolume.Float64(),
|
||||||
|
kline)
|
||||||
|
}
|
||||||
|
|
||||||
quantity, err := s.calculateQuantity(session, types.SideTypeBuy, closePrice, kline.Volume)
|
quantity, err := s.calculateQuantity(session, types.SideTypeBuy, closePrice, kline.Volume)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user