RealTest User Guide
RealTest User Guide

 

 

Navigation: Running Scans >

Test Output Scan

 

 

 

 

A Test Output Scan (TestScan) is similar to a Data Scan (Scan).

To run a TestScan, the script that defines it must also include one or more Strategy and/or Benchmark definitions, must specify TestOutput: Scan (or that option must be selected in the Settings Panel), and must be run in Test or Orders mode.

The structure of the Scan and TestScan definitions in the script look identical. The differences come from when they are run and what syntax their formulas have access to.

Because a Data Scan is not run in the context of a backtest, none of the syntax elements that relate to backtests -- position information, test statistics, etc. -- are available for use in Scan formulas. TestScan formulas have full access to that additional set of information.

By default, a TestScan is run only once per test, at the end of the test. Specifically, it is run after the strategy formulas have been evaluated and applied on the last date of the test but before the end-of-test exits have been processed and added to the trade list. To run your TestScan every day of the test, add TestScanAllDates: True to your script's Settings or TestSettings section.

Because a script can include multiple Strategy definitions but has only one TestScan, any reference to anything about a strategy must be done using either the Combined or Extern functions.

For example, to show the net position in a symbol held across all strategies, use:

TestScan:
   NetPos: Combined(Shares)

Or to see the position held by a specific strategy:

TestScan:
   Strat1Pos: Extern(@Strat1, Shares)
 

By default, for each date that the TestScan is run, it evaluates each formula once per symbol, much like a DataScan does. To run your TestScan for each open position rather than each symbol, add TestScanPositions: True to your Settings or TestSettings. When TestScanPositions: True is used, an output row is added separately for each specific position, including multiple positions in the same symbol. In this mode, there is no output for symbols that do not have an open position on that date of the test.

The Filter, Sort, and special scan-related settings described for Data Scan are similarly applicable to TestScan output.

If a script includes both Scan and TestScan sections and needs different scan-related settings for each, use the ScanSettings and TestSettings sections to differentiate them.

 

 

 

 

Copyright © 2020-2026 Systematic Solutions, LLC