Trebor1009 commited on
Commit
52bffe6
·
verified ·
1 Parent(s): 146209a

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +12 -22
src/streamlit_app.py CHANGED
@@ -601,7 +601,7 @@ def render_peak_detector():
601
 
602
 
603
  # =========================================================
604
- # TAB 3: SNIPER SCANNER (historical analog / triple-positive setup scanner)
605
  # =========================================================
606
 
607
  def sniper_rsi(series, period=14):
@@ -699,28 +699,18 @@ def get_sniper_ticker_data(ticker: str) -> pd.DataFrame:
699
  return df.dropna()
700
 
701
 
702
- @st.cache_data(ttl=24 * 3600, show_spinner="Fetching ticker universe...")
703
- def get_universe_tickers(include_russell: bool, extra_tickers: tuple):
704
- tickers = set()
705
  try:
706
- sp500 = pd.read_csv(
707
- "https://raw.githubusercontent.com/datasets/s-and-p-500-companies/master/data/constituents.csv"
708
- )["Symbol"].tolist()
709
- tickers.update(t.replace(".", "-") for t in sp500)
 
 
710
  except Exception as e:
711
- st.warning(f"Could not fetch S&P 500 list: {e}")
712
-
713
- if include_russell:
714
- try:
715
- russell = pd.read_csv(
716
- "https://raw.githubusercontent.com/ikoniaris/Russell2000/master/russell_2000_components.csv"
717
- )["Ticker"].tolist()
718
- tickers.update(t.replace(".", "-") for t in russell)
719
- except Exception as e:
720
- st.warning(f"Could not fetch Russell 2000 list: {e}")
721
-
722
- tickers.update(extra_tickers)
723
- return sorted(tickers)
724
 
725
 
726
  @st.cache_data(ttl=12 * 3600, show_spinner=False)
@@ -1215,7 +1205,7 @@ def render_signal_tracker():
1215
  # TAB 5: ROTATION MAP (relative strength / momentum vs benchmark)
1216
  # =========================================================
1217
 
1218
- DEFAULT_ROTATION_TICKERS = ["XLK", "XLF", "XLE", "XLV", "XLI", "NNE", "GPUS", "STRC", "MAIN", "DAN", "FICO", "FN"]
1219
 
1220
 
1221
  @st.cache_data(ttl=4 * 3600, show_spinner="Building rotation map...")
 
601
 
602
 
603
  # =========================================================
604
+ # TAB 3: BOTTOM SCANNER (historical analog / triple-positive setup scanner)
605
  # =========================================================
606
 
607
  def sniper_rsi(series, period=14):
 
699
  return df.dropna()
700
 
701
 
702
+ @st.cache_data(ttl=24 * 3600, show_spinner="Loading curated ticker list...")
703
+ def get_clean_premarket_universe():
 
704
  try:
705
+ local_path = hf_hub_download(
706
+ repo_id="Trebor1009/clean-premarket-data", repo_type="dataset",
707
+ filename="clean_premarket_data.csv", token=HF_TOKEN,
708
+ )
709
+ df = pd.read_csv(local_path, usecols=["Ticker"])
710
+ return sorted(df["Ticker"].dropna().unique().tolist())
711
  except Exception as e:
712
+ st.warning(f"Could not load curated ticker list from Trebor1009/clean-premarket-data: {e}")
713
+ return []
 
 
 
 
 
 
 
 
 
 
 
714
 
715
 
716
  @st.cache_data(ttl=12 * 3600, show_spinner=False)
 
1205
  # TAB 5: ROTATION MAP (relative strength / momentum vs benchmark)
1206
  # =========================================================
1207
 
1208
+ DEFAULT_ROTATION_TICKERS = ["XLK", "XLF", "XLE", "XLV", "XLI", "GC=F", "BTC-USD", "O", "MAIN", "DAN", "FICO", "FN"]
1209
 
1210
 
1211
  @st.cache_data(ttl=4 * 3600, show_spinner="Building rotation map...")