Skip to content

Commit e699997

Browse files
committed
Added RBA. Updated data for JUBLFOOD, DEEPAKFERT
1 parent 97c6a59 commit e699997

30 files changed

+1394
-96
lines changed

Stock Forecasting/data_process.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,12 @@ def _get_first_hit_of_last_close(self):
142142

143143
if self.total_hits_of_last_close > 0:
144144
self.first_hit_of_last_close = all_hits["Date"].min().date()
145+
self.pcnt_hit_of_last_close = (
146+
self.total_hits_of_last_close /
147+
len(self.raw_data[self.raw_data["Date"].dt.date >= self.first_hit_of_last_close])
148+
)
149+
else:
150+
self.pcnt_hit_of_last_close = 0
145151

146152
def _save_historical_plots(self):
147153
with sns.axes_style('dark'):

Stock Forecasting/templates.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,21 @@ def create_stock_report(
4242
last_candle = "Green" if stock_data.last_candle == 1 else "Red"
4343

4444
if stock_data.total_hits_of_last_close > 0:
45-
first_hit_info = f'{stock_data.symbol} first closed above this last close price on <span class="metric">{stock_data.first_hit_of_last_close:%A %B %d, %Y}</span> which was <span class="metric">{(date.today() - stock_data.first_hit_of_last_close).days}</span> days ago.'
45+
first_hit_info = f'{stock_data.symbol} first closed above this last close price on <span class="metric">{stock_data.first_hit_of_last_close:%A, %B %d, %Y}</span> which was <span class="metric">{(date.today() - stock_data.first_hit_of_last_close).days}</span> days ago.'
4646
else:
4747
first_hit_info = f"This is the first time {stock_data.symbol} has closed at this high a price."
4848

4949
report = report.format(
5050
symbol = stock_data.symbol,
51+
num_records = stock_data.summary.num_records,
52+
start_date = f"{stock_data.summary.start_date:%B %d, %Y}",
53+
end_date = f"{stock_data.summary.end_date:%B %d, %Y}",
5154
last_close = stock_data.last_close,
5255
last_candle = last_candle,
5356
last_candle_color = f"color-{last_candle.lower()}",
5457
first_hit_info = first_hit_info,
5558
total_hits_of_last_close = stock_data.total_hits_of_last_close,
59+
pcnt_hits_of_last_close = f"{stock_data.pcnt_hit_of_last_close:.1%}",
5660
candle_streak = stock_data.candle_streak,
5761
streak_cont_prob = f"{stock_data.streak_cont_prob:.1%}"
5862
)

Stock Forecasting/templates/stock_report_template.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,18 @@
1111
</head>
1212

1313
<body>
14-
<h1 class="p-2">{symbol}</h1>
14+
<h2 class="px-2"><a href="../../index.html">Financial Modelling</a> -> {symbol}</h2>
15+
<div class="row p-2">
16+
<p>Analysis based on <span class="metric">{num_records}</span> records from <span
17+
class="metric">{start_date}</span> to <span class="metric">{end_date}</span></p>
18+
</div>
1519
<div class="row p-2">
1620
<div class="col-md-12 col-lg-3 vert-center">
1721
<p>Last close price: <span class="metric">{last_close}</span></p>
1822
<p>Last candle: <span class="metric {last_candle_color}">{last_candle}</span></p>
1923
<p>{first_hit_info}</p>
20-
<p>Since then, it has closed over this price <span class="metric">{total_hits_of_last_close}</span> times.</p>
24+
<p>Since then, it has closed over this price <span class="metric">{pcnt_hits_of_last_close}</span> of times
25+
which is <span class="metric">{total_hits_of_last_close}</span> trading days.</p>
2126
</div>
2227
<div class="col-md-12 col-lg-9 text-center">
2328
<img src="../images/{symbol}_CDF_Close_Price.png" height="400px">

data/NSE/DEEPAKFERT/Quote-Equity-DEEPAKFERT-EQ-01-01-2024-to-18-02-2024.csv

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)