Edwin Salguero commited on
Commit
81964c7
Β·
1 Parent(s): 6d01b44

fix: add YAML metadata to README.md for Hugging Face repository card

Browse files
Files changed (1) hide show
  1. README.md +38 -542
README.md CHANGED
@@ -1,560 +1,56 @@
1
- # Algorithmic Trading System with FinRL and Alpaca Integration
 
 
 
 
 
 
 
 
 
 
2
 
3
- A sophisticated algorithmic trading system that combines reinforcement learning (FinRL) with real-time market data and order execution through Alpaca Markets. This system supports both paper trading and live trading with advanced risk management and technical analysis.
4
 
5
- ## πŸš€ Features
6
 
7
- ### Core Trading System
8
- - **Multi-source Data Ingestion**: CSV files, Alpaca Markets API, and synthetic data generation
9
- - **Technical Analysis**: 20+ technical indicators including RSI, MACD, Bollinger Bands, and more
10
- - **Risk Management**: Position sizing, drawdown limits, and portfolio protection
11
- - **Real-time Execution**: Live order placement and portfolio monitoring
12
 
13
- ### FinRL Reinforcement Learning
14
- - **Multiple Algorithms**: PPO, A2C, DDPG, and TD3 support
15
- - **Custom Trading Environment**: Gymnasium-compatible environment for RL training
16
- - **Real-time Integration**: Can execute real trades during training and inference
17
- - **Model Persistence**: Save and load trained models for consistent performance
 
 
18
 
19
- ### Alpaca Broker Integration
20
- - **Paper Trading**: Risk-free testing with virtual money
21
- - **Live Trading**: Real market execution (use with caution!)
22
- - **Market Data**: Real-time and historical data from Alpaca
23
- - **Account Management**: Portfolio monitoring and position tracking
24
- - **Order Types**: Market orders, limit orders, and order cancellation
25
 
26
- ### 🎨 Comprehensive UI System
27
- - **Streamlit UI**: Quick prototyping and data science workflows
28
- - **Dash UI**: Enterprise-grade interactive dashboards
29
- - **Jupyter UI**: Interactive notebook-based interfaces
30
- - **WebSocket API**: Real-time trading data streaming
31
- - **Multi-interface Support**: Choose the right UI for your needs
32
-
33
- ### Advanced Features
34
- - **Docker Support**: Containerized deployment for consistency
35
- - **Comprehensive Logging**: Detailed logs for debugging and performance analysis
36
- - **Backtesting Engine**: Historical performance evaluation
37
- - **Live Trading Simulation**: Real-time trading with configurable duration
38
- - **Performance Metrics**: Returns, Sharpe ratio, drawdown analysis
39
-
40
- ## πŸ“‹ Prerequisites
41
-
42
- - Python 3.8+
43
- - Alpaca Markets account (free paper trading available)
44
- - Docker (optional, for containerized deployment)
45
-
46
- ## πŸ› οΈ Installation
47
-
48
- ### 1. Clone the Repository
49
  ```bash
50
- git clone https://github.com/ParallelLLC/algorithmic_trading.git
 
51
  cd algorithmic_trading
52
- ```
53
 
