Skip to content

weirdapps/etorotrade

Repository files navigation

eToro Trade Analysis Tool

Quality Gate Status Coverage Code Smells Maintainability Rating

Make data-driven investment decisions with confidence. This tool aggregates analyst recommendations, price targets, and fundamental metrics into a single, clear display—helping you identify opportunities, manage your portfolio, and make educated investment choices.

eToro Trade Analysis Tool

Created by: plessas - eToro Popular Investor Important: This tool provides analysis only, not investment advice. All investment decisions are your own responsibility.

What Does This Tool Do?

Instead of manually checking multiple websites for analyst ratings, price targets, and financial metrics, this tool:

Aggregates Data: Pulls analyst consensus from 20+ investment banks via Yahoo Finance ✅ Analyzes Metrics: Evaluates 15+ financial indicators (upside potential, analyst ratings, P/E ratios, ROE, etc.) ✅ Generates Signals: Applies systematic criteria to suggest BUY, SELL, HOLD, or INCONCLUSIVE ✅ Calculates Position Sizes: Recommends allocation based on risk-adjusted framework ✅ Produces Reports: Exports results to CSV and HTML for easy review

What this is: A research tool that organizes publicly available analyst data into actionable insights. What this is NOT: Investment advice, a guarantee of returns, or a fully automated trading system.

Quick Start

For eToro Users

  1. Export your portfolio from eToro (Portfolio → Export to CSV)
  2. Save as yahoofinance/input/portfolio.csv
  3. Run analysis: python trade.py -o p
  4. View results in console or check yahoofinance/output/portfolio.html

That's it! You'll see color-coded recommendations (🟢 BUY, 🔴 SELL, ⚪ HOLD) for each position.

For All Investors

# 1. Install dependencies
pip install -r requirements.txt

# 2. Analyze specific stocks
python trade.py -o i -t AAPL,MSFT,GOOGL

# 3. Screen market opportunities
python trade.py -o m

# 4. Generate buy recommendations
python trade.py -o t -t b

📖 New to this? See the complete User Guide for detailed instructions.

Technical Specifications

Data Processing Capabilities

  • Throughput: ~100 securities per second (vectorized operations)
  • Batch Processing: 5,544 securities in approximately 15 minutes
  • API Optimization: 48-hour cache layer reducing redundant API calls by ~80%
  • Concurrency: 15 parallel request threads with adaptive rate limiting

Data Sources

  • Primary: Yahoo Finance API (yfinance)
  • Supplementary: YahooQuery API (PEG ratios, missing metrics)
  • Coverage: 20+ investment bank analyst recommendations
  • Update Frequency: Real-time market data with cached analyst consensus

Methodology

5-Tier Market Capitalization System

The framework employs a sophisticated five-tier classification with region-specific adjustments:

Tier Market Cap Range Example Companies Strategy Focus
MEGA ≥ $500B AAPL, MSFT, GOOGL Blue-chip stability
LARGE $100B - $500B NFLX, DIS, UBER Established growth
MID $10B - $100B ROKU, SNAP, DOCN Growth opportunities
SMALL $2B - $10B Emerging leaders Higher growth potential
MICRO < $2B Micro-cap stocks Speculative positions

Regional Adjustments:

  • US: Baseline criteria for NYSE/NASDAQ securities
  • EU: Modified thresholds for European exchanges (.L, .PA, .AS)
  • HK: Adjusted parameters for Hong Kong/Asian markets (.HK)

Signal Generation

Trading signals are generated through a systematic evaluation process:

  1. Data Collection: Aggregate analyst recommendations, price targets, and fundamental metrics
  2. Confidence Validation: Require minimum 4 analysts and 4 price targets
  3. Criteria Application: Apply tier and region-specific thresholds
  4. Signal Classification: Categorize as BUY, SELL, HOLD, or INCONCLUSIVE

Position Sizing Algorithm

Position sizes are calculated using a risk-adjusted framework:

  • Base position scaled by market capitalization tier
  • Adjustments for expected return (EXRET)
  • Beta-weighted volatility adjustments
  • Maximum position constraints

Installation

# Clone repository
git clone https://github.com/weirdapps/etorotrade
cd etorotrade

# Create virtual environment
python -m venv myenv
source myenv/bin/activate  # Windows: myenv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

Usage

Basic Analysis

