Install
openclaw skills install moss-trade-bot-factory-enUsers describe a trading style in natural language, and the skill creates a crypto trading bot, runs local backtests, supports periodic reflection-driven evo...
openclaw skills install moss-trade-bot-factory-enA professional crypto quantitative trading bot factory plus strategy tuning specialist.
Knowledge base (read on demand, never all at once):
cat {baseDir}/knowledge/params_reference.mdcat {baseDir}/knowledge/evolution_guide.mdcat {baseDir}/knowledge/platform_ops.mdscripts/requirements.txt for local Python packages such as pandas, numpy, ccxt, and scipy{baseDir}/.venv; do not install extra packages and do not modify system-wide PythonThis skill needs its bundled local Python environment. Install it now into {baseDir}/.venv?cd {baseDir} && python3 scripts/setup_env.py
PYTHON_BIN="{baseDir}/.venv/bin/python"
trade_api_url, whose default is https://ai.moss.site--platform-url should be only the site origin, for example https://ai.moss.site; scripts will append the full API prefix and request https://ai.moss.site/api/v1/moss/agent/agents/bind~/.moss-trade-bot/agent_creds.json by default; if skill config agent_creds_path is set, prefer that path. Credentials are sent only to the user-specified platform address--platform-url and the local creds file. They do not read hidden environment variables and do not scan unrelated system credentialsscripts/requirements.txt, through scripts/setup_env.py, into the local .venv/tmp/*.json files are only local intermediates for params, fingerprints, and backtest outputsFollow the steps below strictly. Do not skip steps. Stop only at the confirmation checkpoints explicitly called out below; continue directly for everything else.
After receiving the strategy description, use professional judgment to auto-fill the configuration. Ask only one question: whether to enable evolution.
Automatic inference rules (do not ask item by item):
0.5), bearish / contrarian -> short-biased (0.1~0.3), conservative / DCA -> long-biased (0.6~0.8)3~5x, neutral -> 8~12x, aggressive -> 15~25x, all-in -> 50~100xBTC/USDT, 15m, 148 days, $10,000You must ask the user:
Do you want to enable weekly evolution?
On: every week, tactical parameters are fine-tuned based on trading results while the core personality stays the same. Best for trend / momentum strategies
Off: parameters stay fully fixed. Best for highly disciplined strategies or when you already trust the setup
Default recommendation: On
Backtest data prerequisite: you must have an OHLCV CSV before running a backtest.
fetch_data.py defaults to this rangeWays to get data:
scripts/data_BTC_USDT_15m_148d.csv (2025-10-06 ~ 2026-03-03)cd {baseDir}/scripts && "$PYTHON_BIN" fetch_data.py --symbol <symbol> --timeframe <timeframe> 2>/dev/null | tee /tmp/fingerprint.json
Generate the parameters first, then present a concise execution summary and wait for one confirmation before the first local backtest run. Do not force a line-by-line JSON review by default, but show the full parameter JSON immediately if the user asks for it.
cat {baseDir}/scripts/params_schema.jsonname_i18n / personality_i18n / description_i18n, always in the format { "zh": "...", "en": "..." }symbol / timeframe / capital / evolution on or off / data sourcecat {baseDir}/knowledge/params_reference.mdReady to run this local backtest?Bilingual copy constraints:
name_i18n.zh/en <= 64personality_i18n.zh/en <= 64description_i18n.zh/en <= 280*_i18n.zh/enIf the user enabled weekly evolution, run the evolution backtest directly. Do not run a baseline first and then ask again.
cat > /tmp/bot_params.json << 'PARAMS_EOF'
{full parameter JSON}
PARAMS_EOF
cd {baseDir}/scripts && "$PYTHON_BIN" fetch_data.py [--data <CSV path>] --symbol <symbol> --timeframe <timeframe> 2>/dev/null > /tmp/fingerprint.json
CSV_PATH=$(python3 -c "import json; print(json.load(open('/tmp/fingerprint.json'))['csv_path'])")
cd {baseDir}/scripts && "$PYTHON_BIN" run_backtest.py --data "$CSV_PATH" --params-file /tmp/bot_params.json --capital <capital> --output /tmp/backtest_result.json
First: save params and generate the fingerprint
cat > /tmp/bot_params.json << 'PARAMS_EOF'
{full parameter JSON}
PARAMS_EOF
cd {baseDir}/scripts && "$PYTHON_BIN" fetch_data.py --data <CSV path> --symbol <symbol> --timeframe <timeframe> > /tmp/fingerprint.json
Second: run the segmented backtest
cd {baseDir}/scripts && "$PYTHON_BIN" run_evolve_backtest.py \
--data <CSV path> --params-file /tmp/bot_params.json \
--segment-bars <bars> --capital <capital> --output /tmp/evolve_baseline.json
Third: do the reflection yourself. Read the evolution guide first:
cat {baseDir}/knowledge/evolution_guide.md
Then read the evolution_log inside /tmp/evolve_baseline.json, analyze each segment using the 7 reflection principles, and produce an evolution plan.
Fourth: write the evolution plan and rerun
cat > /tmp/evolution_schedule.json << 'EVO_EOF'
[
{"round": 1, "params": {initial params}},
{"round": 2, "params": {adjusted after reflection}},
...
]
EVO_EOF
cd {baseDir}/scripts && "$PYTHON_BIN" run_evolve_backtest.py \
--data <CSV path> --evolution-file /tmp/evolution_schedule.json \
--segment-bars <bars> --capital <capital> --output /tmp/evolve_result_final.json
## Backtest Result
📈 Evolution mode: +47.3% | Sharpe 0.84 | 84 trades | 21 evolution rounds
Key evolution: entry 0.15→0.18 | sl_atr 2.8→3.3
Next step:
A) Start live auto trading (15-minute decision loop)
B) Upload to platform for verification (use the evolution result + evolution_log; the platform will replay segment by segment)
C) Adjust parameters and rerun
When uploading: use evolve_result_final.json as the result, and use the initial params (/tmp/bot_params.json) as the params. package_upload.py will automatically extract the evolution_log from the result file. Only then will the platform run the same segmented stitched replay as the local evolution result.
A by default, while also listing B/CC by default, with concrete improvement suggestionsI recommend changing XX to YY and rerunning. Do you agree?cat {baseDir}/knowledge/params_reference.mdRead the operations manual first: cat {baseDir}/knowledge/platform_ops.md
Then follow the Verification Upload section in that manual. Key points:
/tmp/evolve_result_final.json, params should be the initial /tmp/bot_params.jsonbot.name_i18n / personality_i18n / description_i18n with both zh/en; both the script and the API reject fake bilingual payloadsplatform_ops.md as the single source of truth instead of repeating them hereRead the operations manual first: cat {baseDir}/knowledge/platform_ops.md
Then follow the Live Trading section in that manual. Key points:
zh/en text fieldsstart auto trading; manual mode still requires confirmation for each orderplatform_ops.md as the source of truth instead of repeating them here150x365API Key / API Secret>20x) must use a wide stop loss (sl_atr_mult >= 2.5)