From 917703386d7de1af75f2c0e72cc6ffa68bf0bbc4 Mon Sep 17 00:00:00 2001 From: Joe Tretter Date: Thu, 22 Aug 2024 12:22:04 -0500 Subject: [PATCH] Fix account in autotrader; don't include the strike price in checking for existing order. --- autoTradeSPXPutCreditSpread.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/autoTradeSPXPutCreditSpread.sh b/autoTradeSPXPutCreditSpread.sh index a138d52..bcd16ba 100755 --- a/autoTradeSPXPutCreditSpread.sh +++ b/autoTradeSPXPutCreditSpread.sh @@ -41,14 +41,16 @@ systemd-cat -t "`basename $0` $1" -p info <<< ${msg} echo "${msg}" #Check if this order has already been submitted. -./getOrders.sh | (grep '\(WORKING\|FILLED\),\('${longSymbol}'\|'${shortSymbol}'\)' || true) > temp/existingOrders.${myPID} +./getOrders.sh | (grep '\(WORKING\|FILLED\),'${longSymbol:0:12} || true) > temp/existingOrders.${myPID} -if [[ $(wc -l < temp/existingOrders.${myPID} -eq 0 ]];then +if [[ $(wc -l < temp/existingOrders.${myPID}) -eq 0 ]];then msg="Not Yet traded, continuing" systemd-cat -t "`basename $0` $1" -p info <<< ${msg} + echo ${msg} else msg="Already traded, exiting" systemd-cat -t "`basename $0` $1" -p info <<< ${msg} + echo ${msg} exit 0 fi