mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
elliottwave: use AverageCost instead
This commit is contained in:
parent
a900c72032
commit
72575e3cd8
|
@ -354,12 +354,12 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se
|
||||||
s.highestPrice = 0
|
s.highestPrice = 0
|
||||||
s.lowestPrice = 0
|
s.lowestPrice = 0
|
||||||
} else if s.Position.IsLong() {
|
} else if s.Position.IsLong() {
|
||||||
s.buyPrice = s.Position.ApproximateAverageCost.Float64()
|
s.buyPrice = s.Position.AverageCost.Float64()
|
||||||
s.sellPrice = 0
|
s.sellPrice = 0
|
||||||
s.highestPrice = math.Max(s.buyPrice, s.highestPrice)
|
s.highestPrice = math.Max(s.buyPrice, s.highestPrice)
|
||||||
s.lowestPrice = 0
|
s.lowestPrice = 0
|
||||||
} else {
|
} else {
|
||||||
s.sellPrice = s.Position.ApproximateAverageCost.Float64()
|
s.sellPrice = s.Position.AverageCost.Float64()
|
||||||
s.buyPrice = 0
|
s.buyPrice = 0
|
||||||
s.highestPrice = 0
|
s.highestPrice = 0
|
||||||
if s.lowestPrice == 0 {
|
if s.lowestPrice == 0 {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user