trading-loop
Skill24 starsChanged 2 months agoMITView on GitHub
The autonomous trading decision loop for Quant. Run on every wake (market-open scan, scheduled re-eval, fired price trigger, or Jordan's chat). Reads policy, gathers data, researches, risk-checks, executes, journals, and reports. Use whenever you are deciding whether/what to trade.
In this repository27 other files it gives its agents.
- persona.example/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agentsSkill
- cloudflareSkill
- deep-researchSkill
- fishingSkill
- frontend-designSkill
- generationSkill
- gifgrepSkill
- hikeSkill
- historySkill
- image-genSkill
- instant-shareSkill
- iterative-designSkill
- kitchenSkill
- printingSkill
- radaromega-proSkill
- radaromegaSkill
- remindersSkill
- skycamSkill
- summarizeSkill
- compare-optionsSkill
- research-trioSkill
- teamsSkill
- videoSkill
- voice-memoSkill
- web-design-guidelinesSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Every time you're woken:
- Very specific: line 67
When Jordan changes guidance ("don't touch crypto", "be more aggressive", "keep $50 cash"), translate it into concrete limits and call …
- Very specific: line 81
Never place an order except through execute_trade → place_equity_order → confirm_order.
- Very specific: line 83
If propose_trade/execute_trade clamps or rejects, take the clamped size or pass.
- Distinctive: line 86
Check tradability; don't assume fills when the market is closed.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Trading loop
This is how you (Quant) turn a wake-up into a sound, policy-compliant action on a real Robinhood account. The deterministic risk check in code is the law; you propose, code disposes.
When to run
Every time you're woken:
- A scheduled scan/review fires (
trading_schedule). - A price trigger fires (
[PRICE_TRIGGER]/[PRICE_TRIGGER_CHECK]event). - A research sub-agent you spawned finishes.
- Jordan texts you (guidance, a question, or an instruction).
The loop
read_policy— always first. Note the vision, the hard limits, and the kill switch. IfkillSwitchEffectiveis true → do nothing but tell Jordan you're halted.- Gather state from your Robinhood tools:
get_accountsonce (cache the agentic account number),get_portfolio→ equity, cash,get_equity_positions→ what you hold,get_equity_quotes→ live prices for candidates/holdings. Alsodaily_pnlfor today's order count + last snapshot.
- Research (scale to the stakes):
- Quick:
web_search+ quotes. - Deep: spawn a research sub-agent or a
deep_researchteam for a thesis that needs multiple angles. Sub-agents research and recommend only — they never trade. You'll be woken when they finish; pick up their brief.
- Quick:
- Form a thesis for each candidate: entry reason, rough exit, intended size.
propose_trade— pass the order + a fresh market snapshot (equity, cash, price, tradable, your held qty/value, day P&L). It runs the risk check and returns allow / clamp / reject + the clamped quantity + reasons. Respect it.execute_trade— same args + yourthesis. On approval it returns the EXACT order spec (with aref_id). Place it by calling the Robinhoodplace_equity_ordertool with those exact values, thenconfirm_orderwith the broker's order id and state. (Optionallyreview_equity_orderfirst to surface cost/alerts — but the policy is your standing authorization; you do not need to ask Jordan per trade.)journal_decision— if you looked and chose NOT to trade, record why. (Executed trades are journaled automatically.)- Report to Jordan — a short proactive text: what you did and the one-line why; fills; any trade the risk check refused (say why); breaker/kill-switch events. Pull live numbers for "how are we doing".
Steering
When Jordan changes guidance ("don't touch crypto", "be more aggressive",
"keep $50 cash"), translate it into concrete limits and call update_policy.
Then update the "Current mandate" section of persona/trading/SOUL.md so the
intent persists, not just the numbers.
Triggers & schedules
register_price_triggerto be woken at a price level;list_price_triggers/cancel_price_triggerto manage.trading_schedulefor recurring scans (market open30 9 * * 1-5, EOD review),trading_wakefor a one-shot follow-up.
Hard rules
- Never place an order except through
execute_trade→place_equity_order→confirm_order. Never bypass the risk check. - If
propose_trade/execute_tradeclamps or rejects, take the clamped size or pass. Don't argue with the gate. - Small account: prefer fractional shares, diversify, respect the %-per-name cap.
- Check tradability; don't assume fills when the market is closed.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

