Skip to content

SDG223157/OPBB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ OPBB - OpenBB Platform with ROIC Integration

Advanced financial analysis platform combining OpenBB's market data capabilities with custom ROIC (Return on Invested Capital) quality metrics.

πŸ“Š Features

  • OpenBB CLI Integration: Full OpenBB platform for market data, news, and analysis
  • ROIC Quality Metrics: Custom CLI tool for fundamental quality analysis
  • πŸ†• Unified Analysis: Master tool combining OpenBB + ROIC data seamlessly
  • πŸ†• Pro-Style Backend API: FastAPI backend inspired by OpenBB Terminal Pro
  • Multi-Provider Support: Yahoo Finance, Polygon, Finviz Elite, FRED, and ROIC.ai
  • Historical Analysis: 10-year ROIC trends for any stock (including Chinese A-shares)
  • Smart Forecasting: Quality-based 3-year price projections
  • Professional Display: Both terminal and OpenBB-style table formats
  • πŸ†• Integration Wrappers: Python scripts that merge OpenBB and ROIC metrics
  • RESTful API: Professional backend with widgets.json for Terminal Pro style interfaces

🎯 Quick Start

Installation

  1. Clone the repository
git clone https://github.com/SDG223157/OPBB.git
cd OPBB
  1. Set up virtual environment
python3 -m venv openbb-env
source openbb-env/bin/activate
pip install openbb-cli
  1. Launch OpenBB
./launch-openbb-premium.sh

πŸ†• OpenBB Workspace Backends Integration

Configure in OpenBB Workspace's Backends screen:

Backend Name: ROIC Quality API
Environment: openbb
Executable: python openbb_roic_backend.py
Working Directory: /Users/sdg223157/OPBB

See OPENBB_BACKENDS_CONFIGURATION.md for complete setup.

πŸ†• Master Analysis Tool

# Complete analysis combining OpenBB + ROIC
./analyze AAPL              # Full analysis
./analyze MSFT roic         # ROIC metrics only
./analyze NVDA forecast     # Price targets
./analyze compare AAPL GOOGL MSFT  # Compare multiple

Using ROIC Tools

# Quality metrics
./roic quality AAPL

# 3-year forecast
./roic forecast MSFT

# Compare companies
./roic compare AAPL MSFT GOOGL

# Historical analysis
./roic historical 600519.SS --years 10

Integration Features

# Combined OpenBB + ROIC data
python roic_wrapper.py AAPL

# Hybrid launcher
python hybrid_launcher.py roic AAPL  # ROIC data
python hybrid_launcher.py            # Launch OpenBB

πŸ†• Professional Backend API

Inspired by OpenBB Terminal Pro:

# Start the API server
./launch_roic_backend.sh

# Access endpoints
curl http://localhost:8000/api/v1/analysis/complete/AAPL
curl http://localhost:8000/widgets.json

# Use the client
python roic_backend_client.py

API Documentation: http://localhost:8000/docs

πŸ“ˆ Available Commands

OpenBB Commands

  • /equity/price/quote --symbol AAPL --provider yfinance
  • /news/company --symbol AAPL --provider polygon
  • /economy/fred_series --symbol VIXCLS --provider fred
  • /equity/estimates/price_target --symbol AAPL --provider finviz

ROIC Commands

  • ./roic quality [SYMBOL] - Get ROIC and quality metrics
  • ./roic forecast [SYMBOL] - Quality-based 3-year forecast
  • ./roic compare [SYMBOLS...] - Compare multiple stocks
  • ./roic historical [SYMBOL] - Historical ROIC analysis
  • ./roic style [openbb|custom] - Switch display style

πŸ”‘ API Configuration

Required API Keys

  • Polygon.io: Real-time market data and news
  • Finviz Elite: Analyst price targets
  • FRED: Economic indicators and commodity prices
  • ROIC.ai: Quality metrics (optional)

Setting API Keys

# Run setup scripts
python set_polygon_key.py
python set_finviz_key.py
python set_fred_key.py
python set_roic_key.py

πŸ“Š Example Analysis

Apple (AAPL) Quality Metrics

ROIC: 51.54%
Quality Score: 95/100
Competitive Moat: Wide
3-Year Target: $439 (+64%)

Chinese Stocks Support

# Kweichow Moutai
./roic historical 600519.SS

# BYD
./roic quality 002594.SZ

πŸ—οΈ Project Structure

OPBB/
β”œβ”€β”€ openbb-env/              # Virtual environment
β”œβ”€β”€ launch-openbb-*.sh       # Launch scripts with API keys
β”œβ”€β”€ roic*                    # ROIC CLI tool and modules
β”œβ”€β”€ get_*.py                 # Data fetching scripts
β”œβ”€β”€ master_forecast.py       # Comprehensive analysis tool
β”œβ”€β”€ commodity_dashboard*.py  # Commodity market tools
β”œβ”€β”€ *.md                     # Documentation
└── API setup scripts

πŸ’‘ Key Features

1. Master Forecast Tool

Combines all data sources for institutional-grade analysis:

python master_forecast.py

2. Display Styles

Switch between custom and OpenBB-style output:

./roic style openbb  # Professional tables
./roic style custom  # Clean text format

3. Export Capabilities

All tools support data export:

./roic quality AAPL --export csv
./roic historical MSFT --export xlsx

πŸ“š Documentation

🀝 Contributing

Contributions are welcome! This project demonstrates:

  • Custom OpenBB provider development
  • CLI tool integration
  • Financial data analysis
  • Multi-API orchestration

πŸ“„ License

MIT License - See LICENSE file for details

πŸ™ Acknowledgments

  • OpenBB Platform for the excellent financial data framework
  • ROIC.ai for quality investing methodology
  • All data providers (Yahoo, Polygon, Finviz, FRED)

πŸ“ž Contact


Built with ❀️ for quality-focused financial analysis

About

OpenBB Platform with ROIC Integration - Advanced financial analysis combining market data with quality investing metrics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors