SkillAgentSearch skills...

CometAgent

Agent to generate trading signals that can be easily sent to Comet for in-browser agentic trading

Install / Use

/learn @cometportfolio/CometAgent
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

CometAgent - Perplexity Comet Trading Signal Generator

An intelligent trading signal generator that analyzes stocks and cryptocurrencies using technical analysis, news sentiment, and social media sentiment to produce actionable trading recommendations. The application generates browser-automation prompts specifically optimized for Perplexity Comet browser to execute trades on popular brokerage platforms.

Overview

CometAgent combines multiple data sources and analysis techniques to generate comprehensive trading signals:

  • Technical Analysis: RSI, MACD, Bollinger Bands, Moving Averages, ATR
  • News Sentiment: Yahoo Finance news headlines analyzed with VADER sentiment
  • Social Media Sentiment: X (Twitter) posts from trusted financial accounts
  • Multi-Platform Support: Generates execution prompts for Coinbase, Fidelity, Schwab, E*TRADE, Robinhood, and IBKR
  • Multiple Time Horizons: Short-term (3 months), medium-term (6 months), and long-term (2 years) analysis

Features

Core Functionality

  1. Portfolio Analysis:

    • Reads portfolio data from CSV/Excel files
    • Supports both stocks and cryptocurrency portfolios
    • Handles flexible column naming (ticker/symbol, quantity/shares, etc.)
  2. Technical Indicators Calculation:

    • Moving Averages: SMA50, SMA200, EMA12, EMA26
    • Momentum Indicators: MACD, RSI14
    • Volatility Indicators: Bollinger Bands, ATR14
    • Trend Analysis: Price vs. moving averages for trend determination
  3. Sentiment Analysis:

    • News Sentiment: Extracts and analyzes headlines from Yahoo Finance
    • Social Media Sentiment: Scrapes relevant X posts from trusted financial accounts
    • VADER Sentiment Scoring: Converts text to numerical sentiment scores (-1 to +1)
  4. Multi-Factor Scoring System:

    • Combines technical, news, and social sentiment scores
    • Horizon-based weighting (short-term favors technical, long-term favors news)
    • Generates final scores from -1.0 (strong sell) to +1.0 (strong buy)
  5. Trading Decision Engine:

    • Maps scores to discrete actions: Strong Buy, Buy, Hold, Trim, Sell
    • Calculates target percentage allocation changes
    • Provides detailed rationale for each recommendation
  6. Comet Browser Optimization:

    • Creates platform-specific browser automation prompts
    • Optimized for Perplexity Comet autonomous execution
    • Voice-command friendly prompt generation
    • Leverages Coinbase partnership for real-time crypto data
    • Includes step-by-step execution instructions
    • Handles order types (Market/Limit) and risk management

Supported Platforms

  • Coinbase (Crypto trading)
  • Fidelity (Stocks/ETFs)
  • Charles Schwab (Stocks/ETFs)
  • E*TRADE (Stocks/ETFs)
  • Robinhood (Stocks/Crypto)
  • Interactive Brokers (IBKR) (Stocks/Options/Futures)

Installation

Prerequisites

pip install pandas numpy yfinance feedparser vaderSentiment

Optional Dependencies

For enhanced functionality:

# For X (Twitter) scraping
pip install snscrape

# For additional RSS feed parsing
# feedparser is already included above

Usage

Basic Command Structure

python agentic-trader.py \
  --portfolio-type {stocks|crypto} \
  --horizon {short|medium|long} \
  --platform {coinbase|fidelity|schwab|etrade|robinhood|ibkr} \
  --file portfolio.csv

Examples

Stock Portfolio Analysis

python agentic-trader.py \
  --portfolio-type stocks \
  --horizon medium \
  --platform fidelity \
  --file my_stocks.csv

Cryptocurrency Portfolio Analysis

python agentic-trader.py \
  --portfolio-type crypto \
  --horizon short \
  --platform coinbase \
  --file crypto_holdings.csv

Portfolio File Format

Your portfolio file should be in CSV or Excel format with the following columns (case-insensitive):

Required:

  • ticker or symbol: Stock ticker (AAPL, MSFT) or crypto symbol (BTC, ETH)

Optional:

  • quantity or shares: Number of shares/coins owned (defaults to 0)
  • purchase_price or price: Original purchase price
  • purchase_date or date: Date of purchase
  • notes: Additional notes about the position

Example CSV:

ticker,quantity,purchase_price,purchase_date,notes
AAPL,100,150.00,2024-01-15,Core holding
MSFT,50,300.00,2024-02-01,Tech position
BTC,0.5,45000,2024-01-10,Crypto allocation

Source Weighting Configuration (Optional)

You can optionally configure the reliability weighting of both news sources and social media accounts by creating configuration files in the same directory as the script. This allows you to customize how much influence different sources have on sentiment analysis.

News Sources Configuration

Create a file named news_sources_weighting.md to configure news source reliability:

# News Sources Weighting Configuration

source, weight
Reuters Markets, 9
Bloomberg Markets, 10
WSJ Finance & Markets, 8
Financial Times Markets, 9
CNBC Markets, 7
MarketWatch, 6
Yahoo Finance, 6
Seeking Alpha, 5
CoinDesk, 8
The Block, 9

Social Media Configuration

