From 8629ea6c7ece8dbf9ff3a99c8533159d109f7b10 Mon Sep 17 00:00:00 2001 From: joey0629 Date: Mon, 22 Apr 2024 23:16:17 +0800 Subject: [PATCH] add week Opt & everyday update stock price --- docker-compose.yml | 2 +- requirements.txt | 1 + templates/strategy_tw.html | 1 + update_data_daily.py | 66 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 update_data_daily.py diff --git a/docker-compose.yml b/docker-compose.yml index 1c25a7a..8d13985 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -47,7 +47,7 @@ services: command: bash -c "cp -r /flask/* /flask_run" flask: container_name: flask - command: bash -c "cd flask_run; python main.py runserver 0.0.0.0:8000" + command: bash -c "cd flask_run && python main.py runserver 0.0.0.0:8000 && python update_data_daily.py" image: tpm-flask volumes: - flask-data:/flask_run diff --git a/requirements.txt b/requirements.txt index 44d2019..9fd6da0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,3 +16,4 @@ gevent==22.10.2 yfinance==0.2.22 tqdm==4.62.3 werkzeug==2.2.2 +schedule==1.2.1 \ No newline at end of file diff --git a/templates/strategy_tw.html b/templates/strategy_tw.html index 424f33e..897890b 100644 --- a/templates/strategy_tw.html +++ b/templates/strategy_tw.html @@ -167,6 +167,7 @@ div.card{
最佳化頻率