diff --git a/dabo/functions/get_values.sh b/dabo/functions/get_values.sh index 9d80bbe..f3a0d02 100644 --- a/dabo/functions/get_values.sh +++ b/dabo/functions/get_values.sh @@ -22,9 +22,19 @@ function get_values { g_echo_note "RUNNING FUNCTION ${FUNCNAME} $@" local f_assets="$@" + local f_asset_histories + f_assets=${f_assets//:$CURRENCY/} 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 for f_eco_asset in $ECO_ASSETS @@ -40,25 +50,33 @@ function get_values { # get current prices from exchange get_symbols_ticker # get values from csv files - #f_first=true - for f_asset in $f_assets BTC${CURRENCY} $f_eco_assets + for f_asset in $f_asset_histories\ + 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 # read latest ohlcv data and indicators per timeframe to vars for f_time in 5m 15m 1h 4h 1d 1w do - #f_prefix="${f_asset}_${f_time}_" - #[ "$f_first" = "true" ] && f_prefix="${f_time}_" + # special on ECONOMY data f_prefix="${f_time}_" if [[ "$f_asset" =~ ^ECONOMY- ]] then f_prefix="${f_asset}_${f_time}_" f_prefix=${f_prefix//-/_} fi + + # histfile f_histfile="asset-histories/${f_asset}.history.${f_time}.csv" if ! [ -s "$f_histfile" ] then - [ "$f_time" = "1w" ] || g_echo_warn "file $f_histfile empty or does not exist" f_return=1 continue fi