Skip to content

Commit bd4b9c3

Browse files
committed
Updated templates
1 parent ece82e3 commit bd4b9c3

File tree

10 files changed

+106
-10
lines changed

10 files changed

+106
-10
lines changed

Stock Forecasting/templates.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from pathlib import Path
22

3-
from data import StockSummary, StockData
3+
from data_process import StockSummary, StockData
44

55
def create_index(
66
template_path: Path,
@@ -35,7 +35,15 @@ def create_stock_report(
3535
with template_path.open('r', encoding = "utf-8") as f:
3636
report = f.read()
3737

38-
report = report.format(symbol = stock_data.symbol)
38+
last_candle = "Green" if stock_data.last_candle == 1 else "Red"
39+
40+
report = report.format(
41+
symbol = stock_data.symbol,
42+
last_candle = last_candle,
43+
last_candle_color = last_candle.lower(),
44+
candle_streak = stock_data.candle_streak,
45+
streak_cont_prob = f"{stock_data.streak_cont_prob:.1%}"
46+
)
3947

4048
with page_out_path.joinpath(f"{stock_data.symbol}.html").open('w', encoding = 'utf-8') as f:
4149
f.write(report)

Stock Forecasting/templates/stock_report_template.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111

1212
<body>
1313
<h1>{symbol}</h1>
14+
<div>
15+
<p>Last candle: <span style="color:{last_candle_color}">{last_candle}</span></p>
16+
<p>Current streak: {candle_streak}</p>
17+
<p>Streak continutation probability: {streak_cont_prob}</p>
18+
</div>
1419
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
1520
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
1621
crossorigin="anonymous"></script>

index.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="en">
33

44
<head>
55
<meta charset="UTF-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
67
<title>Financial Modelling</title>
8+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
9+
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
710
</head>
811

912
<body>
@@ -43,6 +46,9 @@ <h1>Stock Forecasting</h1>
4346
<p>1074 records from 2020-01-01 to 2024-04-26</p>
4447
<p>PE data: Not available</p>
4548
</div>
49+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
50+
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
51+
crossorigin="anonymous"></script>
4652
</body>
4753

4854
</html>

web/pages/DEEPAKFERT.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="en">
33

44
<head>
55
<meta charset="UTF-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
67
<title>Financial Modelling</title>
8+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
9+
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
710
</head>
811

912
<body>
1013
<h1>DEEPAKFERT</h1>
14+
<div>
15+
<p>Last candle: <span style="color:red">Red</span></p>
16+
<p>Current streak: 1</p>
17+
<p>Streak continutation probability: 54.77%</p>
18+
</div>
19+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
20+
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
21+
crossorigin="anonymous"></script>
1122
</body>
1223

1324
</html>

web/pages/HDFCBANK.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="en">
33

44
<head>
55
<meta charset="UTF-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
67
<title>Financial Modelling</title>
8+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
9+
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
710
</head>
811

912
<body>
1013
<h1>HDFCBANK</h1>
14+
<div>
15+
<p>Last candle: <span style="color:red">Red</span></p>
16+
<p>Current streak: 2</p>
17+
<p>Streak continutation probability: 25.56%</p>
18+
</div>
19+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
20+
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
21+
crossorigin="anonymous"></script>
1122
</body>
1223

1324
</html>

web/pages/HDFCSML250.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="en">
33

44
<head>
55
<meta charset="UTF-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
67
<title>Financial Modelling</title>
8+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
9+
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
710
</head>
811

912
<body>
1013
<h1>HDFCSML250</h1>
14+
<div>
15+
<p>Last candle: <span style="color:green">Green</span></p>
16+
<p>Current streak: 1</p>
17+
<p>Streak continutation probability: 68.49%</p>
18+
</div>
19+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
20+
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
21+
crossorigin="anonymous"></script>
1122
</body>
1223

1324
</html>

web/pages/INDIGOPNTS.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="en">
33

44
<head>
55
<meta charset="UTF-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
67
<title>Financial Modelling</title>
8+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
9+
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
710
</head>
811

912
<body>
1013
<h1>INDIGOPNTS</h1>
14+
<div>
15+
<p>Last candle: <span style="color:green">Green</span></p>
16+
<p>Current streak: 2</p>
17+
<p>Streak continutation probability: 17.37%</p>
18+
</div>
19+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
20+
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
21+
crossorigin="anonymous"></script>
1122
</body>
1223

1324
</html>

web/pages/ITBEES.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="en">
33

44
<head>
55
<meta charset="UTF-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
67
<title>Financial Modelling</title>
8+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
9+
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
710
</head>
811

912
<body>
1013
<h1>ITBEES</h1>
14+
<div>
15+
<p>Last candle: <span style="color:red">Red</span></p>
16+
<p>Current streak: 1</p>
17+
<p>Streak continutation probability: 51.36%</p>
18+
</div>
19+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
20+
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
21+
crossorigin="anonymous"></script>
1122
</body>
1223

1324
</html>

web/pages/JUBLFOOD.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="en">
33

44
<head>
55
<meta charset="UTF-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
67
<title>Financial Modelling</title>
8+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
9+
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
710
</head>
811

912
<body>
1013
<h1>JUBLFOOD</h1>
14+
<div>
15+
<p>Last candle: <span style="color:red">Red</span></p>
16+
<p>Current streak: 2</p>
17+
<p>Streak continutation probability: 23.42%</p>
18+
</div>
19+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
20+
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
21+
crossorigin="anonymous"></script>
1122
</body>
1223

1324
</html>

web/pages/NH.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="en">
33

44
<head>
55
<meta charset="UTF-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
67
<title>Financial Modelling</title>
8+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
9+
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
710
</head>
811

912
<body>
1013
<h1>NH</h1>
14+
<div>
15+
<p>Last candle: <span style="color:green">Green</span></p>
16+
<p>Current streak: 3</p>
17+
<p>Streak continutation probability: 9.51%</p>
18+
</div>
19+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
20+
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
21+
crossorigin="anonymous"></script>
1122
</body>
1223

1324
</html>

0 commit comments

Comments
 (0)