Create a file named social_sources_weighting.md to configure social media account reliability:

# Social Media Sources Weighting Configuration

handle, weight
@markets, 9
@WSJmarkets, 8
@ReutersBiz, 9
@CNBCnow, 7
@CoinDesk, 8
@TheBlock__, 9
https://x.com/glassnode, 9
https://x.com/MessariCrypto, 7

Weight Scale:

  • 1: Least reliable source (minimal influence on sentiment)
  • 10: Most reliable source (maximum influence on sentiment)
  • Default: If no config files exist, all sources use a weight of 5

Social Media Handle Formats:

You can specify X/Twitter handles in any of these formats:

  • @username
  • username
  • https://x.com/username
  • https://twitter.com/username

Behavior:

  • With config files: Sources are weighted according to your specified values
  • Without config files: All sources are weighted equally (weight = 5)
  • Missing sources: Any source not listed in configs uses the default weight of 5
  • Invalid entries: Lines with invalid format or weights outside 1-10 range are ignored
  • Custom sources: You can add any X profile URL to the social config, not limited to defaults

Supported News Sources:

Stock Sources:

  • Reuters Markets, Bloomberg Markets, WSJ Finance & Markets
  • Financial Times Markets, CNBC Markets, MarketWatch
  • Morningstar News, Yahoo Finance, Seeking Alpha

Crypto Sources:

  • CoinDesk, Cointelegraph, The Block, Decrypt
  • Bitcoin Magazine, Kaiko, Glassnode, CryptoQuant, Santiment, DefiLlama

Default Social Media Accounts:

Stock-focused:

  • @markets, @WSJmarkets, @ReutersBiz, @CNBCnow
  • @bespokeinvest, @elerianm, @TheStalwart
  • @LizAnnSonders, @lisaabramowicz1

Crypto-focused:

  • @CoinDesk, @Cointelegraph, @TheBlock__, @decryptmedia
  • @KaikoData, @glassnode, @cryptoquant_com, @santimentfeed
  • @DefiLlama, @MessariCrypto

Algorithm Details

Technical Analysis Scoring

The application calculates a comprehensive technical score using:

  1. Trend Analysis (±0.5 points):

    • Compares current price to SMA200 for long-term trend
    • Falls back to SMA50 for shorter periods
  2. Momentum Analysis (±0.25 points):

    • Uses MACD line vs. signal line crossovers
    • Positive when MACD > signal line
  3. RSI Mean Reversion (±0.2 points):

    • Lower RSI values increase buy signal strength
    • Formula: ((50 - RSI) / 50) * 0.2
  4. Bollinger Band Extremes (±0.1 points):

    • Below lower band = potential bounce (positive)
    • Above upper band = potential pullback (negative)

Sentiment Analysis

News Sentiment Process:

  1. Fetches recent headlines from Yahoo Finance for the symbol
  2. Optionally supplements with RSS feeds (CNBC, MarketWatch)
  3. Filters headlines for symbol relevance
  4. Applies source weighting (if news_sources_weighting.md exists)
  5. Applies VADER sentiment analysis with weighted averaging
  6. Higher-weighted sources have more influence on final sentiment score

Social Media Sentiment:

  1. Uses snscrape to fetch recent X posts from configured accounts
  2. Applies source weighting (if social_sources_weighting.md exists)
  3. Searches for symbol mentions from financial influencers/publications
  4. Applies VADER sentiment analysis with weighted averaging
  5. Higher-weighted social accounts have more influence on final sentiment score

Multi-Factor Score Combination

Final scores are weighted based on investment horizon:

Short-term (3 months):

  • Technical Analysis: 60%
  • News Sentiment: 25%
  • Social Sentiment: 15%

Medium-term (6 months):

  • Technical Analysis: 50%
  • News Sentiment: 35%
  • Social Sentiment: 15%

Long-term (2 years):

  • Technical Analysis: 40%
  • News Sentiment: 45%
  • Social Sentiment: 15%

Decision Mapping

Total scores are mapped to trading actions:

  • ≥ 0.60: Strong Buy (+3.0% allocation)
  • ≥ 0.30: Buy (+1.5% allocation)
  • -0.30 to 0.30: Hold (0% change)
  • ≤ -0.30: Trim (-1.5% allocation)
  • ≤ -0.60: Sell (-3.0% allocation)

Output Files

The application generates two output files:

1. Signals CSV (signals_YYYYMMDD_HHMMSS.csv)

Contains detailed analysis results:

  • Symbol and current price
  • Technical indicators (RSI, MACD, moving averages)
  • Individual scores (technical, news, social)
  • Final decision and target allocation change
  • Detailed reasoning for each signal

2. Comet Browser Prompts (prompts_YYYYMMDD_HHMMSS.txt)

Contains browser automation instructions optimized for Perplexity Comet:

  • Voice-Command Ready: Natural language prompts for voice execution
  • Autonomous Workflows: Complete trading sequences for hands-free operation
  • Platform-Specific Instructions: Tailored for each brokerage platform
  • Coinbase Integration: Leverages Perplexity's official partnership
  • Risk Management: Built-in safety checks and confirmation steps
View on GitHub
GitHub Stars8
CategoryDevelopment
Updated2mo ago
Forks2

Languages

Python

Security Score

85/100

Audited on Jan 27, 2026

No findings