fix position.IsOpened method

Signed-off-by: c9s <yoanlin93@gmail.com>
This commit is contained in:
c9s 2022-06-30 18:29:59 +08:00
parent 3e6b975c2c
commit fa98f3fda2
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -274,7 +274,7 @@ func (p *Position) IsClosed() bool {
}
func (p *Position) IsOpened(currentPrice fixedpoint.Value) bool {
return p.IsClosed() || !p.IsDust(currentPrice)
return !p.IsClosed() && !p.IsDust(currentPrice)
}
func (p *Position) Type() PositionType {