# Interactive mode
python trade.py

# Analyze portfolio
python trade.py -o p

# Market screening
python trade.py -o m

# Trade signal generation
python trade.py -o t -t b  # Buy signals
python trade.py -o t -t s  # Sell signals

Advanced Analysis

# Portfolio analysis with position sizing
python trade.py -o p -pv 50000  # $50,000 portfolio value

# Geographic exposure analysis
python scripts/analyze_geography.py

# Sector allocation analysis
python scripts/analyze_industry.py

# Specific ticker analysis
python trade.py -o i -t AAPL,MSFT,GOOGL

Output Format

Signal Definitions

Signal Criteria Interpretation
BUY Meets all tier-specific buy thresholds Positive analyst consensus with favorable risk/reward
SELL Triggers any sell condition Deteriorating fundamentals or overvaluation
HOLD Between buy and sell thresholds Fairly valued at current levels
INCONCLUSIVE Insufficient analyst coverage Requires additional research

Key Metrics

  • UPSIDE: Percentage difference between current price and analyst target
  • %BUY: Percentage of analysts with buy recommendations
  • EXRET: Expected return (upside × buy percentage / 100)
  • SIZE: Calculated position size based on risk parameters
  • PP: Twelve-month price performance
  • EG: Year-over-year earnings growth
  • PEF/PET: Forward P/E to Trailing P/E ratio comparison

Output Files

The system generates both CSV and HTML reports in yahoofinance/output/:

  • portfolio.csv/html - Current holdings analysis
  • market.csv/html - Market screening results
  • buy.csv/html - Securities meeting buy criteria
  • sell.csv/html - Securities meeting sell criteria

Configuration

Portfolio Input Format

Create yahoofinance/input/portfolio.csv:

symbol,totalInvestmentPct,totalNetProfitPct,instrumentDisplayName
AAPL,5.2,12.5,Apple Inc
MSFT,4.8,8.3,Microsoft Corporation

Threshold Customization

Trading thresholds can be modified in config.yaml:

  • Tier-specific buy/sell criteria
  • Regional adjustments
  • Position size parameters
  • Risk management constraints

Architecture

Performance Optimizations

  • Vectorized pandas operations for efficient data processing
  • Set-based filtering algorithms (O(n) vs O(n²))
  • Asynchronous API requests with connection pooling
  • Memory-efficient streaming for large datasets

Error Handling

  • Automatic retry with exponential backoff
  • Graceful degradation for missing data
  • Comprehensive logging for debugging
  • Circuit breaker pattern for API failures

Code Quality

  • Type hints throughout codebase
  • Comprehensive test coverage
  • Continuous integration pipeline
  • SonarCloud quality gates

ETF Analysis

The tool provides transparency into ETF holdings:

  • Geographic exposure decomposition
  • Sector allocation analysis
  • Underlying asset classification
  • Concentration risk assessment

Risk Considerations

Limitations

  • Analysis based on publicly available data
  • No intraday trading signals
  • No derivative strategies
  • Historical performance not indicative of future results

Important Disclaimers

  • This tool provides analysis only, not investment advice
  • All investment decisions should incorporate multiple sources
  • Past signals do not guarantee future performance
  • Users assume all investment risk

Development

Testing

# Run all tests
pytest tests/

# Run specific test suites
pytest tests/unit/           # Unit tests
pytest tests/integration/    # Integration tests
pytest tests/e2e/           # End-to-end tests

# Code quality checks
flake8 yahoofinance/ trade_modules/ --max-line-length=100
mypy yahoofinance/ trade_modules/ --ignore-missing-imports

# Coverage report
pytest --cov=yahoofinance --cov=trade_modules --cov-report=html

Contributing

Contributions are welcome. Please ensure:

  • All tests pass (pytest tests/)
  • Code follows PEP 8 style guidelines
  • Type hints are included for new functions
  • Documentation is updated accordingly
  • Security best practices are followed

Documentation

License

MIT License - See LICENSE file for details

Support

For issues or questions, please use the GitHub issue tracker.


Last Updated: October 2025

Disclaimer: This tool is designed for quantitative analysis and research purposes only. It does not constitute investment advice. Users should conduct their own due diligence and consider consulting with qualified financial advisors before making investment decisions. Past performance does not guarantee future results.

About

a screener and portfolio tracker that powers my etoro investments.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages