From 56067a6f0d82ab61f6e6deb5f708db56e2813dbe Mon Sep 17 00:00:00 2001 From: Veeno Date: Thu, 10 Oct 2024 07:06:19 +0200 Subject: [PATCH] fix: issue #5 --- packages/hooks/src/orderly/usePositionStream/utils.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/hooks/src/orderly/usePositionStream/utils.ts b/packages/hooks/src/orderly/usePositionStream/utils.ts index 2c99c9c46..612ceeff4 100644 --- a/packages/hooks/src/orderly/usePositionStream/utils.ts +++ b/packages/hooks/src/orderly/usePositionStream/utils.ts @@ -1,8 +1,8 @@ import { API, AlgoOrderEntity, - AlgoOrderType, AlgoOrderRootType, + AlgoOrderType, OrderStatus, } from "@orderly.network/types"; @@ -58,7 +58,8 @@ export const findPositionTPSLFromOrders = ( // console.log(order.symbol, symbol, order.algo_type); return ( order.symbol === symbol && - order.algo_type === AlgoOrderRootType.POSITIONAL_TP_SL && + (order.algo_type === AlgoOrderRootType.POSITIONAL_TP_SL || + order.algo_type === AlgoOrderRootType.TP_SL) && (order.root_algo_status === OrderStatus.NEW || order.root_algo_status === OrderStatus.REPLACED || order.root_algo_status === OrderStatus.PARTIAL_FILLED)