various smaller maintenance changes
This commit is contained in:
@@ -4,6 +4,11 @@ IFS=$'\0'
|
|||||||
|
|
||||||
. helpers.sh
|
. 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
|
daysOutMin=87
|
||||||
daysOutMax=91
|
daysOutMax=91
|
||||||
deltaMin=0.35
|
deltaMin=0.35
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ if [[ "${noconfirm}" != "true" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
curl -s -X POST \
|
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 "Authorization: Bearer $(./getNewAccessToken.sh)" \
|
||||||
-H 'accept: */*' \
|
-H 'accept: */*' \
|
||||||
-H 'Content-Type: application/json' \
|
-H 'Content-Type: application/json' \
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ priceOffset=0.00 # try to get a little better price
|
|||||||
# 2) Round to the Coloses full number
|
# 2) Round to the Coloses full number
|
||||||
# 3) Divide by 20
|
# 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=$(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
|
orderJson=$(jq -c <<-EOM
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,11 @@ IFS=$'\0'
|
|||||||
|
|
||||||
. helpers.sh
|
. 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
|
daysOutMin=87
|
||||||
daysOutMax=91
|
daysOutMax=91
|
||||||
deltaMin=0.35
|
deltaMin=0.35
|
||||||
|
|||||||
Reference in New Issue
Block a user