Portfolio Analysis for Openclaw

A comprehensive stock portfolio management system providing real-time pricing, profit and loss calculations, and automated reporting.

jcsoftear
v1.0.0
Apr 11, 2026
0
911
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install portfolio-analysis-pro

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install portfolio-analysis-pro using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Portfolio Analysis?

The Portfolio Analysis skill is a professional-grade tool designed for investors who need to track and analyze their stock holdings efficiently. Built to integrate seamlessly within the Openclaw Skills framework, it offers a robust backend for managing investment data, fetching live market prices, and performing detailed financial analysis. By leveraging this skill, developers can maintain a precise overview of their assets with high-frequency updates and deep analytical insights.

Portfolio Analysis Use Cases

  • Tracking real-time performance of diverse stock holdings across multiple exchanges.
  • Generating detailed profit and loss reports for automated investment review.
  • Syncing live market data during active trading hours for up-to-the-minute accuracy.
  • Analyzing position weighting and market value distribution to optimize portfolio balance.
  • Maintaining a searchable history of all investment operations and trades for auditing.

How Portfolio Analysis Works

  1. The skill initializes the PortfolioManager class, which connects to a local SQLite database for secure data persistence.
  2. Users add stock holdings by providing symbols, quantities, and cost prices through the provided API or class methods.
  3. A Flask-based web server runs in the background, exposing RESTful endpoints for remote management.
  4. During market hours, the system triggers price updates from multiple data sources to ensure current valuations.
  5. The analytics engine calculates total market value, costs, and P&L percentages using 4-decimal precision.
  6. On-demand reports are generated in Markdown format for easy sharing or integration into other Openclaw Skills workflows.

Portfolio Analysis Setup

To utilize this skill, first install the necessary Python dependencies:

pip install requests flask

You can then launch the management system and its API server with the following code:

from portfolio_system import PortfolioManager, start_server

# Launch the Web server with auto-update enabled
start_server(host='0.0.0.0', port=5000, auto_update=True)

Portfolio Analysis Data Schema & Taxonomy

The skill manages its data through a structured schema, primarily focusing on stock holding attributes and performance metrics.

Attribute Description Data Type
symbol Ticker code (e.g., 600519 or 000001) String
name Display name of the security String
quantity Number of shares currently held Integer
cost_price Original purchase price per share Float (4-decimal)
current_price Latest market price Float (4-decimal)
pnl_ratio Percentage gain or loss Float (4-decimal)
market_value Total value based on current price Float (4-decimal)

Portfolio Analysis Advanced Features

  • Intelligent auto-update scheduling restricted to active trading hours (9:30-11:30 and 13:00-15:00) to optimize resource usage.
  • Comprehensive REST API suite for seamless integration with other Openclaw Skills and custom dashboards.
  • Multi-field sorting capabilities for portfolio views including P&L amount, percentage, and market value.
  • High-precision financial calculations supporting up to 4 decimal places for cost and profit tracking.
  • Automated Markdown report generation and export functionality for professional documentation.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*