RealTest User Guide
RealTest User Guide

 

 

Navigation: RealTest Script Language > Syntax Element Details >

EndOfTestExits

 

 

 

 

Category

Settings

Description

Controls whether open positions are exited at the end of a backtest

Choices

True - exit all positions at the end of each test (default)

False - do not exit open positions

Notes

Positions exited because the test has ended will show "end of test" in the "Reason" column of the trade list. This setting does not affect End-of-Data Exits, which close a position at its symbol's last bar when the data ends before the test does.

When EndOfTestExits is False, each position that is still open when the test ends is added to the trade list as an "Open Long" or "Open Short" row: the entry columns are filled in, the exit columns show n/a, "Reason" is "open position", and "Bars" is the number of bars held so far. Like skipped setups, these rows are excluded from all trade statistics. Their trade charts (including those saved by SaveChartsTo) show the entry marker only, extending to the last bar of the test, so an open position can be reviewed as "currently held" rather than as a trade closed at the end of the test. The rows appear for whichever of Strategy and Benchmark is selected in KeepTrades, and are also written by SaveTradesAs.

Possible reasons to disable end-of-test exits are:

to exclude still-open positions from trade-level stats

to see and chart the still-open positions as they stand at the end of the test (e.g. when reviewing a live portfolio via OrdersMode OrderClerkStats)

to keep those position records in memory for inspection in the Debug Panel (previously this was controlled by the Debug choice of the TestOutput setting)

 

 

 

 

Copyright © 2020-2026 Systematic Solutions, LLC