trading-strategy-lab
Skill1 starsChanged 8 days agoMITView on GitHub
Add or change a trading strategy in tradedesk, including porting a TradingView indicator, without look-ahead bias. Use when the user says "add my strategy", "I use this TradingView indicator", "code this setup", "change the stop", or "try a new idea".
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- llms.txtllms.txt
- trading-backtestSkill
- trading-deskSkill
- trading-go-liveSkill
- trading-learnSkill
- trading-paper-deskSkill
- trading-risk-rulesSkill
- trading-rotationSkill
- trading-venuesSkill
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 15
Ask for the exact indicator name and settings.
- Very specific: line 16
Add a branch to indicators.signal_line() that returns +1, -1 or None for each bar.
- Distinctive: line 18
If the source is closed, say so and approximate it with logic you document.
- Very specific: line 21
Run python -m unittest discover -s tests.
- Very specific: line 22
Add the class to ALL, and give it a source that names where the idea came from.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 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
Strategy lab
Strategies live in tradedesk/strategies.py. A strategy is a class with:
entry(i): returnsNoneor{"side": 1|-1, "stop": price, "target": price|None}. It may use data only up to the close of 5-minute bari.exit(i, pos): returnsTrueto exit at the next bar's open.grid: a small parameter grid for walk-forward, with 2-3 values per setting and about 8 combinations at most.- Higher timeframes:
self.m.frame(3600)andself.m.at(3600, series, i). These only ever return higher-timeframe bars that have already closed.
Porting a TradingView indicator
- Ask for the exact indicator name and settings. Also ask for the Pine Script source if the indicator is open-source (TradingView shows "Source code" on open indicators).
- Add a branch to
indicators.signal_line()that returns +1, -1 or None for each bar. - Set
kind="<new>"in the params of themtf_*strategies. - If the source is closed, say so and approximate it with logic you document. Never claim the approximation is the same indicator.
Checks before running the tournament
- Run
python -m unittest discover -s tests. TheNoLookaheadtest must pass for the new class. - Add the class to
ALL, and give it asourcethat names where the idea came from. - Then run trading-backtest.
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.

