tahatehrani commited on
Commit
72a5021
·
verified ·
1 Parent(s): b393745

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -21
app.py CHANGED
@@ -502,31 +502,31 @@ def main():
502
  buy_signal, sell_signal = generate_signals(data, None)
503
 
504
  # Sorting and categorizing news
505
- sort_by = st.radio("Sort News By", ("publishedAt", "relevancy", "popularity"), index=0)
506
- news = sorted(news, key=lambda x: x[sort_by])
 
 
 
 
 
507
 
508
- if language == "English":
509
- st.subheader(f"News for {crypto_symbol}")
510
- else:
511
- st.subheader(f"اخبار برای {crypto_symbol}")
512
-
513
  # Display news with confidence level
514
- buy_signal, sell_signal = generate_signals(data, news)
515
- if buy_signal:
516
- st.success(f"Buy Signal: {buy_signal}")
517
- if sell_signal:
518
- st.error(f"Sell Signal: {sell_signal}")
519
 
520
  # Paginate news
521
- page = st.slider("Select page", min_value=1, max_value=(len(news) // 5) + 1)
522
- news_to_display = news[(page - 1) * 5: page * 5]
523
-
524
- for article in news_to_display:
525
- st.write(f"Title: {article['title']}")
526
- st.write(f"Description: {article['description']}")
527
- st.write(f"Sentiment: {article['sentiment']}")
528
- st.write(f"Published At: {article['publishedAt']}")
529
- st.write(f"Read more: [Link]({article['url']})")
530
  else:
531
  if language == "English":
532
  st.warning("API key for NewsAPI is not set. Please contact the admin.")
 
502
  buy_signal, sell_signal = generate_signals(data, None)
503
 
504
  # Sorting and categorizing news
505
+ sort_by = st.radio("Sort News By", ("publishedAt", "relevancy", "popularity"), index=0)
506
+ news = sorted(news, key=lambda x: x[sort_by])
507
+
508
+ if language == "English":
509
+ st.subheader(f"News for {crypto_symbol}")
510
+ else:
511
+ st.subheader(f"اخبار برای {crypto_symbol}")
512
 
 
 
 
 
 
513
  # Display news with confidence level
514
+ buy_signal, sell_signal = generate_signals(data, news)
515
+ if buy_signal:
516
+ st.success(f"Buy Signal: {buy_signal}")
517
+ if sell_signal:
518
+ st.error(f"Sell Signal: {sell_signal}")
519
 
520
  # Paginate news
521
+ page = st.slider("Select page", min_value=1, max_value=(len(news) // 5) + 1)
522
+ news_to_display = news[(page - 1) * 5: page * 5]
523
+
524
+ for article in news_to_display:
525
+ st.write(f"Title: {article['title']}")
526
+ st.write(f"Description: {article['description']}")
527
+ st.write(f"Sentiment: {article['sentiment']}")
528
+ st.write(f"Published At: {article['publishedAt']}")
529
+ st.write(f"Read more: [Link]({article['url']})")
530
  else:
531
  if language == "English":
532
  st.warning("API key for NewsAPI is not set. Please contact the admin.")