agentleFS
F0rger123F0rger123/ultimate-claude-trading-skill/skills/trading-strategy-lab/SKILL.md

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".

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
  1. Distinctive:

    Ask for the exact indicator name and settings.

    line 15
  2. Very specific:

    Add a branch to indicators.signal_line() that returns +1, -1 or None for each bar.

    line 16
  3. Distinctive:

    If the source is closed, say so and approximate it with logic you document.

    line 18
  4. Very specific:

    Run python -m unittest discover -s tests.

    line 21
  5. Very specific:

    Add the class to ALL, and give it a source that names where the idea came from.

    line 22

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Strategy lab

Strategies live in tradedesk/strategies.py. A strategy is a class with:

  • entry(i): returns None or {"side": 1|-1, "stop": price, "target": price|None}. It may use data only up to the close of 5-minute bar i.
  • exit(i, pos): returns True to 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) and self.m.at(3600, series, i). These only ever return higher-timeframe bars that have already closed.

Porting a TradingView indicator

  1. 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).
  2. Add a branch to indicators.signal_line() that returns +1, -1 or None for each bar.
  3. Set kind="<new>" in the params of the mtf_* strategies.
  4. 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. The NoLookahead test must pass for the new class.
  • Add the class to ALL, and give it a source that names where the idea came from.
  • Then run trading-backtest.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.