Thanks to visit codestin.com
Credit goes to github.com

Skip to content

uppusaikiran/tradelens

Repository files navigation

TradeLens - AI-Powered Stock Portfolio Analysis

TradeLens Logo

TradeLens emerged as a solution to the challenges faced by investors in navigating the complexities of tariffs, market volatility, and the constant need to sift through news for portfolio-related information. This sophisticated web-based tool leverages advanced AI capabilities from Perplexity to provide a comprehensive platform for analyzing and visualizing stock portfolios. By uploading your stock transactions, you can gain valuable insights through interactive visualizations, risk assessments, and AI-driven analysis, making it easier to manage and optimize your investments amidst ever-changing market conditions.

It’s designed to help you navigate market volatility, tariff changes, and financial newsβ€”all in one place.

Live Demo : Click here - hosted on GCloud, Click here - hosted on AWS(Backup)

🌱 ESG-Driven Investing

What makes TradeLens unique is its focus on both performance and purpose. The platform includes:

  • ESG (Environmental, Social, Governance) scoring and analysis
  • Real-time monitoring of sustainability metrics
  • Actionable suggestions to improve your portfolio’s ESG impact

Stay aligned with your values without compromising on returns.

TradeLens Dashboard

πŸ“Έ Screenshots & Features

Dashboard Overview

TradeLens Dashboard The main dashboard provides a comprehensive view of your portfolio performance, with interactive charts, transaction summaries, and key metrics to help you monitor your investments at a glance.

ESG Analysis Dashboard

ESG Dashboard Comprehensive ESG (Environmental, Social, Governance) analysis of your portfolio, offering detailed sustainability metrics, company-specific ratings, and actionable recommendations to align your investments with your values and reduce long-term ESG risks.

Stock Performance Visualization

Stock Buy and Sell Plot Visualize your stock transactions with an interactive chart showing buy and sell points plotted against historical price data, making it easy to evaluate your trading decisions.

Transaction History

Transactions A detailed view of all your transactions with sortable columns, allowing you to track your investment history and analyze your trading patterns over time.

Perplexity AI Integration

Perplexity Model Selector Choose from various Perplexity AI models to power your analysis. Each model offers different capabilities, from quick answers to deep financial reasoning.

Earnings Analysis

Earnings Calendar Track upcoming earnings announcements relevant to your portfolio with AI-enhanced insights on expected performance and potential impacts.

Earnings Research Get detailed AI-powered research on company earnings, helping you make informed decisions before and after earnings releases.

Risk Assessment

Risk Analysis Comprehensive risk analysis for your portfolio, identifying potential vulnerabilities and providing AI-powered recommendations to optimize your risk-return profile.

Event Risk Calendar

Event Risk Calendar Stay ahead of market-moving events that might impact your portfolio. The calendar highlights critical dates and provides AI-generated insights about potential market impacts.

Investment Thesis Validation

Investment Thesis Test and validate your investment hypotheses with AI analysis, providing deeper insights into your investment rationale.

Strategy Backtesting

Strategy Backtesting Test investment strategies against historical data to evaluate performance and refine your approach before committing capital.

Provider Settings

Settings Page Configure your API providers and settings to customize the platform according to your needs and preferences.

Key Features

Core Functionality

  • πŸ“Š Interactive Visualizations: Dynamic stock price charts with buy/sell indicators
  • πŸ“ˆ Transaction History: Comprehensive view of all your trades with performance metrics
  • πŸ” Smart Filtering: Categorize and analyze stocks by groups (MAG7, Other, Unlisted)
  • πŸ’Ό Portfolio Composition: Visual breakdown of asset allocation and sector exposure

AI-Powered Analysis

  • πŸ€– Perplexity API Integration: Leveraging advanced financial analysis capabilities
    • Deep market research for investment decisions
    • Real-time financial data analysis
    • Multiple model options (sonar, sonar-pro, sonar-reasoning, etc.)
  • πŸ’‘ Investment Thesis Validation: Test your investment hypotheses with AI analysis
  • πŸ“Š Earnings Season Companion: AI-driven earnings preparation and analysis
  • ⚠️ Portfolio Risk Assessment: Identify and analyze risk factors

