added fibonacci retracements; added coingecko 1y price change and 24h marketcap change

This commit is contained in:
2023-09-04 17:37:09 +02:00
parent 99b3bd160c
commit 45333c7261
4 changed files with 62 additions and 4 deletions

View File

@@ -42,8 +42,6 @@ function get_asset {
fi
# headline
#[ -s "${f_ASSET_HIST_FILE}" ] || echo 'Date and Time,Price,Price Change,EMA12,EMA26,MACD,EMA9 MACD (Signal),MACD Histogram,MACD Signal,RSI5,RSI14,RSI21,RSI720,RSI60,RSI120,RSI240,RSI420,Price Change 24h,Price Change 7d,Price Change 14d,Price Change 30d' >"${f_ASSET_HIST_FILE}"
[ -s "${f_ASSET_HIST_FILE}" ] || echo "${csv_headline}" >"${f_ASSET_HIST_FILE}"
@@ -78,6 +76,18 @@ function get_asset {
echo -n ,$(jq -r ".[] |select(.symbol==\"${f_asset}\")|\"\\(.price_change_percentage_7d_in_currency)\"" COINGECKO_GET_ASSETS_CMD_OUT) >>${f_ASSET_HIST_FILE}
echo -n ,$(jq -r ".[] |select(.symbol==\"${f_asset}\")|\"\\(.price_change_percentage_14d_in_currency)\"" COINGECKO_GET_ASSETS_CMD_OUT) >>${f_ASSET_HIST_FILE}
echo -n ,$(jq -r ".[] |select(.symbol==\"${f_asset}\")|\"\\(.price_change_percentage_30d_in_currency)\"" COINGECKO_GET_ASSETS_CMD_OUT) >>${f_ASSET_HIST_FILE}
echo -n ,$(jq -r ".[] |select(.symbol==\"${f_asset}\")|\"\\(.price_change_percentage_1y_in_currency)\"" COINGECKO_GET_ASSETS_CMD_OUT) >>${f_ASSET_HIST_FILE}
echo -n ,$(jq -r ".[] |select(.symbol==\"${f_asset}\")|\"\\(.market_cap_change_percentage_24h)\"" COINGECKO_GET_ASSETS_CMD_OUT) >>${f_ASSET_HIST_FILE}
# Calculate Fibonacci-Retracement
# last 60 timeframes (a day on hourly)
get_fibonacci_indicator ${f_ASSET_HIST_FILE} 60
# last 168 timeframes (a week on hourly)
get_fibonacci_indicator ${f_ASSET_HIST_FILE} 168
# last 672 timeframes (a month on hourly)
get_fibonacci_indicator ${f_ASSET_HIST_FILE} 672
# last 8064 timeframes (a year on hourly)
get_fibonacci_indicator ${f_ASSET_HIST_FILE} 8064
# end with newline
echo "" >>${f_ASSET_HIST_FILE}