Stock Simulator for Openclaw

A sophisticated virtual trading environment that allows users to simulate stock investments across global markets without financial risk.

kingdevatil
v1.0.2
Mar 18, 2026
0
1.1k
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install stock-simulator

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 stock-simulator 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 Stock Simulator?

Stock Simulator is a powerful investment education tool designed for the Openclaw Skills ecosystem. It enables developers and investors to experience the volatility and mechanics of financial markets—including A-shares (China), Hong Kong, and US markets—using virtual currency. The skill bridges the gap between raw market data and actionable investment practice by providing real-time price fetching, automated currency conversion, and detailed profit tracking.

By leveraging Python-based data scripts and multiple financial APIs, this skill offers a sandbox for testing investment strategies. It is particularly useful for users looking to understand market trends, record historical trades, and analyze portfolio performance without the pressure of real-world financial loss.

Stock Simulator Use Cases

  • Practicing stock market entry and exit strategies in a risk-free environment.
  • Learning technical and fundamental analysis logic through daily market recommendations.
  • Tracking a virtual portfolio across different global currencies (CNY, HKD, USD).
  • Recording and auditing simulated trade history for educational purposes.

How Stock Simulator Works

  1. The user initializes a virtual account by setting a starting balance in their preferred currency.
  2. The skill fetches real-time market data from sources like Yahoo Finance, Eastmoney, and Tencent Finance using specialized Python scripts.
  3. When a buy or sell command is issued, the system calculates the share quantity based on the latest market price and applies current exchange rates.
  4. Transaction records and holding data are automatically saved to local JSON files in a secure workspace directory.
  5. The system generates daily profit and loss (P&L) reports, visualizing both daily and cumulative returns.

Stock Simulator Setup

Prerequisites

  • Python 3.x: Required for executing the data retrieval scripts.
  • Network Access: Stable connection to reach global financial APIs.

Installation

  1. Create the necessary script directory within your workspace:
mkdir -p workspace/skills/stock-simulator/scripts/
  1. Create the get_market_data.py file in that directory and populate it with the provided data fetching logic.
  2. (Optional) If you are in a restricted network environment, configure your proxy within the script's PROXY variable.
  3. Verify the setup by running a test data fetch:
python workspace/skills/stock-simulator/scripts/get_market_data.py 600519 cn

Stock Simulator Data Schema & Taxonomy

The skill automatically manages user data using a structured directory: workspace/stock_data/{userID}/.

File Description
config.json Stores account settings and initial capital configurations.
holdings.json Current stock positions across all enabled markets.
transactions.json A chronological log of every buy and sell operation.
profits.json Historical snapshots of realized and unrealized gains.

Stock Simulator Advanced Features

  • Multi-Market Support: Seamlessly handle A-share (6-digit), HK (5-digit), and US (Letter-based) stock codes.
  • Automated Currency Conversion: Integrated exchange rate calculation to display all portfolio values in a unified currency (CNY).
  • User Isolation: Automatic directory partitioning for multi-user environments or group chat scenarios.
  • Custom Proxy Logic: Extensible Python hooks for routing market data requests through secure proxies.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*