Update app.py
Browse files
app.py
CHANGED
@@ -386,19 +386,19 @@ elif activities=="News Sentiment":
|
|
386 |
# st.write(docs)
|
387 |
st.divider()
|
388 |
|
389 |
-
llm_prompt_template = """You are an expert Stock Market Trader specializing in stock market insights derived from fundamental analysis, analytical trends, profit-based evaluations, news indicators from different sites and detailed company financials.
|
|
|
390 |
|
391 |
Context:
|
392 |
{input_documents}
|
393 |
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
***Format your output as JSON*** with the following structure:
|
403 |
|
404 |
```json
|
@@ -440,8 +440,6 @@ elif activities=="News Sentiment":
|
|
440 |
parsed_data = json.loads(raw_text)
|
441 |
top_picks = parsed_data.get("top_picks", [])
|
442 |
|
443 |
-
st.set_page_config(page_title="Stock Insights", layout="wide")
|
444 |
-
st.title("📊 Weekly Stock Insights from News")
|
445 |
|
446 |
# Layout
|
447 |
for stock in top_picks:
|
@@ -461,7 +459,6 @@ elif activities=="News Sentiment":
|
|
461 |
st.markdown(f"**🚦 Action:** `{stock['action']}`")
|
462 |
|
463 |
st.divider()
|
464 |
-
st.caption("Data analyzed using LLM from TradingView India news feed.")
|
465 |
|
466 |
|
467 |
|
|
|
386 |
# st.write(docs)
|
387 |
st.divider()
|
388 |
|
389 |
+
llm_prompt_template = """You are an expert Stock Market Trader specializing in stock market insights derived from fundamental analysis, analytical trends, profit-based evaluations, news indicators from different sites and detailed company financials.
|
390 |
+
You will receive stock market news articles or stocks in news from various news websites which have India stock news feed. For the below context/input_documents, perform the following tasks:
|
391 |
|
392 |
Context:
|
393 |
{input_documents}
|
394 |
|
395 |
+
1. **Top picks**: After analyzing all provided data, rank the top 5-10 stocks to look at this week, including tickers, current sentiment, and why they made the list.
|
396 |
+
2. **Identify the stock(s)** mentioned (by ticker and company name).
|
397 |
+
3. **Sentiment analysis**: classify as Bullish, Bearish, or Neutral.
|
398 |
+
4. **Extract critical news**: What is the main event or update? (e.g., earnings beat, regulatory approval, management change, major contract or macro impact).
|
399 |
+
5. **Summarize impact**: Briefly explain how this news might affect stock price and investor behavior (e.g., “could boost investor confidence”, “sign indicates profit pressure”, etc.).
|
400 |
+
6. **Actionable signal**: Based on the sentiment and news, suggest whether this is a “Buy”, “Sell”, “Hold”, or “Watch” recommendation, and the rationale.
|
401 |
+
|
|
|
402 |
***Format your output as JSON*** with the following structure:
|
403 |
|
404 |
```json
|
|
|
440 |
parsed_data = json.loads(raw_text)
|
441 |
top_picks = parsed_data.get("top_picks", [])
|
442 |
|
|
|
|
|
443 |
|
444 |
# Layout
|
445 |
for stock in top_picks:
|
|
|
459 |
st.markdown(f"**🚦 Action:** `{stock['action']}`")
|
460 |
|
461 |
st.divider()
|
|
|
462 |
|
463 |
|
464 |
|