Enhanced 4-Part ML System with Real-Time Market Intelligence & Automated Trading
from smart_money_ai import SmartMoneyAI
# Initialize with your API keys
smart_money = SmartMoneyAI(
finnhub_api_key="your_finnhub_key",
breeze_app_key="your_breeze_app_key",
breeze_secret_key="your_breeze_secret_key"
)
# Parse SMS transactions
result = smart_money.parse_sms("Your A/c debited for Rs.2,500.00 at Coffee House Mumbai")
# Get investment recommendations with real-time data
recommendations = smart_money.get_real_time_investment_recommendations(
user_profile={'age': 30, 'risk_tolerance': 'moderate'},
investment_amount=100000
)
# Monitor your portfolio in real-time
portfolio_status = smart_money.monitor_investment_portfolio(['AAPL', 'MSFT', 'GOOGL'])- SMS Transaction Parser - Extract amount, merchant, date from banking SMS
- Expense Categorization - Auto-categorize expenses with ML
- Savings & Budget Optimizer - Create optimized monthly budgets
- Investment Recommendation Engine - AI-powered investment advice
- Live Market Data - Real-time stock quotes and market sentiment
- Enhanced Investment Analysis - ML + market data recommendations
- Portfolio Monitoring - Live tracking with alerts
- Market News Integration - Latest financial news analysis
- Account Authentication - Secure ICICI Direct integration
- Live Portfolio Analysis - Real-time holdings and performance
- Risk Management - Automated stop-loss and position sizing
- Order Execution - Automated buy/sell based on AI recommendations
SMART MONEY/
├── 📁 smart_money_ai/ # Main AI system
│ ├── __init__.py # Core SmartMoneyAI class (v4.0)
│ ├── core/ # Core ML models
│ ├── intelligence/ # Advanced analytics
│ └── ml_models/ # Machine learning models
├── 📁 config/ # Configuration management
│ ├── settings.py # Centralized config system
│ └── config.json # API keys and settings
├── 📁 integrations/ # External API integrations
│ ├── finnhub_market_data.py # Real-time market data
│ └── breeze_trading.py # Automated trading
├── 📁 examples/ # Demo scripts and examples
│ ├── real_time_market_demo.py # Market intelligence demo
│ ├── complete_trading_automation_demo.py # Full trading demo
│ └── simple_system_test.py # Basic system test
├── 📁 docs/ # Documentation
│ ├── SMART_MONEY_AI_GUIDE.md # Complete system guide
│ └── COMPLETE_TRADING_AUTOMATION_GUIDE.md # Trading guide
├── 📁 utils/ # Utility functions
│ └── common_utils.py # Shared helper functions
├── 📁 data/ # Data storage
├── 📁 tests/ # Test files
└── README.md # This file
Edit config/config.json:
{
"api": {
"finnhub_api_key": "your_finnhub_api_key_here",
"breeze_app_key": "your_breeze_app_key_here",
"breeze_secret_key": "your_breeze_secret_key_here",
"breeze_session_token": "your_session_token_here"
},
"trading": {
"max_position_size": 0.05,
"stop_loss_percentage": 0.02,
"take_profit_percentage": 0.06,
"risk_tolerance": "moderate"
}
}export FINNHUB_API_KEY="your_finnhub_key"
export BREEZE_APP_KEY="your_breeze_app_key"
export BREEZE_SECRET_KEY="your_breeze_secret_key"python examples/real_time_market_demo.pypython examples/complete_trading_automation_demo.pypython examples/simple_system_test.py# Parse banking SMS
sms_text = "Your A/c XXXXXX1234 debited for Rs.2,500.00 on 15-JUL-23 at Coffee House Mumbai"
result = smart_money.parse_sms(sms_text)
print(f"Amount: ₹{result['amount']}")
print(f"Merchant: {result['merchant']}")
print(f"Category: {result['category']}")
print(f"Confidence: {result['category_confidence']*100:.1f}%")# Get AI-powered investment advice
user_profile = {
'age': 32,
'monthly_income': 150000,
'risk_tolerance': 'moderate',
'investment_experience': 'intermediate'
}
recommendations = smart_money.get_investment_recommendations(user_profile, 100000)
print(f"Recommendation: {recommendations['recommendation']}")# Get live market overview
market_data = smart_money.get_market_overview()
print(f"Market Sentiment: {market_data['market_sentiment']}")
# Analyze specific stocks
analysis = smart_money.get_real_time_stock_analysis('AAPL')
print(f"AAPL Recommendation: {analysis['investment_recommendation']['action']}")# Monitor portfolio in real-time
portfolio = ['AAPL', 'MSFT', 'GOOGL', 'TSLA']
status = smart_money.monitor_investment_portfolio(portfolio)
print(f"Portfolio Performance: {status['summary']['average_change']:.2f}%")
print(f"Positive Performers: {status['summary']['positive_performers']}")pip install -r requirements.txtpip install -r requirements-realtime.txtpip install -r requirements-production.txt- SMS Parser: Extract transaction data with 95%+ accuracy
- Expense Categorizer: Auto-categorize with 9 expense categories
- Savings Optimizer: Create personalized budget recommendations
- Investment Engine: Risk-profiled investment recommendations
- Market Data: Live quotes via Finnhub API
- Sentiment Analysis: Market sentiment from news and price movements
- Technical Indicators: Basic technical analysis for stocks
- News Integration: Latest financial news with sentiment scoring
- ICICI Direct Integration: Via Breeze API
- Account Management: Portfolio tracking and analysis
- Risk Controls: Automated stop-loss and position limits
- Order Management: Automated trade execution
- API Key Management: Secure storage in config files
- Error Handling: Comprehensive exception handling
- Rate Limiting: Built-in API rate limiting
- Data Validation: Input validation for all user data
- Logging: Detailed logging for debugging and monitoring
- Requires valid Finnhub API key
- Rate limits apply (60 calls/minute for free tier)
- Internet connection required
- Requires ICICI Direct Breeze API credentials
- Only works with valid trading account
- Use paper trading for testing
- No user data is stored externally
- All processing happens locally
- API keys stored securely in config files
- ✅ Reorganized project structure
- ✅ Centralized configuration system
- ✅ Modular integration architecture
- ✅ Enhanced error handling
- ✅ Streamlined imports and dependencies
- ✅ Added Breeze API trading integration
- ✅ Real-time portfolio monitoring
- ✅ Automated risk management
- ✅ Added real-time market data integration
- ✅ Enhanced investment recommendations
- ✅ Market sentiment analysis
- ✅ Core 4-part ML system
- ✅ SMS parsing and expense categorization
- ✅ Budget optimization and investment recommendations
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Check the documentation
- Run the system test:
python examples/simple_system_test.py - Review the example demos in
examples/
- Configure your API keys in
config/config.json - Run the system test:
python examples/simple_system_test.py - Try the demos: Start with
examples/real_time_market_demo.py - Build something amazing with Smart Money AI! 🚀
Smart Money AI - Making financial intelligence accessible to everyone.