[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-1302":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":8,"htmlUrl":8,"language":9,"languages":8,"totalLinesOfCode":8,"stars":10,"forks":11,"watchers":12,"openIssues":13,"contributorsCount":13,"subscribersCount":13,"size":13,"stars1d":12,"stars7d":14,"stars30d":15,"stars90d":13,"forks30d":13,"starsTrendScore":16,"compositeScore":17,"rankGlobal":8,"rankLanguage":8,"license":8,"archived":18,"fork":18,"defaultBranch":19,"hasWiki":18,"hasPages":18,"topics":20,"createdAt":8,"pushedAt":8,"updatedAt":21,"readmeContent":22,"aiSummary":23,"trendingCount":13,"starSnapshotCount":13,"syncStatus":12,"lastSyncTime":24,"discoverSource":25},1302,"Auto-Quant","TraderAlice\u002FAuto-Quant","TraderAlice",null,"Jupyter Notebook",344,43,2,0,7,24,6,48.83,false,"master",[],"2026-06-12 04:00:08","# Auto-Quant\n\n> LLM-native autonomous quant research loop. Karpathy's\n> [autoresearch](https:\u002F\u002Fgithub.com\u002Fkarpathy\u002Fautoresearch) pattern applied to\n> FreqTrade strategies on a 5-pair crypto universe (BTC, ETH, SOL, BNB, AVAX)\n> across 1h \u002F 4h \u002F 1d timeframes.\n\nThe idea: give an LLM agent a FreqTrade backtest harness and a single strategy\nfile. The agent modifies the strategy, runs a backtest, checks if the result\nimproved, keeps or discards, and repeats. Over many iterations the hope is to\nobserve which patterns the LLM actually finds useful on this asset pair. The\n**loop lives in `program.md`** — not in any orchestrator — and is executed by\nwhatever LLM agent you point at the repo.\n\nThis is a prototype to validate whether Karpathy's autoresearch pattern\ntransfers to quant research. The success metric is \"did the loop run and\nproduce an interpretable `results.tsv`\", **not** \"did we find a profitable\nstrategy\". Nothing in this repo is a recommendation to trade real capital.\n\n## A run in one picture\n\n![Sharpe frontier — v0.1.0 run](sharpe-frontier.png)\n\nOne dot per backtest over 99 experiments on BTC\u002FUSDT + ETH\u002FUSDT @ 1h. Green\ndots were kept by the agent, gray were discarded. The red line is the\nrunning best of *kept only* — it plateaus at Sharpe 1.44, **not** at the\nSharpe-18 cluster on the right. Those high-Sharpe runs are gray because the\nagent itself identified them as oracle-gaming (ROI-clipping that compressed\nreturn variance without improving real return) and retroactively discarded\nthem. Full write-up in\n[`versions\u002F0.1.0\u002Fretrospective.md`](versions\u002F0.1.0\u002Fretrospective.md).\n\n## How it works\n\nFour things that matter:\n\n- **`config.json`** — FreqTrade config, fixed. Pairs, timeframe, fees, dry-run\n  wallet, timerange. The agent does not touch this.\n- **`prepare.py`** — one-time data download from Binance via FreqTrade's Python\n  API. Downloads 1h, 4h, and 1d OHLCV for both pairs (v0.3.0+ uses the extra\n  timeframes via the `@informative` decorator). The agent does not touch this.\n- **`run.py`** — in-process **batch backtest**. Discovers every `.py` under\n  `user_data\u002Fstrategies\u002F` (skipping files prefixed `_`), runs FreqTrade's\n  `Backtesting` for each, and prints one `---` summary block per strategy.\n  The agent does not touch this.\n- **`user_data\u002Fstrategies\u002F`** — **the directory the agent owns**. Each `.py`\n  is one strategy; up to 3 active at a time. Agent creates \u002F evolves \u002F forks\n  \u002F kills strategies here. Strategies evaluate on 1h base across the 5-pair\n  portfolio, and can opt into 4h\u002F1d context AND\u002For cross-pair signals via\n  FreqTrade's `@informative` decorator (see `_template.py.example` for the\n  pattern). `run.py` reports per-pair metrics alongside the aggregate.\n\nPlus:\n\n- **`program.md`** — the autonomous-research instructions the human points the\n  LLM agent at.\n- **`results.tsv`** — event log. Schema: `commit | event | strategy_name | sharpe | max_dd | note`.\n  Events: `create | evolve | stable | fork | kill`. Gitignored so it survives\n  `git reset --hard` — past lessons stay available even when experimental\n  commits get thrown away.\n- **`analysis.ipynb`** — post-hoc read: per-strategy trajectories, cap\n  utilization, event distribution, note word frequency.\n\n*Version history*:\n- **v0.1.0** ([archive](versions\u002F0.1.0\u002F)): single-file mutation. Anchored\n  on one paradigm for all 99 rounds. Headline Sharpe 1.44 was mostly\n  oracle gaming (true-edge 0.19). See [retrospective](versions\u002F0.1.0\u002Fretrospective.md).\n- **v0.2.0** ([archive](versions\u002F0.2.0\u002F)): multi-strategy (up to 3 slots).\n  5 paradigms tested \u002F 3 kept \u002F 0 Goodhart attempts. Peak clean Sharpe\n  0.67 (~3.5× better than v0.1.0's true-edge). See [retrospective](versions\u002F0.2.0\u002Fretrospective.md).\n- **v0.3.0** (current): multi-strategy + multi-timeframe + multi-asset\n  portfolio. Adds 4h + 1d informative data, expands universe from 2 pairs\n  to 5 (BTC\u002FETH\u002FSOL\u002FBNB\u002FAVAX), and emits per-pair metrics alongside\n  portfolio aggregate so agents can reason about per-asset edge. In-flight.\n\n## Requirements\n\n- Python 3.11+\n- [uv](https:\u002F\u002Fdocs.astral.sh\u002Fuv\u002F)\n- TA-Lib (the C library — installed separately from the Python binding)\n\n## Install\n\n```bash\n# 1. Install uv if you don't have it\ncurl -LsSf https:\u002F\u002Fastral.sh\u002Fuv\u002Finstall.sh | sh\n\n# 2. Install the TA-Lib C library\n#    macOS:  brew install ta-lib\n#    Linux:  see https:\u002F\u002Fgithub.com\u002Fmrjbq7\u002Fta-lib#dependencies\n#    If native install is painful on your platform, the FreqTrade Docker\n#    image ships with TA-Lib pre-built and works as an alternate runtime.\n\n# 3. Install Python deps\nuv sync\n\n# 4. One-time data download (~a few minutes)\nuv run prepare.py\n\n# 5. Sanity check — with no strategies yet, run.py should report\n#    \"no strategies found\" and exit. That's expected — the agent creates\n#    1-3 starting strategies during setup before the first real backtest.\nuv run run.py > run.log 2>&1; echo \"exit=$?\"\n```\n\nIf step 5 prints `no strategies found...` and `exit=2`, you're ready. (An\nactual backtest run only starts once the agent has created at least one\nstrategy file.)\n\n## Running the agent\n\nOpen a **second** terminal (keep your editor\u002FIDE in the first so the two\nsessions don't fight over the working tree), `cd` into the repo, and start\nyour preferred LLM agent (Claude Code, Codex, Cursor agent, etc.). Then\nprompt something like:\n\n> Have a look at `program.md` and let's kick off a new experiment. Let's do\n> the setup first.\n\nThe agent reads `program.md`, goes through setup, then enters the experiment\nloop. It keeps iterating until you interrupt it or it runs out of context.\n\n### Permissions\n\nThe loop only works if the agent can run commands without a human approving\neach one — it will invoke `uv run run.py`, `git commit`, `git reset`, and\nedit the strategy file hundreds of times. How you grant that depends on your\ntooling:\n\n- **Claude Code**: prefer a scoped allowlist via a project-level\n  `.claude\u002Fsettings.json`. See the\n  [permissions docs](https:\u002F\u002Fdocs.claude.com\u002Fen\u002Fdocs\u002Fclaude-code\u002Fsettings#permissions)\n  for patterns like `Bash(uv run *)` and `Bash(git commit:*)`.\n- **Other agents**: most have an equivalent — a config flag or settings file\n  to mark specific commands or tools as pre-approved.\n\nRead the docs and choose a permission posture you're comfortable with before\nleaving a loop running unattended. The agent is pointed at a sandboxed\nFreqTrade workspace and has no live-trading access (all `dry_run`), but it\ndoes run arbitrary shell commands and write files inside this directory.\n\n## Project structure\n\n```\nAuto-Quant\u002F\n├── README.md\n├── pyproject.toml                     # uv-managed deps\n├── .python-version                    # 3.11\n├── config.json                        # FreqTrade config (read-only for agent)\n├── prepare.py                         # data download (read-only for agent)\n├── run.py                             # backtest + summary (read-only for agent)\n├── program.md                         # agent instructions\n├── analysis.ipynb                     # post-hoc analysis\n├── user_data\u002F\n│   ├── strategies\u002F\n│   │   ├── _template.py.example       # skeleton the agent copies from\n│   │   └── \u003Cagent-created files>.py   # up to 3 active at a time\n│   ├── data\u002F                          # gitignored — downloaded OHLCV\n│   └── backtest_results\u002F              # gitignored — FreqTrade outputs\n├── versions\u002F                          # frozen snapshots of past runs\n└── results.tsv                        # gitignored — agent's event log\n```\n\n## Design notes\n\n- **Agent owns one directory, not one file.** `user_data\u002Fstrategies\u002F` is its\n  workspace; everything else is evaluation contract. Up to 3 strategies\n  simultaneously, hard cap. Multi-strategy exists specifically to fight\n  the single-paradigm anchoring that v0.1.0 exhibited.\n- **No CLI indirection.** The agent only runs `uv run prepare.py` and\n  `uv run run.py`. `run.py` uses FreqTrade's `Backtesting` class in-process,\n  so startup is fast and errors surface as real Python stack traces.\n- **`results.tsv` is a gitignored event log.** Each round, the agent appends\n  rows (one per strategy touched, with event type: create\u002Fevolve\u002Fstable\u002Ffork\u002Fkill).\n  It survives `git reset --hard` so past lessons stay available even when\n  experimental commits get thrown away.\n- **LLM decides keep\u002Fkill, not a scalar rule.** Sharpe on a finite window\n  is noisy and gameable. Agent reads the full per-strategy summary blocks\n  and decides inline which strategies to evolve, fork, or kill — the\n  program.md rules force action but not which action.\n- **Stagnation rule.** A strategy can't sit idle for more than 3 consecutive\n  stable rounds — agent must evolve, fork, or kill it. With only 3 slots,\n  dead weight is expensive.\n\n## License\n\nMIT.\n","Auto-Quant 是一个基于 LLM 的自主量化研究循环项目，旨在探索将 Karpathy 的自动研究模式应用于 FreqTrade 策略。该项目利用 LLM 代理修改策略、运行回测并根据结果迭代优化，适用于对 BTC, ETH, SOL, BNB, AVAX 这五种加密货币在 1 小时、4 小时和 1 天时间框架下的策略进行研究。其核心功能包括通过 `program.md` 指导 LLM 执行研究循环，并生成可解释的结果文件 `results.tsv`。适合于希望验证自动研究模式是否适用于量化交易策略开发的研究者或开发者使用，但不推荐用于实际资本交易。","2026-06-11 02:42:53","CREATED_QUERY"]