From 0727b5305b3cae44503c54840991847b1843b510 Mon Sep 17 00:00:00 2001 From: rando128 <> Date: Tue, 20 Dec 2022 10:51:57 +0100 Subject: [PATCH] fix: hide calculator for partially executed sells --- public/js/CoinWrapperBuySignal.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/public/js/CoinWrapperBuySignal.js b/public/js/CoinWrapperBuySignal.js index b4d7cfe7..ad283ad3 100644 --- a/public/js/CoinWrapperBuySignal.js +++ b/public/js/CoinWrapperBuySignal.js @@ -366,11 +366,13 @@ class CoinWrapperBuySignal extends React.Component { const nextGridAmount = nextGridQty * currentPrice; - const executedGrids = gridTrade.filter(trade => trade.executed).length; + const executedBuyGrids = gridTrade.filter(trade => trade.executed).length; - const hasManualTrade = currentGridTradeIndex !== executedGrids; + const hasManualTrade = currentGridTradeIndex !== executedBuyGrids; - return (nextGridAmount > 0) & !hasManualTrade ? ( + const isSingleSellGrid = symbolConfiguration.sell.currentGridTradeIndex >=0 & sellGridTrade.length == 1; + + return (nextGridAmount > 0) & !hasManualTrade & isSingleSellGrid ? (