From b8b99a8a9ebee5e1814aed888f273ca1e5af257c Mon Sep 17 00:00:00 2001 From: Joe Tretter Date: Mon, 23 Sep 2024 14:31:50 -0500 Subject: [PATCH] fix the already traded detection in the long calls auto trading --- autoTradeQQQLongCall.sh | 3 ++- autoTradeSPYLongCall.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/autoTradeQQQLongCall.sh b/autoTradeQQQLongCall.sh index d27fb36..8c4012c 100755 --- a/autoTradeQQQLongCall.sh +++ b/autoTradeQQQLongCall.sh @@ -44,7 +44,7 @@ longSymbol=$(jq -r '.symbol' < temp/longLeg.json) log "Long Symbol: _${longSymbol}_ Strike: _${longStrike}_ Bid: _${longBid}_ Ask: _${longAsk}_" info #Check if this order has already been submitted. -./getOrders.sh | grep '\(WORKING\|FILLED\),'${longSymbol} > temp/existingOrders.$$ +./getOrders.sh | grep '\(WORKING\|FILLED\),'${longSymbolC:0:12} > temp/existingOrders.$$ if [[ $(wc -l < temp/existingOrders.$$) -eq 0 ]];then log "Not Yet traded, continuing" info else @@ -91,3 +91,4 @@ curl -s -X POST \ -H 'Content-Type: application/json' \ -d "${orderJson}" +log "Result: _$?_" debug diff --git a/autoTradeSPYLongCall.sh b/autoTradeSPYLongCall.sh index e41b356..106c7a3 100755 --- a/autoTradeSPYLongCall.sh +++ b/autoTradeSPYLongCall.sh @@ -49,7 +49,7 @@ longSymbol=$(jq -r '.symbol' < temp/longLeg.json) log "Long Symbol: _${longSymbol}_ Strike: _${longStrike}_ Bid: _${longBid}_ Ask: _${longAsk}_" info #Check if this order has already been submitted. -./getOrders.sh | grep '\(WORKING\|FILLED\),'${longSymbol} > temp/existingOrders.$$ +./getOrders.sh | grep '\(WORKING\|FILLED\),'${longSymbolC:0:12} > temp/existingOrders.$$ if [[ $(wc -l < temp/existingOrders.$$) -eq 0 ]];then log "Not Yet traded, continuing" info else @@ -96,3 +96,4 @@ curl -s -X POST \ -H 'Content-Type: application/json' \ -d "${orderJson}" +log "Result: _$?_" debug