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'], # 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=", ") # test_info['beta'], test_info['alpha'], test_info['var10'], test_info['R2'], True, comment, stock_list, list(sol), sep=", ")
# print("-"*10) # print("-"*10)
data = (ts, name, session.get('username').split('@')[0], comp, data = (ts, name, session.get('username').split('@')[0], comp, role, ratio, test_info['annual_ret'],
role, ratio, test_info['annual_ret'], test_info['vol'], test_info['mdd'], test_info['annual_sr'], 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)) test_info['beta'], test_info['alpha'], test_info['var10'], test_info['R2'], True, comment, stock_list, list(sol))
sql='insert into strategy \ 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)\ (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) curs.execute(sql, data)
conn.close() conn.close()
print("\n------Write in Success--------\n") 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); console.log(response);
// var res = JSON.parse(response); // var res = JSON.parse(response);
event.preventDefault(); event.preventDefault();
// $('#confirmMes').text('') $('#modalTitle').text('完成建立')
$('#confirmMes').replaceWith(response); $('#confirmMes').replaceWith(response);
if (stockList.length > 0){ if (stockList.length > 0){
$('#confirmModal').modal('show'); $('#confirmModal').modal('show');

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

@ -13,13 +13,19 @@ body {
{% block content %} {% block content %}
<div class="container-fluid fade-in" style="background-color: #eee;"> <div class="container-fluid fade-in" style="background-color: #eee;">
<div class="container-fluid px-1 py-4"> <div class="container-fluid px-1 py-4">
<div class="alert alert-success p-3 mx-3" role="alert"> <div class="alert alert-secondary p-3 mx-3" role="alert">
<h4 class="alert-heading">Well done!</h4> <div class="d-flex justify-content-bottom">
<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> <p class="mb-0 mt-2 font-italic font-bold text-xl">
<hr> "Risk comes from not knowing what you're doing."
<p class="mb-0">Whenever you need to, be sure to use margin utilities to keep things nice and tidy.</p> </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 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"> <select id="competition" class="form-select" size="1" aria-label="size 5 select example">
{% include 'competitions.html' %} {% include 'competitions.html' %}
</select> </select>

@ -152,7 +152,7 @@ body {
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <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> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div> </div>
<div class="modal-body"> <div class="modal-body">

Loading…
Cancel
Save