master
SeanChenTaipei 2 years ago
parent 4cd1b5a1ab
commit 4201a1f884
  1. 4
      main.py
  2. 45
      templates/base.html
  3. 40
      templates/strategy_tw.html

@ -20,8 +20,8 @@ pd.options.plotting.backend = "plotly"
# PARAMETERS # PARAMETERS
CONFIGS = { CONFIGS = {
"ENV": "development", # "ENV": "development",
"DEBUG": True, # "DEBUG": True,
"SECRET_KEY": os.urandom(30), # Set the secret key for session authentication "SECRET_KEY": os.urandom(30), # Set the secret key for session authentication
"PERMANENT_SESSION_LIFETIME": timedelta(minutes=60) "PERMANENT_SESSION_LIFETIME": timedelta(minutes=60)
} }

@ -23,9 +23,9 @@
{% endblock %} {% endblock %}
<style> <style>
body { body {
padding-top: 60px; // padding-top: 60px;
padding-bottom: 10px; padding-bottom: 10px;
font-family: Georgia, sans-serif !important; font-family: Georgia, Arial, Geneva, Helvetica, serif !important;
background-color: #eee; background-color: #eee;
height:100vh; height:100vh;
} }
@ -45,6 +45,20 @@
height: 60px; height: 60px;
background-color: #f5f5f5; background-color: #f5f5f5;
} }
.navbar-fixed-top {
top:20px;
}
{% block style %} {% block style %}
p { p {
text-indent: 2em; text-indent: 2em;
@ -64,8 +78,8 @@
('mailto:r10246002@ntu.edu.tw', 'error', '錯誤回報', 'bi bi-bug-fill') ('mailto:r10246002@ntu.edu.tw', 'error', '錯誤回報', 'bi bi-bug-fill')
] -%} ] -%}
{% set active_page = active_page|default('index') -%} {% set active_page = active_page|default('index') -%}
<nav class="navbar bg-light fixed-top"> <nav class="navbar bg-light">
<div class="container-fluid px-3 py-2"> <div class="container-fluid p-2">
<a class="navbar-brand mx-2" href="{{ url_for('index') }}"> <a class="navbar-brand mx-2" href="{{ url_for('index') }}">
<h3><strong></i>投資組合大擂台</strong></h3> <h3><strong></i>投資組合大擂台</strong></h3>
</a> </a>
@ -95,7 +109,18 @@
</ul> </ul>
</li> </li>
{% endif %} {% endif %}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle btn btn-lg" href="" role="button" data-bs-toggle="dropdown" aria-expanded="true">
<i class="fa-solid fa-globe"></i>
</a>
<ul class="dropdown-menu dropdown-menu-end">
<li> <li>
<div id="google_translate_element"></div>
</li>
</ul>
</li> </li>
</ul> </ul>
@ -151,10 +176,14 @@
</header> </header>
<body> <body>
{% block content %} {% block content %}
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
<div class="container-lg mx-auto my-2 p-4 bg-white shadow-lg" style="border-radius: 5px;"> <div class="container-lg mx-auto my-2 p-4 bg-white shadow-lg" style="border-radius: 5px;">
<!-- <h1 class="text-4xl font-bold mb-4">Document Title - {{ active_page|e }} </h1> --> <!-- <h1 class="text-4xl font-bold mb-4">Document Title - {{ active_page|e }} </h1> -->
<div class="alert alert-secondary" role="alert"> <div class="alert alert-secondary" role="alert">
<ul> <ul>
<li><i class="bi bi-caret-right-fill"></i> 本網站讓使用者可以自建投資組合,回測其績效,並與其他使用者比較、討論並改進。</li> <li><i class="bi bi-caret-right-fill"></i> 本網站讓使用者可以自建投資組合,回測其績效,並與其他使用者比較、討論並改進。</li>
<li><i class="bi bi-caret-right-fill"></i> 使用單位:清華大學、台灣大學、政治大學、明新科大、中華大學、臺北大學、證基會、成功大學。</li> <li><i class="bi bi-caret-right-fill"></i> 使用單位:清華大學、台灣大學、政治大學、明新科大、中華大學、臺北大學、證基會、成功大學。</li>
</ul> </ul>
@ -314,6 +343,13 @@
integrity="sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN" integrity="sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN"
crossorigin="anonymous" crossorigin="anonymous"
></script> ></script>
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'zh-TW',
layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL}, 'google_translate_element');
}
</script>
<script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
{% block script %} {% block script %}
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script> <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.0/es5/tex-mml-chtml.min.js"></script> <script id="MathJax-script" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.0/es5/tex-mml-chtml.min.js"></script>
@ -325,6 +361,7 @@
}; };
</script> </script>
{% endblock %} {% endblock %}
</body> </body>
</html> </html>

