Update daily.py
Browse files
daily.py
CHANGED
|
@@ -4,13 +4,14 @@ import pandas as pd
|
|
| 4 |
from ta_indi_pat import patterns, indicators
|
| 5 |
from common import html_card, wrap_html
|
| 6 |
|
| 7 |
-
def
|
| 8 |
"""
|
| 9 |
Fetch daily OHLCV data, calculate indicators + patterns, return as HTML table.
|
| 10 |
"""
|
| 11 |
try:
|
| 12 |
# --- Fetch historical data ---
|
| 13 |
-
df = yf.download(symbol + ".NS", period="
|
|
|
|
| 14 |
if df.empty:
|
| 15 |
return html_card("Error", f"No daily data found for {symbol}")
|
| 16 |
df.reset_index(inplace=True)
|
|
|
|
| 4 |
from ta_indi_pat import patterns, indicators
|
| 5 |
from common import html_card, wrap_html
|
| 6 |
|
| 7 |
+
def fetch_daily(symbol):
|
| 8 |
"""
|
| 9 |
Fetch daily OHLCV data, calculate indicators + patterns, return as HTML table.
|
| 10 |
"""
|
| 11 |
try:
|
| 12 |
# --- Fetch historical data ---
|
| 13 |
+
df = yf.download(symbol + ".NS", period="1y", interval="1d").round(2)
|
| 14 |
+
df.columns=df.co
|
| 15 |
if df.empty:
|
| 16 |
return html_card("Error", f"No daily data found for {symbol}")
|
| 17 |
df.reset_index(inplace=True)
|