fix the already traded detection in the long calls auto trading

This commit is contained in:
2024-09-23 14:31:50 -05:00
parent 48f28be423
commit b8b99a8a9e
2 changed files with 4 additions and 2 deletions

View File

@@ -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

View File

@@ -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