diff --git a/autoTradeQQQLongCall.sh b/autoTradeQQQLongCall.sh index 37a21dc..fef8de5 100755 --- a/autoTradeQQQLongCall.sh +++ b/autoTradeQQQLongCall.sh @@ -4,6 +4,11 @@ IFS=$'\0' . helpers.sh +marketOpen=$([[ $(./getMarketHours.sh | jq '.option[].isOpen' | grep true | wc -l) -ne 0 ]] && echo true || echo false) +if [[ ${marketOpen} == false ]]; then + throw "The market is closed, exiting." info 2 +fi + daysOutMin=87 daysOutMax=91 deltaMin=0.35 diff --git a/autoTradeSPXPutCreditSpread.sh b/autoTradeSPXPutCreditSpread.sh index 79194c0..2df7b3c 100755 --- a/autoTradeSPXPutCreditSpread.sh +++ b/autoTradeSPXPutCreditSpread.sh @@ -87,7 +87,7 @@ if [[ "${noconfirm}" != "true" ]]; then fi curl -s -X POST \ - "https://api.schwabapi.com/trader/v1/accounts/$(./getAccountNumbers.sh Regular)/orders" \ + "https://api.schwabapi.com/trader/v1/accounts/$(./getAccountNumbers.sh IRA)/orders" \ -H "Authorization: Bearer $(./getNewAccessToken.sh)" \ -H 'accept: */*' \ -H 'Content-Type: application/json' \ diff --git a/autoTradeSPX_IB_1DTE.sh b/autoTradeSPX_IB_1DTE.sh index adb2b5e..cadcdfa 100755 --- a/autoTradeSPX_IB_1DTE.sh +++ b/autoTradeSPX_IB_1DTE.sh @@ -74,7 +74,7 @@ priceOffset=0.00 # try to get a little better price # 2) Round to the Coloses full number # 3) Divide by 20 priceOpen=$(echo "scale=2; exact=((${shortBidC}+${shortAskC})/2) + ((${shortBidP}+${shortAskP})/2) - ((${longBidC}+${longAskC})/2) - ((${longBidP}+${longAskP})/2) + ${priceOffset}; scale=0; round5=exact*20/1; scale=2; round5/20" | bc) -priceOpen=4.75 # All nice calculating a price, but I want those to be filled and reasonably, they will (hopefully) be filled at 475 +priceOpen=4.75 # All nice calculating a price, but I want those to be filled and reasonably, changing to 475 as 480 failed me on 2024-12-03 orderJson=$(jq -c <<-EOM { diff --git a/autoTradeSPYLongCall.sh b/autoTradeSPYLongCall.sh index eff92a7..a92c503 100755 --- a/autoTradeSPYLongCall.sh +++ b/autoTradeSPYLongCall.sh @@ -4,6 +4,11 @@ IFS=$'\0' . helpers.sh +marketOpen=$([[ $(./getMarketHours.sh | jq '.option[].isOpen' | grep true | wc -l) -ne 0 ]] && echo true || echo false) +if [[ ${marketOpen} == false ]]; then + throw "The market is closed, exiting." info 2 +fi + daysOutMin=87 daysOutMax=91 deltaMin=0.35