SuperAPI AI Directory

sister-portfolio

General & other

View repository

Updated 10-16 08:02

About this skill

📈 Sister Zheng Live Trading Manager

Trigger Keywords: "live trading", "watchlist", "holdings", "add stock"


Feature Overview

Sister Zheng Live Trading Manager is a complete stock tracking and management system that supports:

  1. Watchlist Management - Add/delete/view followed stocks
  2. Holdings Management - Record holdings, cost price, profit/loss calculation
  3. Automatic Tagging - Automatically identify concept sectors based on stock names
  4. Transaction Records - Manually enter buy/sell records
  5. Tag Query - Filter stocks by tag
  6. Real-time Push - Automatically push stock prices and technical indicators (during trading hours)

Data Storage

All data is saved in:

/root/.openclaw/workspace/memory/portfolio/
├── watchlist.json      # 自选股列表
├── positions.json      # 持仓股列表
├── tags.json          # 标签数据
└── trade_history.json # 交易记录

Usage

Method 1: Command-line operation

# 进入技能目录
cd /root/.openclaw/workspace/skills/sister-portfolio

# 添加自选股
./portfolio.sh add-watch 300605 恒锋信息
./portfolio.sh add-watch 002594 比亚迪

# 添加持仓股(代码 名称 数量 成本价)
./portfolio.sh add-position 002594 比亚迪 1000 85.50

# 记录买入
./portfolio.sh buy 002594 500 90.20

# 记录卖出
./portfolio.sh sell 002594 300 95.00

# 列出自选股
./portfolio.sh list-watch

# 列出持仓
./portfolio.sh list-position

# 查看所有标签
./portfolio.sh list-tags

# 查看某个标签下的股票
./portfolio.sh show-tag 新能源

# 查询实时数据
./portfolio.sh query 002594

# 统计持仓盈亏
./portfolio.sh stats

# 检查是否交易时段
./portfolio.sh check-trading-hours

# 推送自选股报告
./portfolio.sh push-watch

# 推送持仓报告
./portfolio.sh push-position

Method 2: Operate through Sister Zheng

Direct conversation:

  • "Sister Zheng, add watchlist stock 300605 Hengfeng Information"
  • "Sister Zheng, add holding 002594 BYD 1000 shares cost 85.50"
  • "Sister Zheng, record buy 002594 500 shares 90.20 yuan"
  • "Sister Zheng, view my watchlist"
  • "Sister Zheng, view holdings profit/loss"
  • "Sister Zheng, display all tags"
  • "Sister Zheng, view which stocks are in the new energy sector"

Automatic Tagging System (Precise Version)

The system usesdual-tag mechanism:

1. Precise tag library (priority matching)

For popular stocks, the system has built-in precise tags based onthe company's core business:

Stock Code Precise Tags Core Business
BYD 002594 new energy vehicles, power batteries, complete vehicle manufacturing Full new energy vehicle industry chain
CATL 300750 lithium batteries, power batteries, energy storage Global power battery leader
LONGi Green Energy 601012 photovoltaic modules, photovoltaic equipment, new energy Photovoltaic module leader
TBEA 600089 power transmission and transformation equipment, photovoltaic silicon materials, new energy Dual main businesses of power transmission and transformation + polysilicon
iFLYTEK 002230 AI voice, artificial intelligence, education AI voice leader
SMIC 688981 wafer foundry, semiconductors, chip manufacturing Domestic chip manufacturing
Sanhua Intelligent Controls 002050 automotive thermal management, humanoid robots, Tesla industry chain Thermal management + robot actuators
Hengrui Pharmaceuticals 600276 innovative drugs, pharmaceutical R&D, pharmaceutical leader Innovative drug leader
Hengfeng Information 300605 smart city, AI applications, software services Smart city + AI
... ... ... ...

Precise Tag Features:

  • ✅ Based on the company'sactual main businessrather than name keywords
  • ✅ Includesindustry chain position(e.g., upstream materials, midstream manufacturing, downstream applications)
  • ✅ Includescore concepts(e.g., Tesla industry chain, domestic substitution)
  • ✅ Includesindustry position(e.g., leader, first in a niche segment)

2. Smart tag recognition (backup matching)

For stocks not in the precise database, the system intelligently identifies them based on name keywords:

Tag Recognition keywords
AI Technology Technology, Information, Software, Network, Intelligent
New Energy New Energy, Photovoltaic, Lithium Battery, Energy Storage, Hydrogen Energy
Pharmaceuticals & Healthcare Pharmaceuticals, Healthcare, Biology, Medicine
Major Financials Bank, Securities, Insurance, Finance
Military Military, Aerospace, Shipbuilding, Aviation
Major Consumer Consumer, Food, Beverage, Home Appliances, Baijiu
Cyclical Resources Resources, Non-ferrous Metals, Rare Earth, Coal, Steel
Real Estate & Infrastructure Real Estate, Construction, Building Materials, Infrastructure
New Energy Vehicles Automobile, BYD, Seres
Humanoid Robots Robot, Reducer, Motor, Automation
Semiconductors Chip, Semiconductor, Integrated Circuit, Electronics

