Sim Trading MVP
Run a disciplined paper-trading loop for an OpenClaw user.
This skill is meant to be reusable across different OpenClaw setups. Do not assume one specific user's style, files, or schedule. Confirm the user's preferences before locking in the workflow.
Use a single structured market-data source for prices, benchmark tracking, and account valuation whenever possible. Current recommended source for this skill: Finnhub.
Non-negotiable rule: truthfulness
Never fabricate market data, execution prices, benchmark performance, news, portfolio state, or trade history.
If data is missing, delayed, unavailable, or uncertain:
- - say so clearly
- record the uncertainty explicitly
- prefer
HOLD over pretending certainty - never optimize for apparent profit by inventing facts
Trust matters more than simulated returns.
Confirm these inputs before finalizing the workflow
Before turning the workflow into a persistent setup, confirm these four items with the user:
- 1. Style
- Initial rules
- Three decision windows and cron behavior
- Post-market report format
Do not skip confirmation unless the user explicitly says to use the current/default version.
1. Style selection
The skill should support multiple styles.
Examples:
- - conservative
- aggressive
- default growth
- custom
Important
A custom style should be personalized for the current OpenClaw user based on their preferences, temperament, and working style. Do not assume one universal custom style across all users.
When building or updating a custom style:
- - use the current user's stated preferences
- reflect their appetite for action vs stability
- capture what kind of process they want to watch every day
- write the resulting style into the local project/account files
2. Initial rules
Default starter rules for this MVP:
- - Initial cash: INLINECODE2
- Market: INLINECODE3
- Disallowed:
options, leverage, INLINECODE6 - Max single-position weight: INLINECODE7
- Minimum cash: INLINECODE8
- Max high-volatility positions at once: INLINECODE9
- Benchmarks:
SPY and INLINECODE11
These are defaults, not sacred constants. If the user changes them, store the updated rules in the project files.
3. Three decision windows and automation
The default workflow uses three decision windows per trading day:
- 1. INLINECODE12
- INLINECODE13
- INLINECODE14
In each window, output exactly one action:
- - INLINECODE15
- INLINECODE16
- INLINECODE17
INLINECODE18 is a valid action. Do not force activity.
If the user wants automation, set up cron jobs for:
- - the three decision windows
- one post-market sync
If cron already exists, inspect before changing it. Avoid duplicate jobs.
4. Post-market report
The default post-market report should include:
- - account equity
- daily return
- cumulative return
- benchmark comparison (
SPY / QQQ) - current positions
- today's three decision windows
- reasoning
- review / lessons / next watch items
The report can be concise, but it must remain honest and specific.
Recommended project structure
Use a project directory so the simulated account survives across sessions.
Suggested files:
- -
account.json — account state, rules, style, positions, watchlist - INLINECODE22 — append-only decision / execution log
- INLINECODE23 — brief project note
If the user already has a preferred project path, use that instead.
Core workflow
Follow this order.
Step 1: Load state
Read the account file and trade log before making any decision.
At minimum, know:
- - current cash
- current positions
- current rules
- prior decisions from the same day
- current style
Step 2: Identify the current decision window
Determine whether you are acting in:
- - INLINECODE24
- INLINECODE25
- INLINECODE26
- INLINECODE27
For the first three, make exactly one action decision.
Step 3: Research before acting
Before every decision, gather enough real market context to justify the move.
Use Finnhub as the primary single source for:
- - current price / quote lookups
- historical price context
- benchmark symbols such as
SPY and INLINECODE29 - account valuation inputs
Use open research/news sources as secondary inputs for:
- - broad market tone
- relevant macro events
- company-specific catalysts
- earnings / guidance
- narrative context around held names and watchlist names
Prefer a small number of useful sources over noisy overcollection.
Data source and secrets
Store API keys outside the skill itself, for example in a local project .env or another secret-bearing runtime configuration.
Never hardcode, publish, commit, or echo a user's market-data API key into SKILL.md, reference files, public repos, or ClawHub releases.
For this skill, Finnhub may be required for robust price and benchmark handling, but the key must stay in local runtime configuration only.
Authenticity guardrails
When researching and reporting:
- - do not state a price unless you actually retrieved or calculated it from a real source
- do not imply a trade happened unless it was actually recorded
- do not backfill trades after the fact to make the log look better
- do not invent benchmark performance
- do not turn missing information into confident narrative
If the needed data is unavailable, say something like:
Risk enforcement
Always enforce the stored account rules.
If a proposed action breaks the rules, reject it and record HOLD with the reason.
Examples:
- - position would exceed max concentration
- cash floor would be broken
- security type is not allowed
- too many high-volatility names would be held simultaneously
Action format
For every BUY or SELL, record three things:
- 1. why act now
- what would invalidate the thesis
- what the exit / damage-control plan is
For HOLD, explain why patience is better than forced activity.
Logging format
Append one JSON object per line to trades.jsonl.
Suggested shape:
CODEBLOCK0
For executed buys/sells, include:
- - ticker
- quantity
- execution price assumption
- reason
- thesis invalidation
- exit plan
- data quality note if needed
Post-market sync behavior
At the end of the trading day, send a concise Chinese recap containing:
- - account performance
- benchmark comparison
- positions
- today's three decisions
- reasoning
- review
- what to watch next
If any figures are incomplete or estimated, label them clearly.
Tone
- - Sound like an investor with a process.
- Do not sound like a hype bot.
- Discipline beats excitement.
- Truth beats pretty results.
- A boring honest recap is better than a flashy fake one.
References
Read references/project-template.md when setting up a new account from scratch.
Read references/report-template.md when formatting the daily sync.
Read references/log-schema.md when updating or validating the trading log format.
Read references/cron-setup.md when the user wants automated decision windows and post-market sync.
Read references/style-profiles.md when selecting or generating a style profile, especially custom.
Scripts
Use scripts/update_account.py <account.json> as a minimal account-update helper.
It currently:
- - recalculates account equity from
cash plus position market value when currentPrice is available - updates INLINECODE47
- refreshes INLINECODE48
Treat it as a safe starter framework. Extend it when the project grows, but do not silently turn missing price data into fake marks.
Sim Trading MVP
为OpenClaw用户运行一个纪律严明的模拟交易循环。
此技能旨在跨不同的OpenClaw设置重复使用。不要假设某个特定用户的风格、文件或时间表。在锁定工作流程之前,请确认用户的偏好。
尽可能使用单一结构化的市场数据源来获取价格、基准跟踪和账户估值。当前此技能推荐的来源:Finnhub。
不可协商的规则:真实性
绝不捏造市场数据、执行价格、基准表现、新闻、投资组合状态或交易历史。
如果数据缺失、延迟、不可用或不确定:
- - 清楚说明
- 明确记录不确定性
- 优先选择HOLD而非假装确定
- 绝不为了表面利润而编造事实
信任比模拟回报更重要。
在最终确定工作流程前确认这些输入
在将工作流程转变为持久设置之前,请与用户确认以下四项:
- 1. 风格
- 初始规则
- 三个决策窗口和定时任务行为
- 盘后报告格式
除非用户明确表示使用当前/默认版本,否则不要跳过确认。
1. 风格选择
该技能应支持多种风格。
示例:
重要
自定义风格应根据当前OpenClaw用户的偏好、性格和工作风格进行个性化定制。不要假设所有用户都适用一种通用的自定义风格。
在构建或更新自定义风格时:
- - 使用当前用户声明的偏好
- 反映他们对行动与稳定的偏好
- 捕捉他们每天希望关注的过程类型
- 将生成的风格写入本地项目/账户文件
2. 初始规则
此MVP的默认起始规则:
- - 初始现金:$10,000
- 市场:美股 + ETF
- 禁止:期权、杠杆、做空
- 单个头寸最大权重:30%
- 最低现金:10%
- 同时持有的高波动性头寸上限:3
- 基准:SPY和QQQ
这些是默认值,并非神圣不可更改的常量。如果用户更改它们,请将更新后的规则存储在项目文件中。
3. 三个决策窗口和自动化
默认工作流程每个交易日使用三个决策窗口:
- 1. 盘前或开盘
- 盘中
- 临近收盘
在每个窗口中,输出一个确切的操作:
HOLD是一个有效的操作。不要强行进行交易活动。
如果用户想要自动化,请为以下内容设置定时任务:
如果定时任务已存在,请在更改前进行检查。避免重复任务。
4. 盘后报告
默认盘后报告应包括:
- - 账户权益
- 日回报率
- 累计回报率
- 基准比较(SPY / QQQ)
- 当前持仓
- 今天的三个决策窗口
- 推理过程
- 回顾 / 经验教训 / 下一步关注事项
报告可以简洁,但必须保持诚实和具体。
推荐的项目结构
使用项目目录,以便模拟账户在会话之间持续存在。
建议的文件:
- - account.json — 账户状态、规则、风格、持仓、观察列表
- trades.jsonl — 仅追加的决策/执行日志
- README.md — 简短的项目说明
如果用户已有偏好的项目路径,请使用该路径。
核心工作流程
按以下顺序执行。
步骤1:加载状态
在做出任何决策之前,读取账户文件和交易日志。
至少需要了解:
- - 当前现金
- 当前持仓
- 当前规则
- 当天之前的决策
- 当前风格
步骤2:识别当前决策窗口
确定你正在执行的操作属于:
对于前三个窗口,做出一个确切的操作决策。
步骤3:行动前进行研究
在每个决策之前,收集足够的真实市场背景信息来证明行动的合理性。
使用Finnhub作为主要单一来源获取:
- - 当前价格/报价查询
- 历史价格背景
- 基准标的如SPY和QQQ
- 账户估值输入
使用开放研究/新闻来源作为次要输入获取:
- - 广泛的市场基调
- 相关的宏观事件
- 公司特定催化剂
- 财报/指引
- 关于持仓和观察列表标的的叙事背景
优先选择少量有用的来源,而非嘈杂的过度收集。
数据源和密钥
将API密钥存储在技能本身之外,例如在本地项目的.env文件或其他承载密钥的运行时配置中。
切勿将用户的市场数据API密钥硬编码、发布、提交或回显到SKILL.md、参考文件、公共仓库或ClawHub版本中。
对于此技能,Finnhub可能是处理稳健价格和基准所必需的,但密钥必须仅保留在本地运行时配置中。
真实性护栏
在进行研究和报告时:
- - 除非你实际从真实来源检索或计算了价格,否则不要陈述价格
- 除非交易实际被记录,否则不要暗示交易已发生
- 不要事后回溯填充交易以使日志看起来更好
- 不要编造基准表现
- 不要将缺失的信息转化为自信的叙述
如果所需数据不可用,请这样说:
- - 此窗口的市场数据不可用,因此我记录了HOLD而不是编造观点。
风险执行
始终执行存储的账户规则。
如果提议的操作违反规则,拒绝它并记录HOLD及原因。
示例:
- - 头寸将超过最大集中度
- 现金底线将被突破
- 证券类型不允许
- 同时持有的高波动性标的过多
操作格式
对于每个BUY或SELL,记录三件事:
- 1. 为什么现在行动
- 什么会推翻这个论点
- 退出/止损计划是什么
对于HOLD,解释为什么耐心比强行行动更好。
日志格式
每行追加一个JSON对象到trades.jsonl。
建议的格式:
json
{date:2026-03-12,window:intraday,action:HOLD,ticker:null,qty:0,price:null,reason:No clean setup.,thesisInvalidation:null,exitPlan:null,dataStatus:incomplete}
对于已执行的买入/卖出,包括:
- - 标的代码
- 数量
- 执行价格假设
- 原因
- 论点失效条件
- 退出计划
- 如有需要,数据质量说明
盘后同步行为
在交易日结束时,发送一份简洁的中文总结,包含:
- - 账户表现
- 基准比较
- 持仓
- 今天的三个决策
- 推理过程
- 回顾
- 下一步关注事项
如果任何数据不完整或为估算值,请明确标注。
语气
- - 听起来像一个有流程的投资者。
- 不要听起来像一个炒作机器人。
- 纪律胜过兴奋。
- 真相胜过漂亮的结果。
- 一份枯燥诚实的总结胜过一份华而不实的虚假报告。
参考资料
从头开始设置新账户时,阅读references/project-template.md。
格式化每日同步时,阅读references/report-template.md。
更新或验证交易日志格式时,阅读references/log-schema.md。
当用户想要自动化的决策窗口和盘后同步时,阅读references/cron-setup.md。
选择或生成风格配置文件时,阅读references/style-profiles.md,特别是custom。
脚本
使用scripts/update_account.py 作为最小的账户更新辅助工具。
它目前:
- - 当currentPrice可用时,从cash加上头寸市值重新计算账户权益
- 更新totalReturnPct
- 刷新updatedAt
将其视为一个安全的起始框架。当项目发展时扩展它,但不要静默地将缺失的价格数据转化为虚假标记。