Implement stitiching as fallback, better error handling, add new symbols.

This commit is contained in:
2024-06-20 09:34:11 -05:00
parent 5f49216a88
commit d242be4d5e
4 changed files with 11 additions and 8 deletions

2
.gitignore vendored
View File

@@ -3,7 +3,5 @@ data/*
temp/*
appCredentials.dat
refresh_token.dat
Unstaged changes after reset:
M .gitignore
appKey.dat
cert.pem

View File

@@ -44,12 +44,18 @@
{
"Symbol": "HD"
},
{
"Symbol": "HEI"
},
{
"Symbol": "INTC"
},
{
"Symbol": "IWM"
},
{
"Symbol": "KHC"
},
{
"Symbol": "KMB"
},

View File

@@ -77,8 +77,6 @@ systemd-cat -t "`basename $0` $1" -p debug <<< "Order: _${orderJson}_"
#read
./getNewAccessToken.sh
set -x
tempFile=temp/order.tmp.$$.json
curl -s -X POST \
'https://api.schwabapi.com/trader/v1/accounts/C819AC820A502BA92E55D775B22BDF0E1BC91D86C62685714347734A5827CCB3/orders' \
-H "Authorization: Bearer $(<access_token.dat)" \

View File

@@ -18,12 +18,14 @@ jq -r '.[].Symbol' allSymbols.json | sort | while read theSymbol; do
if [[ '$XSP' = ${theSymbol} ]]; then
./recordOptionChainSingleSymbolSingleRun.sh ${theSymbol} toDate $(date "+%Y-%m-%d" -d "+200 days")
if [[ $? -ne 0 ]]; then
systemd-cat -t "`basename $0`" -p warning <<< "falling back to stitching for ${theSymbol}"
./recordOptionChainSingleSymbolSpecialRun.sh ${theSymbol}
if [[ $? -ne 0 ]]; then
touch temp/hadErrors.$$.tmp
fi
fi
# The above one might fail, so we also try with stitching
./recordOptionChainSingleSymbolSpecialRun.sh ${theSymbol}
continue
fi
@@ -37,7 +39,6 @@ jq -r '.[].Symbol' allSymbols.json | sort | while read theSymbol; do
fi
fi
# The above one might fail, so we also try with stitching
continue
fi