riteshcp commited on
Commit
a040c5e
·
verified ·
1 Parent(s): 97433f3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -15
app.py CHANGED
@@ -33,16 +33,6 @@ TICKER_SYMBOLS = [
33
  "UPL", "VEDL", "WIPRO", "YESBANK", "ZEEL", "ZOMATO", "ZYDUSLIFE"
34
  ]
35
 
36
- # Load ticker symbols from an uploaded CSV file or use fallback list
37
- @st.cache_data
38
- def load_ticker_list(file):
39
- try:
40
- stock_df = pd.read_csv(file)
41
- return stock_df['Symbol'].tolist()
42
- except Exception as e:
43
- st.error(f"Error loading ticker list: {str(e)}")
44
- return TICKER_SYMBOLS
45
-
46
  # Function to check if the market is open
47
  def is_market_open():
48
  now = datetime.now().time()
@@ -88,13 +78,12 @@ def get_stock_data(symbol):
88
 
89
  # Streamlit UI
90
  def main():
91
- st.title("MarketCompass: Support and Resistance Level Calculator")
92
 
93
- # File uploader for custom ticker list
94
- uploaded_file = st.file_uploader("Upload CSV of Stock Symbols", type="csv")
95
- ticker_list = load_ticker_list(uploaded_file) if uploaded_file else TICKER_SYMBOLS
96
 
97
- # Ticker selection
98
  symbol = st.selectbox("Select a Stock Symbol", ticker_list)
99
 
100
  # Check if the market is currently open and display a warning
 
33
  "UPL", "VEDL", "WIPRO", "YESBANK", "ZEEL", "ZOMATO", "ZYDUSLIFE"
34
  ]
35
 
 
 
 
 
 
 
 
 
 
 
36
  # Function to check if the market is open
37
  def is_market_open():
38
  now = datetime.now().time()
 
78
 
79
  # Streamlit UI
80
  def main():
81
+ st.title("Support and Resistance Level Calculator for NIFTY 500 Stocks")
82
 
83
+ # Load ticker symbols
84
+ ticker_list = TICKER_SYMBOLS
 
85
 
86
+ # Select a ticker from the list
87
  symbol = st.selectbox("Select a Stock Symbol", ticker_list)
88
 
89
  # Check if the market is currently open and display a warning