mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 16:55:15 +00:00
fix: highest price normalization in drift strategy
This commit is contained in:
parent
c51a99400d
commit
7310feb0de
|
@ -342,7 +342,7 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se
|
||||||
canvas := types.NewCanvas(s.InstanceID(), s.Interval)
|
canvas := types.NewCanvas(s.InstanceID(), s.Interval)
|
||||||
fmt.Println(dynamicKLine.StartTime, dynamicKLine.EndTime)
|
fmt.Println(dynamicKLine.StartTime, dynamicKLine.EndTime)
|
||||||
mean := priceLine.Mean(100)
|
mean := priceLine.Mean(100)
|
||||||
highestPrice := priceLine.Highest(100)
|
highestPrice := priceLine.Minus(mean).Highest(100)
|
||||||
highestDrift := s.drift.Highest(100)
|
highestDrift := s.drift.Highest(100)
|
||||||
ratio := highestDrift / highestPrice
|
ratio := highestDrift / highestPrice
|
||||||
canvas.Plot("drift", s.drift, dynamicKLine.StartTime, 100)
|
canvas.Plot("drift", s.drift, dynamicKLine.StartTime, 100)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user