← 返回
数据分析 中文

Mock Trading

Simulate cryptocurrency trading using algorithmic strategies (SMA Crossover, Mean Reversion) without risking real capital. Use when the user wants to start a...
利用算法策略(如移动平均线交叉、均值回归)模拟加密货币交易,无需承担真实资金风险。
yadavabhijeet4
数据分析 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 563
下载
💾 19
安装
1
版本
#latest

概述

Mock Trading Agent Skill

This skill provides a fully functional mock (paper) trading environment. It allows OpenClaw to simulate algorithmic trading by fetching live market data, evaluating algorithmic strategies, and updating a virtual portfolio.

Components

  • assets/portfolio.json: A template virtual bank account containing $10,000 USD.
  • scripts/mock_bot.py: A python script that executes a single "tick" of the trading bot. It fetches the current price, evaluates the strategy based on price history, executes mock trades, and updates the portfolio file.

Setup & Usage

When a user asks to start a mock trading session:

  1. Initialize the Portfolio:

Copy the template portfolio to the user's working directory.

```bash

cp {baseDir}/assets/portfolio.json ./my_portfolio.json

```

  1. Run a Trading Tick:

Run the bot script. This executes a single cycle (fetch data -> evaluate -> trade -> save).

```bash

uv run {baseDir}/scripts/mock_bot.py --portfolio ./my_portfolio.json --asset bitcoin

```

  1. Automation (Heartbeat/Cron):

To run the bot continuously, add the command from Step 2 into the user's HEARTBEAT.md file or schedule it via cron to run every 5-10 minutes.

  1. Reporting:

Read ./my_portfolio.json to report the user's current PnL, cash balance, and trade history.

Modifying Strategies

The script currently defaults to an SMA Crossover strategy. You can edit the python script locally to swap it with Mean Reversion, Momentum Breakout, or RSI strategies if the user requests different logic.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 23:07 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

Excel / XLSX

ivangdavila
创建、检查和编辑 Microsoft Excel 工作簿及 XLSX 文件,支持可靠的公式、日期、类型、格式、重算及模板保留功能。
★ 366 📥 139,952
productivity

golden-rule

yadavabhijeet4
自动化Instagram"黄金时段"互动策略。用于设置机器人监控特定Reel/Post。
★ 0 📥 646
data-analysis

A股量化 AkShare

mbpz
A股量化数据分析工具,基于AkShare库获取A股行情、财务数据、板块信息等。用于回答关于A股股票查询、行情数据、财务分析、选股等问题。
★ 162 📥 59,666