54
- ### 2. Install Dependencies
55
- ```bash
56
  pip install -r requirements.txt
57
- ```
58
-
59
- ### 3. Set Up Alpaca API Credentials
60
- Create a `.env` file in the project root:
61
- ```bash
62
- cp env.example .env
63
- ```
64
-
65
- Edit `.env` with your Alpaca credentials:
66
- ```env
67
- # Get these from https://app.alpaca.markets/paper/dashboard/overview
68
- ALPACA_API_KEY=your_paper_api_key_here
69
- ALPACA_SECRET_KEY=your_paper_secret_key_here
70
-
71
- # For live trading (use with caution!)
72
- # ALPACA_API_KEY=your_live_api_key_here
73
- # ALPACA_SECRET_KEY=your_live_secret_key_here
74
- ```
75
-
76
- ### 4. Configure Trading Parameters
77
- Edit `config.yaml` to customize your trading strategy:
78
- ```yaml
79
- # Data source configuration
80
- data_source:
81
- type: 'alpaca' # Options: 'alpaca', 'csv', 'synthetic'
82
-
83
- # Trading parameters
84
- trading:
85
- symbol: 'AAPL'
86
- timeframe: '1m'
87
- capital: 100000
88
-
89
- # Risk management
90
- risk:
91
- max_position: 100
92
- max_drawdown: 0.05
93
-
94
- # Execution settings
95
- execution:
96
- broker_api: 'alpaca_paper' # Options: 'paper', 'alpaca_paper', 'alpaca_live'
97
- order_size: 10
98
-
99
- # FinRL configuration
100
- finrl:
101
- algorithm: 'PPO'
102
- learning_rate: 0.0003
103
- training:
104
- total_timesteps: 100000
105
- save_best_model: true
106
- ```
107
-
108
- ## πŸš€ Quick Start
109
-
110
- ### 1. Launch the UI (Recommended)
111
- ```bash
112
- # Launch Streamlit UI (best for beginners)
113
- python ui_launcher.py streamlit
114
-
115
- # Launch Dash UI (best for production)
116
- python ui_launcher.py dash
117
-
118
- # Launch Jupyter Lab
119
- python ui_launcher.py jupyter
120
-
121
- # Launch all UIs
122
- python ui_launcher.py all
123
- ```
124
-
125
- ### 2. Run the Demo
126
- ```bash
127
- python demo.py
128
- ```
129
-
130
- This will:
131
- - Test data ingestion from Alpaca
132
- - Demonstrate FinRL training
133
- - Show trading workflow execution
134
- - Run backtesting on historical data
135
-
136
- ### 3. Start Paper Trading
137
- ```bash
138
- python -m agentic_ai_system.main --mode live --duration 60
139
- ```
140
-
141
- ### 4. Run Backtesting
142
- ```bash
143
- python -m agentic_ai_system.main --mode backtest --start-date 2024-01-01 --end-date 2024-01-31
144
- ```
145
-
146
- ## πŸ“Š Usage Examples
147
-
148
- ### Basic Trading Workflow
149
- ```python
150
- from agentic_ai_system.main import load_config
151
- from agentic_ai_system.orchestrator import run
152
-
153
- # Load configuration
154
- config = load_config()
155
-
156
- # Run single trading cycle
157
- result = run(config)
158
- print(f"Trading result: {result}")
159
- ```
160
-
161
- ### FinRL Training
162
- ```python
163
- from agentic_ai_system.finrl_agent import FinRLAgent, FinRLConfig
164
- from agentic_ai_system.data_ingestion import load_data
165
-
166
- # Load data and configuration
167
- config = load_config()
168
- data = load_data(config)
169
-
170
- # Initialize FinRL agent
171
- finrl_config = FinRLConfig(algorithm='PPO', learning_rate=0.0003)
172
- agent = FinRLAgent(finrl_config)
173
-
174
- # Train the agent
175
- result = agent.train(
176
- data=data,
177
- config=config,
178
- total_timesteps=100000,
179
- use_real_broker=False # Use simulation for training
180
- )
181
-
182
- print(f"Training completed: {result}")
183
- ```
184
-
185
- ### Alpaca Integration
186
- ```python
187
- from agentic_ai_system.alpaca_broker import AlpacaBroker
188
-
189
- # Initialize Alpaca broker
190
- config = load_config()
191
- broker = AlpacaBroker(config)
192
-
193
- # Get account information
194
- account_info = broker.get_account_info()
195
- print(f"Account balance: ${account_info['buying_power']:,.2f}")
196
-
197
- # Place a market order
198
- result = broker.place_market_order(
199
- symbol='AAPL',
200
- quantity=10,
201
- side='buy'
202
- )
203
- print(f"Order result: {result}")
204
- ```
205
-
206
- ### Real-time Trading with FinRL
207
- ```python
208
- from agentic_ai_system.finrl_agent import FinRLAgent
209
-
210
- # Load trained model
211
- agent = FinRLAgent(FinRLConfig())
212
- agent.model = agent._load_model('models/finrl_best/best_model', config)
213
-
214
- # Make predictions with real execution
215
- result = agent.predict(
216
- data=recent_data,
217
- config=config,
218
- use_real_broker=True # Execute real trades!
219
- )
220
- ```
221
-
222
- ## πŸ—οΈ Architecture
223
-
224
- ### System Components
225
-
226
- ```
227
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
228
- β”‚ Data Sources β”‚ β”‚ Strategy Agent β”‚ β”‚ Execution Agent β”‚
229
- β”‚ β”‚ β”‚ β”‚ β”‚ β”‚
230
- β”‚ β€’ Alpaca API │───▢│ β€’ Technical │───▢│ β€’ Alpaca Broker β”‚
231
- β”‚ β€’ CSV Files β”‚ β”‚ Indicators β”‚ β”‚ β€’ Order Mgmt β”‚
232
- β”‚ β€’ Synthetic β”‚ β”‚ β€’ Signal Gen β”‚ β”‚ β€’ Risk Control β”‚
233
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
234
- β”‚ β”‚ β”‚
235
- β–Ό β–Ό β–Ό
236
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
237
- β”‚ Data Ingestion β”‚ β”‚ FinRL Agent β”‚ β”‚ Portfolio β”‚
238
- β”‚ β”‚ β”‚ β”‚ β”‚ Management β”‚
239
- β”‚ β€’ Validation β”‚ β”‚ β€’ PPO/A2C/DDPG β”‚ β”‚ β€’ Positions β”‚
240
- β”‚ β€’ Indicators β”‚ β”‚ β€’ Training β”‚ β”‚ β€’ P&L Tracking β”‚
241
- β”‚ β€’ Preprocessing β”‚ β”‚ β€’ Prediction β”‚ β”‚ β€’ Risk Metrics β”‚
242
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
243
- ```
244
-
245
- ### Data Flow
246
-
247
- 1. **Data Ingestion**: Market data from Alpaca, CSV, or synthetic sources
248
- 2. **Preprocessing**: Technical indicators, data validation, and feature engineering
249
- 3. **Strategy Generation**: Traditional technical analysis or FinRL predictions
250
- 4. **Risk Management**: Position sizing and portfolio protection
251
- 5. **Order Execution**: Real-time order placement through Alpaca
252
- 6. **Performance Tracking**: Continuous monitoring and logging
253
-
254
- ## πŸ“ Project Directory Structure
255
-
256
- ```
257
- algorithmic_trading/
258
- β”œβ”€β”€ πŸ“„ README.md # Project documentation
259
- β”œβ”€β”€ πŸ“„ LICENSE # Alpaca 2 License
260
- β”œβ”€β”€ πŸ“„ requirements.txt # Python dependencies
261
- β”œβ”€β”€ πŸ“„ config.yaml # Main configuration file
262
- β”œβ”€β”€ πŸ“„ env.example # Environment variables template
263
- β”œβ”€β”€ πŸ“„ .gitignore # Git ignore rules
264
- β”œβ”€β”€ πŸ“„ pytest.ini # Test configuration
265
- β”‚
266
- β”œβ”€β”€ 🐳 Docker/
267
- β”‚ β”œβ”€β”€ πŸ“„ Dockerfile # Container definition
268
- β”‚ β”œβ”€β”€ πŸ“„ docker-entrypoint.sh # Container startup script
269
- β”‚ β”œβ”€β”€ πŸ“„ .dockerignore # Docker ignore rules
270
- β”‚ β”œβ”€β”€ πŸ“„ docker-compose.yml # Default compose file
271
- β”‚ β”œβ”€β”€ πŸ“„ docker-compose.dev.yml # Development environment
272
- β”‚ β”œβ”€β”€ πŸ“„ docker-compose.prod.yml # Production environment
273
- β”‚ └── πŸ“„ docker-compose.hub.yml # Docker Hub deployment
274
- β”‚
275
- β”œβ”€β”€ πŸ€– agentic_ai_system/ # Core AI trading system
276
- β”‚ β”œβ”€β”€ πŸ“„ main.py # Main entry point
277
- β”‚ β”œβ”€β”€ πŸ“„ orchestrator.py # System coordination
278
- β”‚ β”œβ”€β”€ πŸ“„ agent_base.py # Base agent class
279
- β”‚ β”œβ”€β”€ πŸ“„ data_ingestion.py # Market data processing
280
- β”‚ β”œβ”€β”€ πŸ“„ strategy_agent.py # Trading strategy logic
281
- β”‚ β”œβ”€β”€ πŸ“„ execution_agent.py # Order execution
282
- β”‚ β”œβ”€β”€ πŸ“„ finrl_agent.py # FinRL reinforcement learning
283
- β”‚ β”œβ”€β”€ πŸ“„ alpaca_broker.py # Alpaca API integration
284
- β”‚ β”œβ”€β”€ πŸ“„ synthetic_data_generator.py # Test data generation
285
- β”‚ └── πŸ“„ logger_config.py # Logging configuration
286
- β”‚
287
- β”œβ”€β”€ 🎨 ui/ # User interface system
288
- β”‚ β”œβ”€β”€ πŸ“„ __init__.py # UI package initialization
289
- β”‚ β”œβ”€β”€ πŸ“„ streamlit_app.py # Streamlit web application
290
- β”‚ β”œβ”€β”€ πŸ“„ dash_app.py # Dash enterprise dashboard
291
- β”‚ β”œβ”€β”€ πŸ“„ jupyter_widgets.py # Jupyter interactive widgets
292
- β”‚ └── πŸ“„ websocket_server.py # Real-time WebSocket server
293
- β”‚
294
- β”œβ”€β”€ πŸ§ͺ tests/ # Test suite
295
- β”‚ β”œβ”€β”€ πŸ“„ __init__.py
296
- β”‚ β”œβ”€β”€ πŸ“„ test_data_ingestion.py
297
- β”‚ β”œβ”€β”€ πŸ“„ test_strategy_agent.py
298
- β”‚ β”œβ”€β”€ πŸ“„ test_execution_agent.py
299
- β”‚ β”œβ”€β”€ πŸ“„ test_finrl_agent.py
300
- β”‚ β”œβ”€β”€ πŸ“„ test_synthetic_data_generator.py
301
- β”‚ └── πŸ“„ test_integration.py
302
- β”‚
303
- β”œβ”€β”€ πŸ“Š data/ # Market data storage
304
- β”‚ └── πŸ“„ synthetic_market_data.csv
305
- β”‚
306
- β”œβ”€β”€ 🧠 models/ # Trained AI models
307
- β”‚ └── πŸ“ finrl_best/ # Best FinRL models
308
- β”‚
309
- β”œβ”€β”€ πŸ“ˆ plots/ # Generated charts/visualizations
310
- β”‚
311
- β”œβ”€β”€ πŸ“ logs/ # System logs
312
- β”‚ β”œβ”€β”€ πŸ“„ trading_system.log
313
- β”‚ β”œβ”€β”€ πŸ“„ trading.log
314
- β”‚ β”œβ”€β”€ πŸ“„ performance.log
315
- β”‚ β”œβ”€β”€ πŸ“„ errors.log
316
- β”‚ β”œβ”€β”€ πŸ“ finrl_tensorboard/ # FinRL training logs
317
- β”‚ └── πŸ“ finrl_eval/ # Model evaluation logs
318
- β”‚
319
- β”œβ”€β”€ πŸ”§ scripts/ # Utility scripts
320
- β”‚ β”œβ”€β”€ πŸ“„ docker-build.sh # Docker build automation
321
- β”‚ └── πŸ“„ docker-hub-deploy.sh # Docker Hub deployment
322
- β”‚
323
- β”œβ”€β”€ πŸ“„ demo.py # Main demo script
324
- β”œβ”€β”€ πŸ“„ finrl_demo.py # FinRL-specific demo
325
- β”œβ”€β”€ πŸ“„ ui_launcher.py # UI launcher script
326
- β”œβ”€β”€ πŸ“„ UI_SETUP.md # UI setup documentation
327
- β”œβ”€β”€ πŸ“„ DOCKER_HUB_SETUP.md # Docker Hub documentation
328
- β”‚
329
- └── 🐍 .venv/ # Python virtual environment
330
- ```
331
-
332
- ### πŸ—οΈ Architecture Overview
333
-
334
- #### **Core Components:**
335
- - **Data Layer**: Market data ingestion and preprocessing
336
- - **Strategy Layer**: Technical analysis and signal generation
337
- - **AI Layer**: FinRL reinforcement learning agents
338
- - **Execution Layer**: Order management and broker integration
339
- - **Orchestration**: System coordination and workflow management
340
-
341
- #### **Key Features:**
342
- - **Modular Design**: Each component is independent and testable
343
- - **Docker Support**: Complete containerization for deployment
344
- - **Testing**: Comprehensive test suite for all components
345
- - **Logging**: Detailed logging for monitoring and debugging
346
- - **Configuration**: Centralized configuration management
347
- - **Documentation**: Extensive documentation and examples
348
-
349
- #### **Development Workflow:**
350
- 1. **Data Ingestion** β†’ Market data from Alpaca/CSV/synthetic sources
351
- 2. **Strategy Generation** β†’ Technical indicators and FinRL predictions
352
- 3. **Risk Management** β†’ Position sizing and portfolio protection
353
- 4. **Order Execution** β†’ Real-time trading through Alpaca
354
- 5. **Performance Tracking** β†’ Continuous monitoring and logging
355
-
356
- ## πŸ”§ Configuration
357
-
358
- ### Alpaca Settings
359
- ```yaml
360
- alpaca:
361
- api_key: '' # Set via environment variable
362
- secret_key: '' # Set via environment variable
363
- paper_trading: true
364
- base_url: 'https://paper-api.alpaca.markets'
365
- live_url: 'https://api.alpaca.markets'
366
- data_url: 'https://data.alpaca.markets'
367
- account_type: 'paper' # 'paper' or 'live'
368
- ```
369
-
370
- ### FinRL Settings
371
- ```yaml
372
- finrl:
373
- algorithm: 'PPO' # PPO, A2C, DDPG, TD3
374
- learning_rate: 0.0003
375
- batch_size: 64
376
- buffer_size: 1000000
377
- training:
378
- total_timesteps: 100000
379
- eval_freq: 10000
380
- save_best_model: true
381
- model_save_path: 'models/finrl_best/'
382
- inference:
383
- use_trained_model: false
384
- model_path: 'models/finrl_best/best_model'
385
- ```
386
 
