SeanChenTaipei 2 years ago
parent a4f01c76db
commit bbec258a82
  1. 6
      main.py
  2. 2
      static/js/addStock.js
  3. 2
      templates/base.html
  4. 18
      templates/result.html
  5. 2
      templates/strategy_tw.html

@ -342,8 +342,8 @@ def buildPort():
# role, test_info['annual_ret'], test_info['vol'], test_info['mdd'], test_info['annual_sr'],
# test_info['beta'], test_info['alpha'], test_info['var10'], test_info['R2'], True, comment, stock_list, list(sol), sep=", ")
# print("-"*10)
data = (ts, name, session.get('username').split('@')[0], comp,
role, ratio, test_info['annual_ret'], test_info['vol'], test_info['mdd'], test_info['annual_sr'],
data = (ts, name, session.get('username').split('@')[0], comp, role, ratio, test_info['annual_ret'],
test_info['vol'], test_info['mdd'], test_info['annual_sr'],
test_info['beta'], test_info['alpha'], test_info['var10'], test_info['R2'], True, comment, stock_list, list(sol))
sql='insert into strategy \
(date, name, username, competition, role, ratio, annual_ret, vol, mdd, annual_sr, beta, alpha, var10, R2, tw, comment, assets, assets_position)\
@ -353,7 +353,7 @@ def buildPort():
curs.execute(sql, data)
conn.close()
print("\n------Write in Success--------\n")
return '''<span>投資組合已完成建立,請至<a class="badge rounded-pill text-bg-primary" href="/">#TODO:insert link</a>查詢分析結果。</span>'''
return '''<span>投資組合已完成建立,請至 <a class="badge rounded-pill text-bg-primary" href="/result">#TODO:insert link</a> 查詢分析結果。</span>'''

@ -101,7 +101,7 @@ $sendPort.click(function(event) {
console.log(response);
// var res = JSON.parse(response);
event.preventDefault();
// $('#confirmMes').text('')
$('#modalTitle').text('完成建立')
$('#confirmMes').replaceWith(response);
if (stockList.length > 0){
$('#confirmModal').modal('show');

@ -99,7 +99,7 @@
<i class="bi bi-three-dots"></i>
</button>
<div
class="offcanvas offcanvas-start text-bg-light"
class="offcanvas offcanvas-end text-bg-light"
data-bs-scroll="true"
tabindex="-1"
id="offcanvasNavbar"

@ -13,13 +13,19 @@ body {
{% block content %}
<div class="container-fluid fade-in" style="background-color: #eee;">
<div class="container-fluid px-1 py-4">
<div class="alert alert-success p-3 mx-3" role="alert">
<h4 class="alert-heading">Well done!</h4>
<p>Aww yeah, you successfully read this important alert message. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.</p>
<hr>
<p class="mb-0">Whenever you need to, be sure to use margin utilities to keep things nice and tidy.</p>
<div class="alert alert-secondary p-3 mx-3" role="alert">
<div class="d-flex justify-content-bottom">
<p class="mb-0 mt-2 font-italic font-bold text-xl">
"Risk comes from not knowing what you're doing."
</p>
<p class="mb-0 px-1 pt-1 align-self-end text-xs">Warren Edward Buffett</p>
</div>
<hr class="my-3 px-5">
<div class='d-flex justify-content-end'>
<div>
<div class="input-group mb-3">
<span class="input-group-text" id="in">選擇競賽</span>
<select id="competition" class="form-select" size="1" aria-label="size 5 select example">
{% include 'competitions.html' %}
</select>

@ -152,7 +152,7 @@ body {
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title font-bold text-xl">開始建立投資組合</h5>
<h5 id='modalTile' class="modal-title font-bold text-xl">開始建立投資組合</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">

Loading…
Cancel
Save