From fa98f3fda2fddef3ee023e26233908d1fdf640e7 Mon Sep 17 00:00:00 2001 From: c9s Date: Thu, 30 Jun 2022 18:29:59 +0800 Subject: [PATCH] fix position.IsOpened method Signed-off-by: c9s --- pkg/types/position.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/types/position.go b/pkg/types/position.go index e96423006..a85d09057 100644 --- a/pkg/types/position.go +++ b/pkg/types/position.go @@ -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 {