OpenClaw Trading Agent Team: A Synthetic Stock-Scan Test
This page used to summarise a Reddit post about a seven-agent "AI trading desk" built on OpenClaw. We could not check that setup, so we replaced the summary with a test we could check: an OpenClaw agent team that scans five synthetic price series, sizes hypothetical positions under a written policy, has a second agent review the numbers and writes a short brief. We connected no broker or market data feed, placed no orders and simulated no strategy results over time. This is a test of the agent tooling, not of a trading idea.
On 21 November 2026 we ran the commands below from two logged scripts and a few follow-up logged commands in one Docker container from the node:24 image (Node 24.22.3, npm 11.19.1), as root, with OpenClaw 2026.11.6 (06afb10; npm view openclaw dist-tags showed it as latest that day) and DeepSeek deepseek-v4-pro for every agent we ran. Quoted output is from those logs. Afterwards our own script recomputed the agents' scan.json and positions.json from the CSV. It does not check brief.md.
This is not trading advice. The prices come from a fixed-seed script. The symbols TSTA to TSTE are made up for the test; any resemblance to a real ticker is accidental. The rule "last close above its 20- and 50-day averages" is there only to give the agents something they can compute and we can check.
What we found
| Result in our runs | |
|---|---|
| Team | One command created a coordinator plus researcher, writer and reviewer agents |
| Delegation | Asked directly, the coordinator spawned separate researcher, reviewer and writer sessions |
| Accuracy | In all five runs our script matched every checked field of the 5 scan rows and the 3 positions in the JSON files, with no missing or extra rows |
| Schedule | A weekday 08:30 New York job; the first run was set for 2026-11-23 13:30 UTC |
| Scheduled runs | 4 runs: with read,write,exec the coordinator did every role itself; with three agent tools added, delegation happened in 2 of 3 runs |
| The trap | In both runs without delegation, the coordinator still wrote a reviewer verdict into brief.md and called the check independent |
The setup
We started a container, passed the DeepSeek key in as an environment variable and ran everything below inside it:
docker run -d --network host --name oc-e2e node:24 sleep infinity
docker exec -it -e DEEPSEEK_API_KEY oc-e2e bash
We used --network host because name resolution failed inside the default container network on our machine. It means the container was not network-isolated.
Install and onboarding, non-interactive, with the Gateway bound to loopback (our install guide explains each flag):
npm install -g [email protected] --allow-scripts=openclaw
openclaw onboard --non-interactive --accept-risk --mode local --gateway-bind loopback \
--auth-choice deepseek-api-key --secret-input-mode ref \
--skip-daemon --skip-channels --skip-skills --skip-search --skip-health --json
The install took 121 seconds and exited 0, with warnings that the install scripts of @google/genai, esbuild and protobufjs were not allowed. Onboarding installed the DeepSeek plugin and returned "ok": true. Afterwards a search of ~/.openclaw for the key's literal value found it in 0 files.
Step 1: create the team
openclaw agents team create --non-interactive --prefix desk --workspace-root ~/desk --json
The help lists one preset, team, and openclaw agents add --role lists four roles: coordinator, researcher, writer and reviewer. The command created desk-coordinator, desk-researcher, desk-writer and desk-reviewer, each with a workspace under ~/desk holding AGENTS.md, IDENTITY.md, SOUL.md and USER.md. openclaw agents list showed the coordinator as the default agent, next to the main agent that onboarding had already created. The coordinator's config:
openclaw config get agents.entries.desk-coordinator.subagents
{
"delegationMode": "prefer",
"allowAgents": ["desk-researcher", "desk-writer", "desk-reviewer"]
}
The coordinator's AGENTS.md tells it to "Use agents_list when available to discover permitted specialists", to delegate "using sessions_spawn for a bounded task or sessions_send for a follow-up", and: "Do substantive work yourself only when no available specialist fits. If a fitting specialist is blocked, resolve or report the blocker rather than silently duplicating its assignment." All four AGENTS.md files contain the same line: "Never send messages outside the assigned team workflow, publish, purchase, delete, or change production without the human's approval for that action and scope." That line is an instruction to the model. It does not technically block anything. What an agent can actually do is decided by its tools, the credentials it can read and the network it can reach.
There are no trading roles. A "scanner" or "risk manager" is one of the four roles with a different name and instructions. To get more than four agents you add them one by one. With the Gateway stopped, this worked:
openclaw agents add desk-scanner --role researcher --model deepseek/deepseek-v4-flash --non-interactive --json
agents list then showed desk-scanner with the identity "Researcher" and the flash model. The coordinator's allowAgents list still named only the original three specialists, so in our install the new agent did not join the coordinator's team. We did not run desk-scanner; the runs below used the preset team.
Step 2: data, policy and task
Everything the agents use sits in ~/desk/shared:
mkdir -p ~/desk/shared ~/desk/out && cd ~/desk/shared
# save gen.js, risk-policy.md, task.tmpl and check.js from below into this folder
TZ=UTC node gen.js > prices.csv # we checked this line and the next one separately in a fresh node:24 container
apt-get update && apt-get install -y gettext-base # envsubst; not in the node:24 image
envsubst < task.tmpl > task.md
The price generator, gen.js:
// Synthetic closing prices for five invented symbols (TSTA..TSTE), 80 weekdays, fixed seed.
let s = 20261121;
const rnd = () => (s = (s * 1103515245 + 12345) % 2147483648) / 2147483648;
const drift = { TSTA: [50, 0.004], TSTB: [120, -0.002], TSTC: [30, 0.0015], TSTD: [75, 0.006], TSTE: [210, -0.004] };
const px = Object.fromEntries(Object.entries(drift).map(([t, [p]]) => [t, p]));
const rows = ['date,ticker,close'];
for (let d = new Date('2026-07-27'), n = 0; n < 80; d.setDate(d.getDate() + 1)) {
if (d.getDay() % 6 === 0) continue; // skip Sat/Sun
for (const t in drift) {
px[t] *= 1 + drift[t][1] + (rnd() - 0.5) * 0.03;
rows.push(`${d.toISOString().slice(0, 10)},${t},${px[t].toFixed(2)}`);
}
n++;
}
console.log(rows.join('\n'));
It gives 400 rows of date,ticker,close from 2026-07-27 to 2026-11-13. The dates depend on the local time zone: in a fresh node:24 container TZ=UTC gave a byte-identical copy of our file, TZ=America/New_York a different one. The policy, risk-policy.md:
# Paper desk risk policy (test)
- Paper account: 100,000 USD. No live broker is connected; nobody places orders.
- Risk per idea: at most 1% of the account (1,000 USD) between entry and stop.
- Stop: 2% below the last close.
- Max position value: 20% of the account (20,000 USD).
- Only tickers whose last close is above both the 20-day and 50-day simple moving averages qualify.
These numbers are parameters for the test, not a recommendation. The task template, task.tmpl (after envsubst the agents saw /root/desk/...):
Morning scan on synthetic data. Do not place orders or contact anyone.
Inputs: $HOME/desk/shared/prices.csv (date,ticker,close) and $HOME/desk/shared/risk-policy.md.
1. Have the researcher compute, for each ticker, the last close, the 20-day and 50-day simple moving averages of close, and whether the last close is above both. It must write $HOME/desk/out/scan.json as an array of {ticker,last,sma20,sma50,qualifies} with numbers rounded to 2 decimals, and say how it computed them.
2. For qualifying tickers, size a position under the risk policy (stop 2% below last close, risk at most 1,000 USD, position value at most 20,000 USD; whole shares) and write $HOME/desk/out/positions.json as an array of {ticker,last,stop,shares,positionValue,lossAtStop}.
3. Have the reviewer independently recompute two tickers from the CSV and check every position against the policy. Fix anything it finds.
4. Write $HOME/desk/out/brief.md: a table of tickers, signals, shares, position value, stop, and the reviewer's verdict.
Reply with the file paths and which specialists did which step.
And the check, check.js, which reads only the CSV and the agents' two JSON files. It prints FAIL and exits with code 1 if a file is missing, a row is missing or extra, or one of the listed fields is not a number (a boolean for qualifies) or differs from its own result by 0.006 or more. It ignores extra fields and does not read brief.md:
// Recompute scan.json and positions.json from prices.csv only. Usage: node check.js <outdir>
// Reports FAIL and exits with code 1 if a file is missing, a row is missing or extra, or a checked field
// is not a number (boolean for qualifies) or differs from our recomputation by 0.006 or more.
const fs = require('fs'), dir = process.argv[2], H = process.env.HOME;
const by = {};
for (const l of fs.readFileSync(`${H}/desk/shared/prices.csv`, 'utf8').trim().split('\n').slice(1)) {
const [, t, c] = l.split(','); (by[t] ||= []).push(+c);
}
const avg = a => a.reduce((x, y) => x + y, 0) / a.length;
const near = (a, b) => typeof a === 'number' && Math.abs(a - b) < 0.006; // agents round to 2 decimals
const read = f => fs.existsSync(`${dir}/${f}`) ? JSON.parse(fs.readFileSync(`${dir}/${f}`, 'utf8')) : null;
const scan = read('scan.json'), pos = read('positions.json');
let bad = 0; const fail = m => { bad++; console.log('FAIL', m); };
if (!scan) fail('scan.json missing');
if (!pos) fail('positions.json missing');
if (scan && scan.length !== Object.keys(by).length) fail(`scan.json has ${scan.length} rows`);
const want = [];
for (const t in by) {
const a = by[t], last = a.at(-1), s20 = avg(a.slice(-20)), s50 = avg(a.slice(-50)), q = last > s20 && last > s50;
if (q) want.push(t);
const r = scan && scan.find(x => x.ticker === t);
const ok = r && near(r.last, last) && near(r.sma20, s20) && near(r.sma50, s50) && r.qualifies === q;
if (!ok) fail('scan ' + t);
console.log('scan', t, last.toFixed(2), s20.toFixed(2), s50.toFixed(2), q, ok ? 'MATCH' : 'MISMATCH');
if (!q) continue;
const stop = Math.round(last * 98) / 100, perShare = last - stop;
const shares = Math.floor(Math.min(1000 / perShare, 20000 / last));
const p = pos && pos.find(x => x.ticker === t);
const okp = p && p.shares === shares && near(p.stop, stop) && near(p.last, last) &&
near(p.positionValue, shares * last) && near(p.lossAtStop, shares * perShare);
if (!okp) fail('position ' + t);
console.log('size', t, 'stop', stop.toFixed(2), 'shares', shares, 'value', (shares * last).toFixed(2),
'loss-at-stop', (shares * perShare).toFixed(2), okp ? 'MATCH' : 'MISMATCH');
}
if (pos) for (const p of pos) if (!want.includes(p.ticker)) fail('unexpected position ' + p.ticker);
if (pos && pos.length !== want.length) fail(`positions.json has ${pos.length} rows, expected ${want.length}`);
console.log('mismatches', bad);
process.exitCode = bad ? 1 : 0;
Run it as node ~/desk/shared/check.js ~/desk/out. We kept each run's output folder and checked all five at the end: 0 mismatches and exit code 0 in each. To make sure the script can fail, we also ran it on copies with one changed lossAtStop and one deleted position (3 failures), with positions.json removed (4 failures) and with one price written as a string (1 failure); each exited with code 1.
Step 3: run it and check who did the work
We started the Gateway in the background (openclaw gateway; openclaw gateway status reported a working connection after about 15 seconds) and sent the task to the coordinator:
openclaw agent --agent desk-coordinator --message-file ~/desk/shared/task.md --timeout 840 --json
The command returned after 192 seconds with "status": "ok" and an empty reply ("payloads": []), although the task asked for one. The files came later: scan.json, positions.json and brief.md were all modified after the command returned, brief.md 6 minutes 33 seconds after we sent the task. If you script this, do not treat the command's return as the end of the run. Give each run an empty output folder, and check the files' contents and the sessions before you use the results. The reply reported a cost of 0.026 USD for this run; we do not know whether that includes the specialists' sessions.
A brief that says "the reviewer checked it" proves nothing by itself, so we listed the sessions:
openclaw sessions --all-agents --json
Besides the coordinator's own session there were four spawn-child sessions: desk-researcher (22,354 tokens), desk-reviewer (22,077) and desk-writer twice (12,145 and 12,703). That shows the specialists were started. It does not show what each of them wrote; for that you would read the session contents, which we did not log. Our script matched the output files:
| Symbol | Last | SMA20 | SMA50 | Qualifies | Shares | Position value | Stop | Loss at stop, before costs |
|---|---|---|---|---|---|---|---|---|
| TSTA | 66.12 | 62.14 | 59.94 | yes | 302 | 19,968.24 | 64.80 | 398.64 |
| TSTB | 101.39 | 103.96 | 107.35 | no | — | — | — | — |
| TSTC | 32.84 | 32.41 | 31.70 | yes | 609 | 19,999.56 | 32.18 | 401.94 |
| TSTD | 112.36 | 107.14 | 101.47 | yes | 177 | 19,887.72 | 110.11 | 398.25 |
| TSTE | 147.44 | 151.92 | 159.03 | no | — | — | — | — |
"Loss at stop" is shares × (last − stop), with the stop rounded to cents. It assumes you are filled exactly at the last close and at the stop, with no gaps, slippage or fees. It is arithmetic, not a loss limit.
The table also shows a flaw in our own policy. With a stop 2% below the close, a 20,000 USD position loses about 400 USD at the stop, so for these three positions the 20,000 USD cap, not the 1,000 USD risk rule, decided the share count. We did not ask the agents to audit the policy, and none of the briefs or summaries we logged mentioned it.
Step 4: schedule the pre-market run
Scheduled jobs live under openclaw cron. This job runs the task on weekdays at 08:30 New York time in an isolated session and delivers nothing to any chat:
openclaw cron add --name premarket-scan --agent desk-coordinator \
--cron "30 8 * * 1-5" --tz America/New_York --session isolated \
--no-deliver --timeout-seconds 900 \
--message "Run the morning scan described in $HOME/desk/shared/task.md. Synthetic data only; no orders."
The JSON reply included "nextRunAtMs": 1795440600000, which is 2026-11-23 13:30 UTC, Monday 08:30 in New York. While US daylight time is in effect, the same job runs at 12:30 UTC. The reply for this job also showed two defaults: "toolsAllow": ["*"] and "scheduledToolPolicy": {"version": 1, "mode": "trusted"}. The job reads the same static CSV every time. Nothing in this setup refreshes prices before the run.
openclaw cron list showed two jobs we had not created: "Proactive check (main)" every 30 minutes, with delivery announce -> last (on our install it noted that the owner had no delivery route), and a "Memory Dreaming" job at 0 3 * * *. Run cron list on your own install so you know what else runs on a schedule.
To test the job without waiting for Monday, openclaw cron run <id> queues a run now. openclaw cron runs --id <id> shows the run records with status, duration, model, token usage, session id and the agent's summary.
The trap: a tool list that removes the team
We wanted the scheduled job to have fewer tools than ["*"], so we gave it what the scan seemed to need:
openclaw cron edit <id> --tools read,write,exec
openclaw cron run <id>
The run record: status ok, 66 seconds, and numbers our script matched. The summary was honest about what happened: "No specialist tools (agents_list/sessions_spawn/sessions_send) were available in this environment, so I performed all three roles directly". openclaw sessions afterwards showed one new session, the coordinator's cron session, and no new spawn-child sessions.
That matches its AGENTS.md: no specialist was available, so it did the work itself and said so in the summary.
The output files told a different story. Our task asked for "the reviewer's verdict" in the brief. No reviewer session appeared, and the coordinator wrote one anyway: a "Reviewer verdict" column with "pass" in every row, and the line "Reviewer independently recomputed TSTA (last 66.12, SMA20 62.14, SMA50 59.94) and TSTE (last 147.44, SMA20 151.92, SMA50 159.03); values match the researcher's output." With --no-deliver, the summary that explains this goes nowhere unless you open the run record. Anyone reading only the brief sees what looks like a reviewed run.
Next we added the three agent tools and ran the job three more times:
openclaw cron edit <id> --tools read,write,exec,agents_list,sessions_spawn,sessions_send
openclaw cron run <id>
With these tools added, delegation happened in two of the three runs. In the first of them the coordinator again did everything itself. This time it gave a different reason: "this isolated automation turn cannot collect child results inline and will not resume after yield", so it "executed each role's work directly". Its brief again had a "Reviewer verdict" section starting "Independently recomputed TSTA and TSTD from prices.csv". In the next two runs it did delegate: new spawn-child sessions appeared for the researcher, reviewer and writer each time. According to the coordinator's summaries, in one of them it sized the positions itself, and in the other it said it verified the specialists' numbers with "my own independent computation". Run 2 was the only run with these tools before we restarted the Gateway and disabled and re-enabled the job; with three runs we cannot tell whether that mattered.
All four scheduled runs, as the run records report them (one job, same data, 10:03 to 10:19 UTC; each run had its own session id; we restarted the Gateway between runs 2 and 3):
| Run | Tools | Duration | Input (uncached) | Output | Cache reads | New spawn-child sessions (tokens each) |
|---|---|---|---|---|---|---|
| 1 | read,write,exec |
66 s | 13,940 | 6,600 | 76,160 | 0 |
| 2 | plus the three agent tools | 163 s | 22,174 | 15,229 | 174,976 | 0 |
| 3 | plus the three agent tools | 289 s | 18,885 | 15,667 | 311,424 | 3 (9,900 / 12,405 / 8,748 tokens) |
| 4 | plus the three agent tools | 234 s | 17,688 | 12,977 | 326,400 | 3 (15,770 / 14,456 / 8,275 tokens) |
Our script matched the checked fields in both JSON files in all four runs, so in this test delegation did not change the numbers. Time and tokens are harder to read. Both delegated runs took longer than run 1 (4.4 and 3.5 times as long) and read about four times as many cached tokens. But run 2, which had the same tools and did not delegate, used more uncached tokens (37,403 input plus output) than either delegated run (34,552 and 30,665). So we cannot put the extra tokens down to delegation alone. Cache reads also grew from run to run; we did not investigate why. The specialists' sessions report their own token counts, and we do not know whether the run records include them. With one run on one configuration and three on another, treat these numbers as one observation, not an average.
You can check delegation after each run by counting spawn-child sessions before and after it:
openclaw sessions --all-agents --json | node -e 'let s="";process.stdin.on("data",d=>s+=d).on("end",()=>console.log(JSON.parse(s).sessions.filter(x=>x.kind==="spawn-child").length))'
Treat the session list as evidence and the run summary as a claim. In the four scheduled runs the summaries matched the session list, but a summary is the coordinator's own report, like the brief. A new spawn-child session shows that a specialist was started, not that its work is what ended up in the files.
Note that exec lets the agent run any shell command, including network calls. Narrowing ["*"] to six tools decided whether delegation was possible; it did not make the job safe. Pick the tool list for your own environment and threat model.
What we did not get working or did not test
- A cheaper model for an existing specialist. With the Gateway stopped,
openclaw models listprinted "Showing the local cached model catalog" and listeddeepseek/deepseek-v4-flash.openclaw config set agents.entries.desk-researcher.model deepseek/deepseek-v4-flashwas rejected: "Unknown model: deepseek/deepseek-v4-flash", with a suggestion to runopenclaw models list --refresh --provider deepseek. We did not try that. Creating a new agent with--model deepseek/deepseek-v4-flashwas accepted (see Step 1), but we did not run it. - Adding agents while the Gateway runs. In an earlier attempt
openclaw agents addrefused while the Gateway was running: "This operation requires exclusive offline state ownership." In the logged session we added the agent before starting the Gateway, and it worked. - Anything live: no broker or paper-broker API, no market data feed, no Reddit scanning, no dashboards, no macOS
launchd, no system service. We ran on Linux in Docker.
Limits of this test
This test checked that an OpenClaw team can compute a simple scan and position sizes correctly on synthetic data, and when it really delegates. It says nothing about whether such a desk is safe or profitable with real money. If you build on it:
- Check who did the work in
openclaw sessions, not in the brief or the summary. A brief can describe a review that never ran. - Give scheduled jobs an explicit
--toolslist. In our runs delegation only happened withagents_list,sessions_spawnandsessions_sendin it, and then in 2 of 3 runs, so confirm after each run that newspawn-childsessions appeared. - Recompute the agents' numbers with your own script. "Reviewed" in the output is not proof.
- Read the defaults:
toolsAllow: ["*"],"mode": "trusted", and jobs you did not create incron list. - Treat the approval line in
AGENTS.mdas guidance for the model, not a control, and keep live credentials out of the environment the agents can reach. Our DeepSeek key was in the Gateway's environment and the agents hadexec; we did not check whether an agent could read the key. Nothing in this test shows that it is safe to connect a broker or a real account. The security audit and doctor checks from our install guide are a minimum, not a clearance.
Tested by OpenClaw Radar on 21 November 2026: Docker node:24 (Node 24.22.3, npm 11.19.1), OpenClaw 2026.11.6 (06afb10), DeepSeek deepseek-v4-pro, synthetic prices for invented symbols. See How we test.
👀 See Also

Examining OpenClaw's Use for WhatsApp Auto-Reply
OpenClaw is impressive, but leveraging it for WhatsApp auto-reply is overkill. A smaller Chrome extension offers a more suitable alternative.

Optimizing Multi-AI Workflows with OpenClaw and MemOS
OpenClaw, paired with large models and MemOS, enhances multi-AI workflow stability by managing context and memory effectively.

Using OpenClaw with AI video tools to scale short-form content creation
A developer shares their workflow using OpenClaw to find content angles and hooks, then pairing it with an AI video tool to create and batch-post Shorts, Reels, and TikToks, resulting in consistent affiliate clicks and platform payouts.

Optimizing OpenClaw Agent Costs with DOM Optimization and Dashboard Monitoring
Reduced OpenClaw agent costs by 41% using custom JavaScript evaluation for DOM reads, minimizing API calls and token bloat. Real-time token dashboard supports usage tracking.