eshan6704 commited on
Commit
c0e38c4
·
verified ·
1 Parent(s): f76d39a

Update index.py

Browse files
Files changed (1) hide show
  1. index.py +2 -2
index.py CHANGED
@@ -7,7 +7,7 @@ from datetime import datetime, timedelta
7
  from common import html_card, wrap_html
8
  from ta_indi_pat import talib_df
9
  import datetime
10
-
11
 
12
 
13
  def fetch_index(max_rows=200):
@@ -21,7 +21,7 @@ def fetch_index(max_rows=200):
21
  # ----------------------------------
22
  # Fetch NIFTY 50 data
23
  # ----------------------------------
24
- df = yf.download("^NSEI", period="1y", interval="1d").round(2)
25
 
26
  if df.empty:
27
  return html_card("Error", "No data found for NIFTY 50 (^NSEI).")
 
7
  from common import html_card, wrap_html
8
  from ta_indi_pat import talib_df
9
  import datetime
10
+ import nse
11
 
12
 
13
  def fetch_index(max_rows=200):
 
21
  # ----------------------------------
22
  # Fetch NIFTY 50 data
23
  # ----------------------------------
24
+ df = nse_preopen_df()
25
 
26
  if df.empty:
27
  return html_card("Error", "No data found for NIFTY 50 (^NSEI).")