RealTest User Guide
RealTest User Guide

 

 

Navigation: <Root level>

Using RealTest with Claude Code

 

 

 

 

Claude Code is an AI-powered coding tool from Anthropic that can write, run, and iteratively improve RealTest scripts through natural language conversation.

Installing Claude Code

Download the Claude Code 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.

Model Choice

Claude Code offers two models: Opus and Sonnet. In the desktop app, use the model dropdown to switch. In the CLI, use the /model command.

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 than Sonnet. In practice, Opus tends to get things right on fewer attempts, 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.

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 Claude how to write and run RealTest scripts. Claude reads this automatically when you start a session in this folder.

realtest_script_language.md -- a concise and complete RealTest script language reference, written by Claude after studying the ReaTest source code. The instructions in CLAUDE.md tell Claude to refer to this file as needed.

research_output.rts -- an Include file that defines a consistent Results column set and adds SaveTestListAs and SaveTradesAs settings to facilitate Claude's iterative strategy research.

Granting Claude Code Permissions (Optional)

The installer creates a folder named xxx.claude inside Scripts\Research containing a settings.local.json file with a recommended permission set. Claude Code ignores this folder until you rename it to .claude.

If you want the smoothest first-session experience, rename xxx.claude to .claude before starting Claude Code. This pre-approves running realtest.exe, reading output files, and editing scripts in your research folder.

If you would rather approve permissions as they come up, leave the folder alone. Claude will prompt for each new command the first time; you can approve "just once" or "always allow" as you go.

Either way, you can review and edit the permissions file in any text editor. See the Claude Code documentation on settings.local.json for the full rule syntax.

Your First Session

1. Open the Claude Code desktop app (or a terminal)

2. Navigate to your research folder (C:\RealTest\Scripts\Research)

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

Claude 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 Claude will modify and re-run

Say what you want to explore, not how to code it -- Claude handles the RealTest syntax

If Claude hits a parse error, it reads the error log and fixes it automatically

 

 

 

 

Copyright © 2020-2026 Systematic Solutions, LLC