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