Fixing more of the log conversions to exit with errorleve even when logging as warning. Also, hardcode the Price of the 1DTE trade
This commit is contained in:
@@ -74,6 +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.85 # All nice calculating a price, but I want those to be filled and reasonably, they will (hopefully) be filled at 485
|
||||||
|
|
||||||
orderJson=$(jq -c <<-EOM
|
orderJson=$(jq -c <<-EOM
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -40,9 +40,10 @@ marketsCheck=$(jq -e -r '.. | .isOpen?' temp/markets.tmp.$$.json | grep -v null
|
|||||||
if [[ ${marketsCheck} -eq 0 ]]; then
|
if [[ ${marketsCheck} -eq 0 ]]; then
|
||||||
errMsg="ERROR: THE RESPONSE IS INCORRECT! markets: _${markets}_ Check: _${marketsCheck}_ check file _temp/markets.tmp.$$.json_"
|
errMsg="ERROR: THE RESPONSE IS INCORRECT! markets: _${markets}_ Check: _${marketsCheck}_ check file _temp/markets.tmp.$$.json_"
|
||||||
if [[ "${ErrorLogLevel}" == "err" ]]; then
|
if [[ "${ErrorLogLevel}" == "err" ]]; then
|
||||||
throw "${errMsg}" ${ErrorLogLevel}
|
throw "${errMsg}" ${ErrorLogLevel} 2
|
||||||
else
|
else
|
||||||
log "${errMsg}" ${ErrorLogLevel}
|
log "${errMsg}" ${ErrorLogLevel}
|
||||||
|
exit 2
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
jq < temp/markets.tmp.$$.json
|
jq < temp/markets.tmp.$$.json
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ if [[ "${symbol}" != "${symbolCheck}" ]]; then
|
|||||||
throw "${errMsg}" ${ErrorLogLevel} 2
|
throw "${errMsg}" ${ErrorLogLevel} 2
|
||||||
else
|
else
|
||||||
log "${errMsg}" ${ErrorLogLevel}
|
log "${errMsg}" ${ErrorLogLevel}
|
||||||
|
exit 2
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
jq < temp/optionChain.${symbol}.tmp.$$.json
|
jq < temp/optionChain.${symbol}.tmp.$$.json
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ if [[ "${symbol}" != "${symbolCheck}" ]]; then
|
|||||||
throw "${errMsg}" ${ErrorLogLevel} 2
|
throw "${errMsg}" ${ErrorLogLevel} 2
|
||||||
else
|
else
|
||||||
log "${errMsg}" ${ErrorLogLevel}
|
log "${errMsg}" ${ErrorLogLevel}
|
||||||
|
exit 2
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
optionChainFileName=$(date "+%Y-%m-%d %H_%M_%S")_optionChain.${symbol}.json
|
optionChainFileName=$(date "+%Y-%m-%d %H_%M_%S")_optionChain.${symbol}.json
|
||||||
|
|||||||
Reference in New Issue
Block a user