mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +00:00
pivotshort: move trendEMA log
This commit is contained in:
parent
adb8a2a713
commit
8873101752
|
@ -32,20 +32,19 @@ func (s *TrendEMA) GradientAllowed() bool {
|
||||||
s.trendGradient = s.trendEWMALast / s.trendEWMACurrent
|
s.trendGradient = s.trendEWMALast / s.trendEWMACurrent
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.Infof("trendEMA %+v current=%f last=%f gradient=%f", s, s.trendEWMACurrent, s.trendEWMALast, s.trendGradient)
|
||||||
|
|
||||||
if s.trendGradient == .0 {
|
if s.trendGradient == .0 {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if s.MaxGradient > 0.0 && s.trendGradient < s.MaxGradient {
|
if s.MaxGradient > 0.0 && s.trendGradient < s.MaxGradient {
|
||||||
log.Infof("trendEMA %+v current=%f last=%f gradient=%f: allowed", s, s.trendEWMACurrent, s.trendEWMALast, s.trendGradient)
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
if s.MinGradient > 0.0 && s.trendGradient > s.MinGradient {
|
if s.MinGradient > 0.0 && s.trendGradient > s.MinGradient {
|
||||||
log.Infof("trendEMA %+v current=%f last=%f gradient=%f: allowed", s, s.trendEWMACurrent, s.trendEWMALast, s.trendGradient)
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Infof("trendEMA %+v current=%f last=%f gradient=%f: disallowed", s, s.trendEWMACurrent, s.trendEWMALast, s.trendGradient)
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user