@ -15,6 +15,9 @@ div.input-group > * {
div.card{ div.card{
border-radius: 2px; border-radius: 2px;
} }
.card-header {
color: #000093;
}
@keyframes cursor { @keyframes cursor {
0% { 0% {
opacity: 0; opacity: 0;
@ -54,15 +57,13 @@ div.card{
</div> </div>
</div> </div>
<div class="card"> <div class="card" id="buildName">
<div class="card-header font-bold text-lg"> <div class="card-header font-bold text-lg">
投資組合名稱 投資組合名稱
</div> </div>
<div class="card-body"> <div class="card-body">
<input if="imput1" name="portName" type="text" class="form-control" placeholder="EX. 問就是歐應" required> <input if="imput1" name="portName" type="text" class="form-control" placeholder="EX. 韓總 No.1" required>
</div> </div>
</div>
<div class="card">
<div class="card-header font-bold text-lg"> <div class="card-header font-bold text-lg">
請選擇所參加的課程/競賽 請選擇所參加的課程/競賽
</div> </div>
@ -71,22 +72,21 @@ div.card{
{% include 'competitions.html' %} {% include 'competitions.html' %}
</select> </select>
</div> </div>
</div> </div>
<hr class="my-3"> <hr class="my-3">
<div class="card"> <div class="card">
<div class="card-header d-flex"> <div class="card-header d-flex">
<div class="py-2 font-bold text-lg-center"> <div class="py-2 font-bold text-lg">
已選擇的資產 已選擇的資產
</div> </div>
<div class="btn-group ms-auto"> <div class="btn-group ms-auto">
<button type="button" class="btn btn-outline-primary btn-sm" id="submit-btn">
<button type="button" class="btn btn-outline-danger btn-sm" id="submit-port"> 確認資產
確認建立
</button> </button>
</div> </div>
</div> </div>
<div class="card-body d-flex mb-0"> <div class="card-body d-flex mb-0">
<input name="assetSelect" class="form-control" list="datalistOptions" id="stockAll" placeholder="輸入資產名稱..."> <input name="assetSelect" class="form-control" list="datalistOptions" id="stockAll" placeholder="輸入資產名稱...">
@ -116,17 +116,11 @@ div.card{
</li> </li>
</ol> </ol>
</div> </div>
</div>
<div class="card">
<div class="card-header d-flex"> <div class="card-header d-flex">
<div class="py-2 font-bold text-lg"> <div class="py-2 font-bold text-lg">
價格動態圖表 價格動態圖表
</div> </div>
<div class="btn-group ms-auto">
<button type="button" class="btn btn-outline-primary btn-sm" id="submit-btn">
確認資產
</button>
</div>
</div> </div>
<div class="card-body"> <div class="card-body">
<div id="graph" style="max-height:40vh"> <div id="graph" style="max-height:40vh">
@ -139,8 +133,18 @@ div.card{
</div> </div>
</div> </div>
<hr> <hr>
<div> <div class="card mt-3">
<div class="d-flex p-2 mt-2 font-bold text-lg">策略參數選擇</div> <div class="d-flex p-2">
<div class="p-2 font-bold text-lg">
策略參數選擇
</div>
<div class="btn-group ms-auto">
<button type="button" class="btn btn-outline-danger btn-sm" id="submit-port">
確認建立
</button>
</div>
</div>
<div class="input-group"> <div class="input-group">
<span class="input-group-text bg-info">訓練 / 回測數據比</span> <span class="input-group-text bg-info">訓練 / 回測數據比</span>
<select id="ratio-select" class="form-select"> <select id="ratio-select" class="form-select">

Loading…
Cancel
Save