Implement stitiching as fallback, better error handling, add new symbols.
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -3,7 +3,5 @@ data/*
|
||||
temp/*
|
||||
appCredentials.dat
|
||||
refresh_token.dat
|
||||
Unstaged changes after reset:
|
||||
M .gitignore
|
||||
appKey.dat
|
||||
cert.pem
|
||||
|
||||
@@ -44,12 +44,18 @@
|
||||
{
|
||||
"Symbol": "HD"
|
||||
},
|
||||
{
|
||||
"Symbol": "HEI"
|
||||
},
|
||||
{
|
||||
"Symbol": "INTC"
|
||||
},
|
||||
{
|
||||
"Symbol": "IWM"
|
||||
},
|
||||
{
|
||||
"Symbol": "KHC"
|
||||
},
|
||||
{
|
||||
"Symbol": "KMB"
|
||||
},
|
||||
|
||||
@@ -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)" \
|
||||
|
||||
@@ -19,11 +19,13 @@ 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
|
||||
touch temp/hadErrors.$$.tmp
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user