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/*
|
temp/*
|
||||||
appCredentials.dat
|
appCredentials.dat
|
||||||
refresh_token.dat
|
refresh_token.dat
|
||||||
Unstaged changes after reset:
|
|
||||||
M .gitignore
|
|
||||||
appKey.dat
|
appKey.dat
|
||||||
cert.pem
|
cert.pem
|
||||||
|
|||||||
@@ -44,12 +44,18 @@
|
|||||||
{
|
{
|
||||||
"Symbol": "HD"
|
"Symbol": "HD"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"Symbol": "HEI"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Symbol": "INTC"
|
"Symbol": "INTC"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Symbol": "IWM"
|
"Symbol": "IWM"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"Symbol": "KHC"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Symbol": "KMB"
|
"Symbol": "KMB"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -77,8 +77,6 @@ systemd-cat -t "`basename $0` $1" -p debug <<< "Order: _${orderJson}_"
|
|||||||
#read
|
#read
|
||||||
./getNewAccessToken.sh
|
./getNewAccessToken.sh
|
||||||
|
|
||||||
set -x
|
|
||||||
tempFile=temp/order.tmp.$$.json
|
|
||||||
curl -s -X POST \
|
curl -s -X POST \
|
||||||
'https://api.schwabapi.com/trader/v1/accounts/C819AC820A502BA92E55D775B22BDF0E1BC91D86C62685714347734A5827CCB3/orders' \
|
'https://api.schwabapi.com/trader/v1/accounts/C819AC820A502BA92E55D775B22BDF0E1BC91D86C62685714347734A5827CCB3/orders' \
|
||||||
-H "Authorization: Bearer $(<access_token.dat)" \
|
-H "Authorization: Bearer $(<access_token.dat)" \
|
||||||
|
|||||||
@@ -18,12 +18,14 @@ jq -r '.[].Symbol' allSymbols.json | sort | while read theSymbol; do
|
|||||||
|
|
||||||
if [[ '$XSP' = ${theSymbol} ]]; then
|
if [[ '$XSP' = ${theSymbol} ]]; then
|
||||||
./recordOptionChainSingleSymbolSingleRun.sh ${theSymbol} toDate $(date "+%Y-%m-%d" -d "+200 days")
|
./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
|
if [[ $? -ne 0 ]]; then
|
||||||
touch temp/hadErrors.$$.tmp
|
touch temp/hadErrors.$$.tmp
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# The above one might fail, so we also try with stitching
|
|
||||||
./recordOptionChainSingleSymbolSpecialRun.sh ${theSymbol}
|
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -37,7 +39,6 @@ jq -r '.[].Symbol' allSymbols.json | sort | while read theSymbol; do
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# The above one might fail, so we also try with stitching
|
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user