387
- ### Risk Management
388
- ```yaml
389
- risk:
390
- max_position: 100
391
- max_drawdown: 0.05
392
- stop_loss: 0.02
393
- take_profit: 0.05
394
  ```
395
 
396
- ## 🎨 User Interface System
397
-
398
- The project includes a comprehensive UI system with multiple interface options:
399
-
400
- ### Available UIs
401
-
402
- #### **Streamlit UI** (Recommended for beginners)
403
- - **URL**: http://localhost:8501
404
- - **Features**: Interactive widgets, real-time data visualization, easy configuration
405
- - **Best for**: Data scientists, quick experiments, rapid prototyping
406
-
407
- #### **Dash UI** (Recommended for production)
408
- - **URL**: http://localhost:8050
409
- - **Features**: Enterprise-grade dashboards, advanced charts, professional styling
410
- - **Best for**: Production dashboards, real-time monitoring, complex analytics
411
-
412
- #### **Jupyter UI** (For research)
413
- - **URL**: http://localhost:8888
414
- - **Features**: Interactive notebooks, code execution, rich documentation
415
- - **Best for**: Research, experimentation, educational purposes
416
-
417
- #### **WebSocket API** (For developers)
418
- - **URL**: ws://localhost:8765
419
- - **Features**: Real-time data streaming, trading signals, portfolio updates
420
- - **Best for**: Real-time trading signals, live data streaming
421
-
422
- ### Quick UI Launch
423
- ```bash
424
- # Launch individual UIs
425
- python ui_launcher.py streamlit # Streamlit UI
426
- python ui_launcher.py dash # Dash UI
427
- python ui_launcher.py jupyter # Jupyter Lab
428
- python ui_launcher.py websocket # WebSocket server
429
-
430
- # Launch all UIs at once
431
- python ui_launcher.py all
432
- ```
433
-
434
- ### UI Features
435
- - **Real-time Data Visualization**: Live market data charts and indicators
436
- - **Portfolio Monitoring**: Real-time portfolio value and P&L tracking
437
- - **Trading Controls**: Start/stop trading, backtesting, risk management
438
- - **FinRL Training**: Interactive model training and evaluation
439
- - **Alpaca Integration**: Account management and order execution
440
- - **Configuration Management**: Easy parameter tuning and strategy setup
441
-
442
- For detailed UI documentation, see [UI_SETUP.md](UI_SETUP.md).
443
-
444
- ## πŸ“ˆ Performance Monitoring
445
-
446
- ### Logging
447
- The system provides comprehensive logging:
448
- - `logs/trading_system.log`: Main system logs
449
- - `logs/trading.log`: Trading-specific events
450
- - `logs/performance.log`: Performance metrics
451
- - `logs/finrl_tensorboard/`: FinRL training logs
452
-
453
- ### Metrics Tracked
454
- - Portfolio value and returns
455
- - Trade execution statistics
456
- - Risk metrics (Sharpe ratio, drawdown)
457
- - FinRL training progress
458
- - Alpaca account status
459
-
460
- ### Real-time Monitoring
461
- ```python
462
- # Get account information
463
- account_info = broker.get_account_info()
464
- print(f"Portfolio Value: ${account_info['portfolio_value']:,.2f}")
465
-
466
- # Get current positions
467
- positions = broker.get_positions()
468
- for pos in positions:
469
- print(f"{pos['symbol']}: {pos['quantity']} shares")
470
-
471
- # Check market status
472
- market_open = broker.is_market_open()
473
- print(f"Market: {'OPEN' if market_open else 'CLOSED'}")
474
- ```
475
-
476
- ## 🐳 Docker Deployment
477
-
478
- ### Build and Run
479
- ```bash
480
- # Build the image
481
- docker build -t algorithmic-trading .
482
-
483
- # Run with environment variables
484
- docker run -it --env-file .env algorithmic-trading
485
-
486
- # Run with Jupyter Lab for development
487
- docker-compose -f docker-compose.dev.yml up
488
- ```
489
-
490
- ### Production Deployment
491
- ```bash
492
- # Use production compose file
493
- docker-compose -f docker-compose.prod.yml up -d
494
-
495
- # Monitor logs
496
- docker-compose -f docker-compose.prod.yml logs -f
497
- ```
498
-
499
- ## πŸ§ͺ Testing
500
-
501
- ### Run All Tests
502
- ```bash
503
- pytest tests/ -v
504
- ```
505
-
506
- ### Test Specific Components
507
- ```bash
508
- # Test Alpaca integration
509
- pytest tests/test_alpaca_integration.py -v
510
-
511
- # Test FinRL agent
512
- pytest tests/test_finrl_agent.py -v
513
-
514
- # Test trading workflow
515
- pytest tests/test_integration.py -v
516
- ```
517
-
518
- ## ⚠️ Important Notes
519
-
520
- ### Paper Trading vs Live Trading
521
- - **Paper Trading**: Uses virtual money, safe for testing
522
- - **Live Trading**: Uses real money, use with extreme caution
523
- - Always test strategies thoroughly in paper trading before going live
524
-
525
- ### Risk Management
526
- - Set appropriate position limits and drawdown thresholds
527
- - Monitor your portfolio regularly
528
- - Use stop-loss orders to limit potential losses
529
- - Never risk more than you can afford to lose
530
-
531
- ### API Rate Limits
532
- - Alpaca has rate limits on API calls
533
- - The system includes built-in delays to respect these limits
534
- - Monitor your API usage in the Alpaca dashboard
535
-
536
- ## 🀝 Contributing
537
-
538
- 1. Fork the repository
539
- 2. Create a feature branch
540
- 3. Make your changes
541
- 4. Add tests for new functionality
542
- 5. Submit a pull request
543
-
544
- ## πŸ“„ License
545
 
