added MARKETDATA

This commit is contained in:
olli 2024-11-05 13:43:27 +01:00
parent d3352c4d28
commit fb0c346e2f

View File

@ -22,9 +22,19 @@ function get_values {
g_echo_note "RUNNING FUNCTION ${FUNCNAME} $@" g_echo_note "RUNNING FUNCTION ${FUNCNAME} $@"
local f_assets="$@" local f_assets="$@"
local f_asset_histories
f_assets=${f_assets//:$CURRENCY/} f_assets=${f_assets//:$CURRENCY/}
f_assets=${f_assets//\//} f_assets=${f_assets//\//}
for f_asset in $f_assets
do
f_asset_histories+="$f_asset "
f_asset_histories+="MARKETDATA_BINANCE_OPEN_INTEREST_$f_asset "
f_asset_histories+="MARKETDATA_BINANCE_LONG_SHORT_RATIO_TAKER_$f_asset "
f_asset_histories+="MARKETDATA_BINANCE_LONG_SHORT_RATIO_ACCOUNT_$f_asset "
done
local f_eco_asset f_eco_assets f_asset f_time f_prefix f_histfile f_columns f_return f_levelsfile f_tmp_levels f_first local f_eco_asset f_eco_assets f_asset f_time f_prefix f_histfile f_columns f_return f_levelsfile f_tmp_levels f_first
for f_eco_asset in $ECO_ASSETS for f_eco_asset in $ECO_ASSETS
@ -40,25 +50,33 @@ function get_values {
# get current prices from exchange # get current prices from exchange
get_symbols_ticker get_symbols_ticker
# get values from csv files # get values from csv files
#f_first=true for f_asset in $f_asset_histories\
for f_asset in $f_assets BTC${CURRENCY} $f_eco_assets BTC${CURRENCY}\
$f_eco_assets\
MARKETDATA_BINANCE_OPEN_INTEREST_BTC${CURRENCY}\
MARKETDATA_BINANCE_LONG_SHORT_RATIO_TAKER_BTC${CURRENCY}\
MARKETDATA_BINANCE_LONG_SHORT_RATIO_ACCOUNT_BTC${CURRENCY}\
MARKETDATA_FEAR_AND_GREED_ALTERNATIVEME\
MARKETDATA_FEAR_AND_GREED_CNN\
MARKETDATA_US_CONSUMER_PRICE_INDEX_CPI\
MARKETDATA_US_FED_FUNDS_RATE MARKETDATA_US_UNEMPLOYMENT_RATE
do do
# read latest ohlcv data and indicators per timeframe to vars # read latest ohlcv data and indicators per timeframe to vars
for f_time in 5m 15m 1h 4h 1d 1w for f_time in 5m 15m 1h 4h 1d 1w
do do
#f_prefix="${f_asset}_${f_time}_" # special on ECONOMY data
#[ "$f_first" = "true" ] && f_prefix="${f_time}_"
f_prefix="${f_time}_" f_prefix="${f_time}_"
if [[ "$f_asset" =~ ^ECONOMY- ]] if [[ "$f_asset" =~ ^ECONOMY- ]]
then then
f_prefix="${f_asset}_${f_time}_" f_prefix="${f_asset}_${f_time}_"
f_prefix=${f_prefix//-/_} f_prefix=${f_prefix//-/_}
fi fi
# histfile
f_histfile="asset-histories/${f_asset}.history.${f_time}.csv" f_histfile="asset-histories/${f_asset}.history.${f_time}.csv"
if ! [ -s "$f_histfile" ] if ! [ -s "$f_histfile" ]
then then
[ "$f_time" = "1w" ] || g_echo_warn "file $f_histfile empty or does not exist"
f_return=1 f_return=1
continue continue
fi fi