|
An agentic AI coding assistant can write, run, and iteratively improve RealTest scripts through natural-language conversation. You describe a strategy in plain English; the assistant writes the .rts script, runs RealTest to parse and test it, reads the results, and refines from there -- all in one conversation.
To make this work well, RealTest ships a research folder of ready-made materials that teach an AI assistant how to write and run RealTest scripts. These materials were developed and tested primarily with Anthropic's Claude Code, but they are plain Markdown and work just as well with other capable agentic coding tools.
The RealTest Research Folder
Starting with version 2.0.31.7, the RealTest installer creates a ready-to-use research folder at Scripts\Research inside your RealTest installation directory (e.g. C:\RealTest\Scripts\Research). It contains:
•CLAUDE.md -- instructions that teach an AI assistant how to write and run RealTest scripts: the command-line workflow, common pitfalls, and iteration discipline. Claude Code reads this file automatically when you start a session in the folder; with another tool, point the assistant at it (or copy its contents into whatever instruction file that tool uses).
•realtest_script_language.md -- a concise and complete RealTest script language reference, written by studying the RealTest source code. CLAUDE.md tells the assistant to consult it as needed.
•userguide\ -- the complete RealTest user guide in Markdown form (the same content you are reading now), one file per topic. Start at userguide\toc.md, which lists every topic with a link to its file. This lets the assistant answer questions about menus, dialogs, settings, and program behavior -- not just script syntax.
•research_output.rts -- an Include file that defines a consistent Results column set and adds SaveTestListAs and SaveTradesAs settings to streamline iterative strategy research.
Choosing an AI Assistant
Any agentic AI coding assistant that can read local files and run programs on your computer can use these materials. The reference setup -- and the one the research folder was built and tested against -- is Claude Code from Anthropic.
To use Claude Code, download the desktop app for Windows from https://claude.ai/download. It includes everything you need -- no terminal experience required. If you already have the Claude Code CLI installed and prefer working in a terminal, that works too -- the desktop app and CLI are the same product with different interfaces. On first run you will authenticate with your Anthropic account, and Claude Code will read CLAUDE.md automatically when you open a session in the research folder.
Claude Code offers two models: Opus and Sonnet. Switch between them with the model dropdown in the desktop app, or the /model command in the CLI.
Opus is recommended for RealTest work. It handles the multi-step workflow (write script, parse, read errors, fix, test, interpret results) more reliably and with less back-and-forth, which may actually use fewer tokens despite its higher per-token cost. Sonnet can work for simpler tasks but is more likely to thrash on parse errors or misread results. The "medium" effort level setting is generally sufficient.
Competing models and their agentic coding tools also work well with the research-folder materials. Because the instructions, language reference, and user guide are all plain Markdown, you can point any capable assistant at them. A tool that looks for its own instruction filename rather than CLAUDE.md can simply be told to read it, or you can copy its contents into whatever file that tool uses.
Granting Permissions
Agentic tools ask permission before accessing files or running programs, and how you grant standing permission varies by tool. In Claude Code, your first session in the research folder will frequently ask before accessing local files. Sometimes "Always Allow" is an option. If it keeps asking the same permission after you say "Always Allow", ask it to give itself blanket permission for that operation (e.g. running RealTest) on any file. It will then modify its own permission list file, which you can view and even edit yourself in the .claude folder it creates inside the research folder. See the Claude Code documentation on settings.local.json for the full rule syntax.
An alternative to the specific-permissions dance is to put Claude in "Auto" mode, which is smarter about bypassing permission queries for low-risk operations while still occasionally asking for something more questionable.
Your First Session
1. Open your AI coding assistant (for Claude Code, the desktop app or a terminal)
2. Point it at your research folder (C:\RealTest\Scripts\Research)
3. (optional, Claude Code) Turn on "Auto" mode to avoid the permissions dance
4. Try a prompt like:
Write a mean-reversion strategy for S&P 500 stocks that buys 3-day pullbacks and exits on a bounce. Run it and show me the results.
The assistant will write the .rts file, run RealTest to parse and test it, read the results, and summarize the performance -- all in one conversation.
Tips
•Be specific about your universe and time frame -- "Russell 1000 stocks since 2000" gives better results than "US stocks"
•Iterate in conversation -- "tighten the stop to 5%" or "add a VIX filter" and the assistant will modify and re-run
•Say what you want to explore, not how to code it -- the assistant handles the RealTest syntax
•If the assistant hits a parse error, it reads the error log and fixes it automatically
|