mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-13 02:23:51 +00:00
bollmaker: make detectPriceTrend simple function
This commit is contained in:
parent
89c2e7de1e
commit
1a85299204
|
@ -407,7 +407,7 @@ func (s *Strategy) placeOrders(ctx context.Context, orderExecutor bbgo.OrderExec
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
trend := s.detectPriceTrend(s.neutralBoll, midPrice.Float64())
|
trend := detectPriceTrend(s.neutralBoll, midPrice.Float64())
|
||||||
switch trend {
|
switch trend {
|
||||||
case NeutralTrend:
|
case NeutralTrend:
|
||||||
// do nothing
|
// do nothing
|
||||||
|
@ -505,7 +505,7 @@ const (
|
||||||
UnknownTrend PriceTrend = "unknown"
|
UnknownTrend PriceTrend = "unknown"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s *Strategy) detectPriceTrend(inc *indicator.BOLL, price float64) PriceTrend {
|
func detectPriceTrend(inc *indicator.BOLL, price float64) PriceTrend {
|
||||||
if inBetween(price, inc.LastDownBand(), inc.LastUpBand()) {
|
if inBetween(price, inc.LastDownBand(), inc.LastUpBand()) {
|
||||||
return NeutralTrend
|
return NeutralTrend
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user