ESG Insights

  • 🌱 ESG Dashboard: Comprehensive analysis of environmental, social, and governance factors
  • πŸ”„ Sustainable Portfolio Alignment: Recommendations to improve your portfolio's ESG profile
  • πŸ“Š Sector-Specific ESG Benchmarking: Compare holdings against industry ESG baselines
  • πŸ“ ESG Notes and Monitoring: Track sustainability developments for your investments

Advanced Features

  • πŸ“… Event Risk Calendar: Track market-moving events that could impact your portfolio
  • πŸ“ˆ Strategy Backtesting: Test investment strategies against historical data
  • 🌐 Tariff & Geopolitical Risk Analysis: Assess external factors affecting your holdings
  • πŸ€” Natural Language Queries: Ask questions about your portfolio in plain English

Perplexity Integration

πŸ”Ή Perplexity Integration Points

πŸ”Έ Sonar API

Used for real-time data enrichment: β€’ Inputs: Transaction history and current portfolio. β€’ Outputs: Context-aware investment signals, AI summaries, and forecasts. β€’ Chatbot uses it to respond with intelligent, context-specific financial insights.

πŸ”Έ Sonar Pro

Used for strategy reasoning: β€’ Maps historical macroeconomic events (Covid, Banking Crisis 2023, AI boom, SP500 2020) to backtrack investment outcomes. β€’ Injects context such as tariffs, supply chain risks, or market cycles into the reasoning loop.

βΈ»

πŸ”Ή Thesis Validation Module (Left Block) β€’ Accepts hypotheses like "Tech stocks are undervalued post-Q2 earnings" and uses Perplexity's Deep Research to: β€’ Pull analyst commentary. β€’ Evaluate recent company performance. β€’ Scan sentiment data from media and financial forums. β€’ It synthesizes: β€’ Stock name β€’ Key metrics (revenue, EPS, margin trends) β€’ Sentiment and analyst expectations

Result: Validated or refuted thesis suggestions in natural language.

βΈ»

πŸ”Ή Strategy Backtracking (Top Center) β€’ Uses Sonar's Reasoning Model to simulate how portfolios would have performed under past macro conditions: β€’ Covid Recovery β€’ 2020 market crash and recovery β€’ AI/Tech boom β€’ 2023 Banking Crisis β€’ Enables reverse testing of a current strategy against historic events.

βΈ»

πŸ”Ή Earnings Calendar (Bottom Left) β€’ Earnings Research module, powered by Perplexity: β€’ Adds real-time annotations and research briefs for each upcoming earnings release. β€’ Enables quick drill-down into high-impact events within your portfolio's universe.

Getting Started

Prerequisites

  • Python 3.8 or higher
  • pip (Python package installer)
  • Perplexity API key (set in .env file)

Installation

  1. Clone the repository
git clone https://github.com/yourusername/tradelens.git
cd tradelens
  1. Create and activate a virtual environment
python -m venv venv
source venv/bin/activate  # On Windows, use: venv\Scripts\activate
  1. Install dependencies
pip install -r requirements.txt
  1. Set up your environment variables
cp .env.example .env
# Edit .env to add your Perplexity API key

Running the Application

  1. Start the server
./run_server.sh
  1. Open your browser and navigate to:
http://localhost:5000
  1. Upload your transaction data and start exploring your portfolio with AI-powered insights

Technology Stack

  • Backend: Python, Flask
  • Frontend: HTML, CSS, JavaScript, Chart.js
  • AI Integration: Perplexity API
  • Data Storage: SQLite
  • Data Processing: Pandas, NumPy

Documentation

Detailed documentation for TradeLens is available in the docs/ directory:

For project structure and organization, see the Project Structure document.

Contributing

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

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks