improve output format of get orders, add check if trade has been executed to auto trader scripts
This commit is contained in:
@@ -49,6 +49,17 @@ longSymbol=$(jq -r '.symbol' < temp/longLeg.json)
|
||||
msg="Long Symbol: _${longSymbol}_ Strike: _${longStrike}_ Bid: _${longBid}_ Ask: _${longAsk}_"
|
||||
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} > temp/existingOrders.$$
|
||||
if [[ $(wc -l < temp/existingOrders.$$) -eq 0 ]];then
|
||||
msg="Not Yet traded, continuing"
|
||||
systemd-cat -t "`basename $0` $1" -p info <<< ${msg}
|
||||
else
|
||||
msg="Already traded, exiting"
|
||||
systemd-cat -t "`basename $0` $1" -p info <<< ${msg}
|
||||
exit 0
|
||||
fi
|
||||
|
||||
priceOffset=0.0
|
||||
# Get the Middle price...
|
||||
@@ -76,7 +87,6 @@ orderJson=$(jq -c <<-EOM
|
||||
EOM
|
||||
)
|
||||
|
||||
|
||||
systemd-cat -t "`basename $0` $1" -p debug <<< "Order: _${orderJson}_"
|
||||
|
||||
echo Enter to continue, Ctrl+C to cancel
|
||||
|
||||
Reference in New Issue
Block a user