- Fix SPX auto trading by differntiation of SPX and SPWX

- Prevent destruciton of the refresh token when things go wrong
- add auto trading wip code for order getting, and long trading
- add recording of 90 days out expiration tracking
- Add TSLA
This commit is contained in:
2024-07-17 14:08:55 -05:00
parent d242be4d5e
commit e9a651f92e
9 changed files with 255 additions and 5 deletions

13
getOrders.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
set -x
mkdir -p temp
./getNewAccessToken.sh
tempFile=temp/accountOrders.tmp.$$.json
#fromEnteredTime=$(date -u "+%Y-%m-%dT%H:%M:%S.000Z" -d "-5 days")
fromEnteredTime=$(date -u "+%Y-%m-%dT%H:%M:%S.000Z" -d "-1000 minutes")
toEnteredTime=$(date -u "+%Y-%m-%dT%H:%M:%S.000Z" -d "-10 minutes")
curl -s -X GET "https://api.schwabapi.com/trader/v1/orders?fromEnteredTime=${fromEnteredTime}&toEnteredTime=${toEnteredTime}" -H "Authorization: Bearer $(<access_token.dat)" > ${tempFile}
cat ${tempFile} | jq -r 'map(.enteredTime)[]'