Compare commits
No commits in common. "63ea0ed0b4df558b6e26ef6530a39f873c5983cc" and "5b09665af1511d9016bdaa56f3935733bb6efd8b" have entirely different histories.
63ea0ed0b4
...
5b09665af1
@ -1,9 +1,31 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
. /dabo/dabo-prep.sh
|
. /etc/bash/gaboshlib.include
|
||||||
|
|
||||||
|
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
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
# 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
|
|
||||||
|
|
@ -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*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#')
|
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#')
|
||||||
for f_INDEX in $f_indexlist
|
for f_INDEX in $f_indexlist
|
||||||
do
|
do
|
||||||
# day average 1 week ago
|
# day average 1 week ago
|
||||||
|
@ -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)
|
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)
|
||||||
|
|
||||||
for f_asset_per_exchange in ${f_assets_per_exchange}
|
for f_asset_per_exchange in ${f_assets_per_exchange}
|
||||||
do
|
do
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
. /dabo/dabo-prep.sh
|
|
||||||
|
|
||||||
while true
|
|
||||||
do
|
|
||||||
get_transactions
|
|
||||||
transactions_overview
|
|
||||||
transactions_summary
|
|
||||||
sleep 3600
|
|
||||||
done
|
|
||||||
|
|
@ -17,24 +17,6 @@ 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
|
||||||
|
Loading…
Reference in New Issue
Block a user