3. Sector tags (automatic recognition)

Sector Code prefix
Shanghai Main Board Starts with 60
Shenzhen Main Board Starts with 00
ChiNext Starts with 30
STAR Market Starts with 68
Beijing Stock Exchange Starts with 8/4

4. Tag management commands

# 查看股票详细标签信息
./portfolio.sh show-stock-info 002594

# 手动添加/更新股票标签(仅当前会话有效)
./portfolio.sh add-stock-tag 300605 "恒锋信息" "智慧城市,AI应用,软件服务"

# 列出自选股及其标签
./portfolio.sh list-watch

# 按标签筛选股票
./portfolio.sh show-tag 新能源
./portfolio.sh show-tag 锂电池
./portfolio.sh show-tag 人形机器人

Automatic push configuration

Set up scheduled push (Cron task)

Watchlist push (every 30 minutes):

# 编辑crontab
crontab -e

# 添加以下行(交易时段每30分钟推送)
*/30 9-11,13-15 * * 1-5 cd /root/.openclaw/workspace/skills/sister-portfolio && ./portfolio.sh push-watch >> /tmp/watch_push.log 2>&1

Holdings push (every 15 minutes):

# 编辑crontab
crontab -e

# 添加以下行(交易时段每15分钟推送)
*/15 9-11,13-15 * * 1-5 cd /root/.openclaw/workspace/skills/sister-portfolio && ./portfolio.sh push-position >> /tmp/position_push.log 2>&1

Push time description

  • Watchlist: pushed once every 30 minutes
  • Holdings: pushed once every 15 minutes
  • Non-trading hours: automatically skipped (weekends, holidays, before 9:30, 11:30-13:00, after 15:00)

Command quick reference

Command Function Example
add-watch Add to watchlist add-watch 300605 恒锋信息
list-watch List watchlist list-watch
add-position Add holdings add-position 002594 比亚迪 1000 85.50
list-position List holdings list-position
buy Record buy buy 002594 500 90.20
sell Record sell sell 002594 300 95.00
list-tags List tags list-tags
show-tag Show tagged stocks show-tag 新能源
show-stock-info View detailed stock information show-stock-info 002594
add-stock-tag Manually add tag add-stock-tag 300605 "恒锋信息" "智慧城市,AI应用"
refresh-tags Refresh all stock tags refresh-tags
query Query real-time data query 002594
stats Calculate profit and loss stats
push-watch Push watchlist report push-watch
push-position Push position report push-position

Push report format

Watchlist push report (every 30 minutes)

📊 郑大姐自选股监控报告 (10:00)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
监控 5 只自选股

• 恒锋信息 (300605) - AI科技, 创业板
• 比亚迪 (002594) - 新能源, 新能源汽车
• 格林美 (002340) - 新能源, 周期资源
• 浙江东方 (600120) - 大金融, 沪主板
• 豆神教育 (300010) - 教育, 创业板

【操作建议】
请查询实时数据获取技术分析...

Position stock push report (every 15 minutes)

💼 郑大姐持仓监控报告 (10:15)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
共 3 只持仓,总成本 ¥125,000.00

• 比亚迪 (002594): 1000股 @ ¥85.50
• 格林美 (002340): 5000股 @ ¥7.20
• 浙江东方 (600120): 3000股 @ ¥6.50

【盈亏监控】
当前盈亏: +5.2% (¥6,500)
最大浮盈: 比亚迪 +8.5%
最大浮亏: 格林美 -3.2%

Notes

  1. Data persistence - All data is saved in JSON files and will not be lost after restart
  2. Automatic tagging - Intelligently identified based on stock names, may not be completely accurate, and can be adjusted manually
  3. Trading hours - The push function only takes effect during A-share trading hours (Monday to Friday 9:30-11:30, 13:00-15:00)
  4. Profit and loss calculation - Requires real-time stock price data for querying
  5. Backup recommendation - Back up regularly /root/.openclaw/workspace/memory/portfolio/ directory

Sister Zheng's Nagging

"Trading stocks without keeping accounts is just messing around! For every stock, what the cost is, what the logic is, what the target price is, you have to keep track of it all for me!"

"The watchlist is your observation post, and position stocks are your positional warfare. The observation post patrols once every half hour, and the position reports numbers once every 15 minutes. What is this called? This is calleddiscipline!"

"Don't嫌 it troublesome; a good memory is not as good as a worn-out pen. When you have more positions, you won't even know what you bought without looking at the records."

"Remember what Big Sister says:those who can buy are apprentices, those who can sell are masters, and those who can keep accounts are the grandmasters!"


Future expansion (Roadmap)

  • Web interface management
  • Automatically obtain real-time stock prices to calculate profit and loss
  • Alert function (automatic reminder when price touches stop-loss/take-profit levels)
  • Chart display (position distribution, profit and loss curves)
  • Import and export function (Excel/CSV)
  • Multi-account support