Your first backtest
Establish a reproducible historical baseline using the standalone SJS crossover.
Start with Your first SJS strategy. It uses three observed closes, enters on an upward crossover, and requests an exit on a downward crossover. Pine and L3 are optional and are not needed for this baseline.
1. Prepare the source
Paste the complete crossover into the SJS editor. Keep other order-producing source and models disabled. In an app, save the intended source before testing. In Agent Lab, retain the source revision associated with the run; do not compare results by whichever text happens to be open now.
The example assumes one instrument and at most one position. It waits when an order remains pending, consumes each increasing timestamp once, and does not retry a missed crossover automatically.
2. Choose a small data window
Select an exact instrument and available one-minute historical data. Include enough observations for warmup and several changes in direction. The tutorial's two-minute gap threshold assumes one-minute input; changing intervals without changing that threshold can repeatedly reset its average.
Record the full instrument identity, interval, start/end timestamps, and timezone. For futures, include the intended contract rather than relying only on the root symbol. Use Market data to investigate empty or discontinuous windows.
3. Record execution settings
Keep capital, quantity, session filters, and fill-delay settings fixed for the baseline. Record orderFillDelay in seconds; zero permits immediate eligibility in the shared simulator, subject to its other checks.
Do not infer a setting from a chart label. In Agent Lab, use a supported bar-only configuration: tick, book, book-heartbeat, and interpolation options are rejected. A saved live app's broker type is not proof that the historical worker is simulating that broker's matching behavior.
4. Run and inspect
Use the historical run controls in the app editor or Agent Lab, then inspect the completed result. Pick one entry or exit and follow its signal timestamp, attempted operation, execution outcome, and trade record.
The fixed closes 100, 100, 100, 103, 99 produce a BUY signal on observation four and EXIT on observation five in the tutorial. This is a reasoning fixture, not a promise that a selected market window contains those prices. The EXIT request also requires an actual long position and no pending order.
5. Save a baseline, then change one thing
First repeat the same source and settings. Then change a single variable, such as quantity or fill delay, and save a new run. A delayed entry can change whether the subsequent EXIT signal finds a position or a pending order; it is not just a shift in displayed timestamps.
Before interpreting any metric difference, read Execution and fills and Comparing runs.
Historical testing and launch are separate
A completed historical run does not launch the app or establish that a live broker will fill the same requests. When you are ready to inspect a running session, use Backtest, inspect, and launch.