Compare commits

...

6 Commits

Author SHA1 Message Date
63ea0ed0b4 ongoing download transaction histories and generate overview 2024-05-30 17:39:02 +02:00
0815a65566 global settings 2024-05-30 17:39:02 +02:00
572182a333 fix 2024-05-30 17:39:02 +02:00
f27af6a1d5 yahoo history fix 2024-05-30 17:39:02 +02:00
1c64825654 added transactions_overview sevice 2024-05-30 17:39:02 +02:00
225a95efa1 dabo-prep.sh 2024-05-30 17:39:02 +02:00
6 changed files with 53 additions and 26 deletions

View File

@ -1,31 +1,9 @@
#!/bin/bash #!/bin/bash
. /etc/bash/gaboshlib.include . /dabo/dabo-prep.sh
export LANGUAGE="en_US"
### CONFIG ###
BASEPATH=/dabo/htdocs
g_tries=13
g_tries_delay=23
g_wget_opts="--timeout 10 --tries=2 --user-agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36'"
### FUNCTIONS ###
for bashfunc in $(find ${BASEPATH}/../functions -type f -name "*.sh")
do
. "$bashfunc"
done
### MAIN ### ### MAIN ###
g_echo_warn "STARTING DABO BOT $0"
g_signal-notify "STARTING DABO BOT $0"
# prepare directories
mkdir -p ${BASEPATH}/botdata/asset-histories
mkdir -p ${BASEPATH}/botdata/trade-histories
cd ${BASEPATH}/botdata
touch firstloop touch firstloop
export FULL_LOOP=1 export FULL_LOOP=1

19
dabo/dabo-prep.sh Normal file
View File

@ -0,0 +1,19 @@
# functions
BASEPATH=/dabo/htdocs
for bashfunc in $(find ${BASEPATH}/../functions -type f -name "*.sh")
do
. "$bashfunc"
done
. /etc/bash/gaboshlib.include
# vars
export LANGUAGE="en_US"
g_tries=13
g_tries_delay=23
g_wget_opts="--timeout 10 --tries=2 --user-agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36'"
# prepare directories
mkdir -p ${BASEPATH}/botdata/asset-histories
mkdir -p ${BASEPATH}/botdata/trade-histories
cd ${BASEPATH}/botdata

View File

@ -64,7 +64,7 @@ function market_performance {
local f_index_performance_added=0 local f_index_performance_added=0
local f_index_performance_csv="" local f_index_performance_csv=""
local f_INDEX local f_INDEX
local f_indexlist=$(ls -1t asset-histories/*INDEX* | egrep -v 'US-UNEMPLOYMENT-INDEX|US-CONSUMER-PRICE-INDEX|US-FED-FEDERAL-FUNDS-RATE-INVERTED' | perl -pe 's#asset-histories/(.+)-INDEX.history.csv#$1#') local f_indexlist=$(ls -1t asset-histories/*INDEX*history.csv | egrep -v 'US-UNEMPLOYMENT-INDEX|US-CONSUMER-PRICE-INDEX|US-FED-FEDERAL-FUNDS-RATE-INVERTED' | perl -pe 's#asset-histories/(.+)-INDEX.history.csv#$1#')
for f_INDEX in $f_indexlist for f_INDEX in $f_indexlist
do do
# day average 1 week ago # day average 1 week ago

View File

@ -12,7 +12,7 @@ function transactions_overview {
local f_exchange f_asset f_transactions_array f_transaction f_result f_asset_quantity f_asset_quantity_sold f_currency_quantity f_currency_quantity_sold f_currency_spent f_date f_type f_asset_amount f_currency f_currency_amount f_fee_currency f_fee_amount f_sell_result f_taxable f_tax_type f_one_year_ago f_currency_amount_eur f_currency_spent_eur f_currency_quantity_sold_eur local f_exchange f_asset f_transactions_array f_transaction f_result f_asset_quantity f_asset_quantity_sold f_currency_quantity f_currency_quantity_sold f_currency_spent f_date f_type f_asset_amount f_currency f_currency_amount f_fee_currency f_fee_amount f_sell_result f_taxable f_tax_type f_one_year_ago f_currency_amount_eur f_currency_spent_eur f_currency_quantity_sold_eur
f_assets_per_exchange=$(egrep -h -v '^DATE,TYPE,ASSET,ASSET_AMOUNT,CURRENCY,CURRENCY_AMOUNT,EXCHANGE|^#|^$|^ +$|^$' TRANSACTIONS-*.csv | cut -d, -f3,7 | sort -u | grep phemex) f_assets_per_exchange=$(egrep -h -v '^DATE,TYPE,ASSET,ASSET_AMOUNT,CURRENCY,CURRENCY_AMOUNT,EXCHANGE|^#|^$|^ +$|^$' TRANSACTIONS-*.csv | cut -d, -f3,7 | sort -u)
for f_asset_per_exchange in ${f_assets_per_exchange} for f_asset_per_exchange in ${f_assets_per_exchange}
do do

12
dabo/transaction-history.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
. /dabo/dabo-prep.sh
while true
do
get_transactions
transactions_overview
transactions_summary
sleep 3600
done

View File

@ -17,6 +17,24 @@ services:
- /usr/local/etc/notify.conf:/usr/local/etc/notify.conf:ro - /usr/local/etc/notify.conf:/usr/local/etc/notify.conf:ro
- /etc/localtime:/etc/localtime:ro - /etc/localtime:/etc/localtime:ro
dabo-transaction-history:
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
user: 10000:10000
volumes:
- ./dabo:/dabo:ro
- ./strategies:/dabo/strategies:ro
- ./dabo-bot.conf:/dabo/dabo-bot.override.conf
- ./watch-assets.csv:/dabo/watch-assets.csv
- ./data:/dabo/htdocs:rw
- ./home:/dabo/home:rw
- /usr/local/bin/notify.sh:/usr/local/bin/notify.sh:ro
- /usr/local/etc/notify.conf:/usr/local/etc/notify.conf:ro
- /etc/localtime:/etc/localtime:ro
entrypoint: /dabo/transaction-history.sh
dabo-web: dabo-web:
image: nginx:latest image: nginx:latest
restart: unless-stopped restart: unless-stopped