546
- This project is licensed under the Apache 2 License - see the LICENSE file for details.
 
 
 
547
 
548
- ## πŸ†˜ Support
549
 
550
- - **Documentation**: Check the logs and configuration files
551
- - **Issues**: Report bugs and feature requests on GitHub
552
- - **Alpaca Support**: Contact Alpaca for API-related issues
553
- - **Community**: Join our Discord/Telegram for discussions
554
 
555
- ## πŸ”— Useful Links
556
 
557
- - [Alpaca Markets Documentation](https://alpaca.markets/docs/)
558
- - [FinRL Documentation](https://finrl.readthedocs.io/)
559
- - [Stable Baselines3 Documentation](https://stable-baselines3.readthedocs.io/)
560
- - [Gymnasium Documentation](https://gymnasium.farama.org/)
 
1
+ ---
2
+ title: Algorithmic Trading System
3
+ emoji: πŸ“ˆ
4
+ colorFrom: blue
5
+ colorTo: green
6
+ sdk: streamlit
7
+ sdk_version: 1.46.1
8
+ app_file: streamlit_app.py
9
+ pinned: false
10
+ license: mit
11
+ ---
12
 
13
+ # Algorithmic Trading System
14
 
15
+ A comprehensive algorithmic trading platform with multiple AI agents, real-time data processing, and interactive UI interfaces.
16
 
17
+ ## Features
 
 
 
 
18
 
19
+ - πŸ€– **Multi-Agent System**: Strategy, Execution, and Data Ingestion agents
20
+ - πŸ“Š **Real-time Data**: Market data ingestion and processing
21
+ - 🧠 **FinRL Integration**: Deep reinforcement learning for trading strategies
22
+ - 🎯 **Multiple UIs**: Streamlit, Dash, Jupyter, and WebSocket interfaces
23
+ - πŸ“ˆ **Backtesting**: Comprehensive backtesting and performance analysis
24
+ - πŸ”’ **Risk Management**: Built-in risk controls and monitoring
25
+ - πŸš€ **Deployment Ready**: Docker and cloud deployment support
26
 
27
+ ## Quick Start
 
 
 
 
 
28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  ```bash
30
+ # Clone the repository
31
+ git clone https://github.com/EAName/algorithmic_trading.git
32
  cd algorithmic_trading
 
33
 
34
+ # Install dependencies
 
35
  pip install -r requirements.txt
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
37
+ # Run the Streamlit UI
38
+ streamlit run streamlit_app.py
 
 
 
 
 
39
  ```
40
 
41
+ ## Architecture
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
 
43
+ - **Agentic AI System**: Core trading logic and agent coordination
44
+ - **Data Pipeline**: Real-time market data ingestion and processing
45
+ - **UI Layer**: Multiple interface options for different use cases
46
+ - **Deployment**: Docker and cloud-ready configuration
47
 
48
+ ## Documentation
49
 
50
+ - [UI Setup Guide](UI_SETUP.md)
51
+ - [Deployment Guide](STREAMLIT_DEPLOYMENT.md)
52
+ - [Release Checklist](RELEASE_CHECKLIST.md)
 
53
 
54
+ ## License
55
 
56
+ MIT License - see [LICENSE](LICENSE) for details.