File size: 5,672 Bytes
e1338ee
 
f7323a3
 
e1338ee
7ca0d9b
 
e1338ee
 
5b2d07d
e1338ee
 
f7323a3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0d5d8e1
ea78511
 
 
 
 
0d5d8e1
 
 
 
 
 
 
12176df
f7323a3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12176df
f7323a3
 
 
 
12176df
 
 
 
 
f7323a3
 
12176df
 
f7323a3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
---
title: FinancialPlatform
emoji: πŸ“ˆ
colorFrom: blue
colorTo: green
sdk: docker
app_port: 7860
pinned: false
license: apache-2.0
short_description: Multi-asset analysis with OpenBB and AI insights
---

# Financial Analysis Platform

A comprehensive multi-asset financial analysis platform built with Streamlit, providing real-time data, technical indicators, and AI-powered insights.

## Features

### πŸ“ˆ Stock Analysis
- Real-time stock price data from OpenBB
- Technical indicators (SMA, EMA, RSI)
- Company profile and financial statements
- Revenue and net income trends
- TradingView chart integration
- Profitability metrics analysis

### β‚Ώ Cryptocurrency (Coming Soon)
- Real-time cryptocurrency prices
- Market cap and 24h volume
- Technical indicators for crypto assets
- TradingView crypto charts

### πŸ’± Forex Trading (Coming Soon)
- Foreign exchange rate analysis
- Major, minor, and exotic pairs
- Pip calculator
- Economic calendar integration

### πŸ” Market Screener (Coming Soon)
- Multi-criteria filtering
- Technical pattern recognition
- Sort by volume, price change, RSI
- Export results to CSV

### πŸ“° News & AI Dashboard βœ… LIVE
- **23 Premium Sources** across 4 tiers for comprehensive coverage
  - **Tier 1**: Bloomberg (Γ—2), Reuters, FT, WSJ, The Economist, CNBC, MarketWatch (8 sources)
  - **Tier 2**: BBC World, AFP, Al Jazeera, Politico, DW News (5 sources)
  - **Tier 3**: Federal Reserve (2.0x), ECB (2.0x), Lagarde, BoE, IMF, World Bank, US Treasury (7 sources)
  - **Tier 4**: Zero Hedge, First Squawk, Live Squawk (3 sources)
- **Low-latency monitoring** with 3-minute cache for trading decisions
- **Intelligent categorization**: Macro, Markets, Geopolitical
- **Professional sentiment analysis** (Positive/Negative/Neutral)
- **Weighted impact scoring**: Source credibility Γ— engagement Γ— recency
- **Breaking news detection** with instant alerts and priority display
- **Smart filtering** by category, sentiment, and impact level
- **Auto-refresh mode** for continuous monitoring during trading hours
- Powered by **Twikit** for real-time Twitter/X intelligence (free, no API costs)

## Installation

1. Clone the repository:
```bash
git clone <repository-url>
cd FinancialPlatform
```

2. Install dependencies:
```bash
pip install -r requirements.txt
```

3. Create a `.env` file based on `.env.example`:
```bash
cp .env.example .env
```

4. Configure your API keys and Twitter credentials in `.env`:
```
DEEPSEEK_API_KEY=your-key-here
NEWS_SERVICE_URL=http://localhost:5000
ALPHA_VANTAGE_KEY=your-key-here

# Twitter/X Credentials (required for real-time news monitoring)
TWITTER_USERNAME=your-twitter-username
TWITTER_EMAIL=your-email@example.com
TWITTER_PASSWORD=your-password
```

**Note**: Twitter credentials are required for real-time news monitoring. Without credentials, the system will use demo/mock data.

## Usage

Run the application:
```bash
streamlit run app/app.py
```

The application will open in your default web browser at `http://localhost:8501`.

## Project Structure

```
FinancialPlatform/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ app.py                      # Main landing page
β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ 01_Stocks.py           # Stock analysis page
β”‚   β”‚   β”œβ”€β”€ 02_Crypto.py           # Cryptocurrency analysis
β”‚   β”‚   β”œβ”€β”€ 03_Forex.py            # Forex analysis
β”‚   β”‚   β”œβ”€β”€ 04_Screener.py         # Market screener
β”‚   β”‚   └── 05_Dashboard.py        # News & AI dashboard
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ chart.py               # Chart creation utilities
β”‚   β”‚   β”œβ”€β”€ data_sources.py        # Data fetching functions
β”‚   β”‚   β”œβ”€β”€ ui.py                  # UI component functions
β”‚   β”‚   └── styles.py              # Dark theme CSS
β”‚   └── utils/
β”‚       β”œβ”€β”€ config.py              # Configuration management
β”‚       └── formatters.py          # Data formatting utilities
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ .env.example
└── README.md
```

## Technology Stack

- **Frontend**: Streamlit
- **Data Sources**: OpenBB SDK, yfinance
- **Charting**: Plotly, TradingView widgets
- **AI**: DeepSeek API (planned)
- **Styling**: Custom CSS with dark theme

## Features in Development

- [ ] Cryptocurrency data integration (Binance API)
- [ ] Forex data integration (Alpha Vantage)
- [ ] Market screener with advanced filters
- [ ] News aggregation service
- [ ] AI-powered trading insights
- [ ] Sentiment analysis
- [ ] Additional technical indicators (MACD, Bollinger Bands, ATR)

## Configuration

### Environment Variables

- `DEEPSEEK_API_KEY`: API key for AI-powered insights
- `NEWS_SERVICE_URL`: URL for news aggregation service
- `ALPHA_VANTAGE_KEY`: API key for forex data (optional)

### Cache Settings

Data caching is configured in `utils/config.py`:
- Price data: 1 hour TTL
- Fundamental data: 24 hours TTL
- News data: 15 minutes TTL

## Deployment

### HuggingFace Spaces

This application is optimized for deployment on HuggingFace Spaces:

1. Create a new Space on HuggingFace
2. Set the Space type to "Streamlit"
3. Add your environment variables in the Space settings:
   - `DEEPSEEK_API_KEY`
   - `NEWS_SERVICE_URL`
   - `ALPHA_VANTAGE_KEY`
4. Push your code to the Space repository

### Local Development

For local development with hot-reload:
```bash
streamlit run app/app.py --server.runOnSave=true
```

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## License

Apache 2.0 License

## Acknowledgments

- OpenBB for financial data API
- TradingView for chart widgets
- Streamlit for the amazing web framework