make historic transactions from onetrading available to the bot

This commit is contained in:
olli 2024-05-26 09:59:58 +02:00
parent c54e8f184a
commit 03ebb54e38

View File

@ -0,0 +1,18 @@
function get_onetrading_csv_transactions {
g_echo_note "RUNNING FUNCTION ${FUNCNAME} $@"
if [ -s onetrading-export.csv ]
then
cat onetrading-export.csv | sed 's/\"//g' | grep ',SELL,' | awk -F, '{print $12","tolower($3)","$6","$5","$8","$9",OneTrading"}' | sort >ONETRADING-sell.csv.tmp
cat onetrading-export.csv | sed 's/\"//g' | grep ',BUY,' | awk -F, '{print $12","tolower($3)","$11","$9","$8","$5",OneTrading"}' | sort >ONETRADING-buy.csv.tmp
cat ONETRADING-buy.csv.tmp ONETRADING-sell.csv.tmp | sort >TRANSACTIONS-ONETRADING.csv
rm -f ONETRADING-buy.csv.tmp ONETRADING-sell.csv.tmp
fi
}