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

When you run your first Claude Code session in the Research folder, it will frequently ask for permission before accessing local files. Sometimes "Always Allow" is an option. If you find that it keeps asking the same permission after you say "Always Allow", ask it to give itself blanket permission to do 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". This mode is smarter about bypassing permission queries for low-risk operations while still occasionally asking for something more questionable.

Your First Session

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

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

3. (optional) 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.

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