better analyze.sh output

This commit is contained in:
olli 2023-05-23 16:03:50 +02:00
parent 354d485139
commit 63e603b00a
3 changed files with 24 additions and 8 deletions

View File

@ -33,6 +33,6 @@ INVEST="5"
EMERGENCY_STOP="1000"
# Headline - don't touch
export csv_headline="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"
export csv_headline="Date and Time,Price,Change ${INTERVAL}s,EMA12,EMA26,MACD,EMA9 MACD (Signal),MACD Histogram,MACD Signal,RSI5,RSI14,RSI21,RSI720,RSI60,RSI120,RSI240,RSI420,Change 24h,Change 7d,Change 14d,Change 30d"

View File

@ -9,14 +9,14 @@ function get_vars_from_csv {
if [ -z "${f_market_performance}" ]
then
if [ -z "${BOT}" ]
then
g_echo_note "Analyze: No market performanvce data found - forcing good market (100)"
#if [ -z "${BOT}" ]
#then
# g_echo_note "Analyze: No market performanvce data found - forcing good market (-100)"
# f_market_performance=100
#else
# g_echo_note "Bot: No market performanvce data found - forcing bad market (-100)"
f_market_performance=-100
else
g_echo_note "Bot: No market performanvce data found - forcing bad market (-100)"
f_market_performance=-100
fi
#fi
fi

View File

@ -0,0 +1,16 @@
#!/bin/bash
mkdir final
ls -1 *.history.csv | while read x
do
echo $x
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' >final/$x
grep -A99999999 "2023-05-22 06:15" "$x" | grep ',100,100,100,100$' >>final/$x
egrep "2023.+,.+,.+,.+,.+,.+,.+,.+,.+,.+,.+,.+,.+,.+,.+,.+,.+,.+,.+,.+,.+" $x | grep -v ,100,100,100,100 | egrep ":00:|:15:|:30:|:45:" | while read line
do
date=$(echo $line | cut -d, -f1)
gecko=$(echo $line | cut -d, -f18,19,20,21)
#echo "$x: $date $gecko"
sed -i "s/^\($date,.*\)100,100,100,100$/\1$gecko/" final/$x
done
done