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

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

@ -23,9 +23,9 @@
{% endblock %}
<style>
body {
padding-top: 60px;
// padding-top: 60px;
padding-bottom: 10px;
font-family: Georgia, sans-serif !important;
font-family: Georgia, Arial, Geneva, Helvetica, serif !important;
background-color: #eee;
height:100vh;
}
@ -45,6 +45,20 @@
height: 60px;
background-color: #f5f5f5;
}
.navbar-fixed-top {
top:20px;
}
{% block style %}
p {
text-indent: 2em;
@ -64,8 +78,8 @@
('mailto:r10246002@ntu.edu.tw', 'error', '錯誤回報', 'bi bi-bug-fill')
] -%}
{% set active_page = active_page|default('index') -%}
<nav class="navbar bg-light fixed-top">
<div class="container-fluid px-3 py-2">
<nav class="navbar bg-light">
<div class="container-fluid p-2">
<a class="navbar-brand mx-2" href="{{ url_for('index') }}">
<h3><strong></i>投資組合大擂台</strong></h3>
</a>
@ -95,7 +109,18 @@
</ul>
</li>
{% endif %}
<li>
<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>
<div id="google_translate_element"></div>
</li>
</ul>
</li>
</ul>
@ -151,10 +176,14 @@
</header>
<body>
{% 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;">
<!-- <h1 class="text-4xl font-bold mb-4">Document Title - {{ active_page|e }} </h1> -->
<div class="alert alert-secondary" role="alert">
<ul>
<li><i class="bi bi-caret-right-fill"></i> 本網站讓使用者可以自建投資組合,回測其績效,並與其他使用者比較、討論並改進。</li>
<li><i class="bi bi-caret-right-fill"></i> 使用單位:清華大學、台灣大學、政治大學、明新科大、中華大學、臺北大學、證基會、成功大學。</li>
</ul>
@ -314,6 +343,13 @@
integrity="sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN"
crossorigin="anonymous"
></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 %}
<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>
@ -325,6 +361,7 @@
};
</script>
{% endblock %}
</body>
</html>

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

Loading…
Cancel
Save