|
When a symbol's data ends before the test does, RealTest normally force-closes any open position in that symbol at the symbol's last bar, with exit reason "end of data". This prevents a position from riding a frozen last price through the remainder of the test. This topic explains exactly when that exit happens, when a position is instead held to the end of the test, and how to interpret what you see in the trade list.
When the Exit Happens
The decision is driven by the symbol's delisting date (available in formulas as InfoDelist):
•Strategy positions get the end-of-data exit if the symbol has no delisting date at all, or has one that has been reached. If the symbol has a delisting date later than its last bar — typically a stock that is halted but still listed — the position is instead held at its last price to the end of the test and closed by the normal "end of test" exit. (Before version 2.0.31.6, every such position got the end-of-data exit.)
•Benchmark positions get the end-of-data exit only when the symbol's delisting date has been reached (since version 2.0.32.3). A Benchmark with no delisting date is held to the end of the test rather than flattened. Benchmarks exist to be referenced — by Extern, Tracker and comparison statistics — so a trailing calendar gap (e.g. a US holiday on the latest bar of a mixed-country import) should not flatten a SPY benchmark and disturb the strategies that reference it.
•Trade list playback positions (imported trades being played back, including hybrid order runs) are exempt from end-of-data exits unless the symbol's delisting date has been reached.
Where the Delisting Date Comes From
•Norgate reports a "last quoted date" for every symbol, which RealTest imports as the delisting date. A genuinely delisted stock has it equal to its final trading day, so an open position in it gets a normal end-of-data exit. A halted-but-still-listed stock has a current last quoted date but no recent bars — that is the held-to-end-of-test case described above, which is intentional: the stock isn't dead, it just isn't printing bars.
•CSV and other imports take the delisting date from the DelistDate column of a SymInfoFile. Without one, the symbol has no delisting date, so open strategy positions always get end-of-data exits.
•Yahoo provides no delisting information, so Yahoo-sourced positions always get end-of-data exits.
•Futures contracts use their expiry date in the same role (see InfoExpiry).
What You See in the Trade List
A forced exit at the symbol's last bar shows Reason "end of data". A position held to the end of the test shows reason "end of test" — but note that its exit date is still the symbol's last bar date, not the test end date, since that is the last date for which a price exists. A trade that appears to exit "end of test" weeks before the end of the test is therefore not an anomaly; it is an open position in a symbol whose data ended (e.g. a halted stock) while its delisting date had not been reached.
Interactions
•Import padding — with Padding enabled, a short trailing gap in a symbol's data is filled with padded bars up to the latest imported date (unless the symbol's delisting date has passed), so end-of-data handling never comes into play for such gaps.
•CalendarSym — when a strategy has a CalendarSym, the "end of the test" used in these checks is the calendar symbol's last date.
•Order runs — when generating orders, the text order list includes a notice when a position (including a benchmark position) recently got an end-of-data exit, so that a symbol whose data has gone stale is noticed before live orders are placed.
•End-of-test exits — the EndOfTestExits setting controls whether positions still open at the end of the test are closed at all; it does not affect end-of-data exits.
|