RealTest User Guide
RealTest User Guide

 

 

Navigation: Realtest Script Language > Syntax Element Details >

IsExit

 

 

 

 

Category

Current Position Information

Description

True when the formula being evaluated pertains to a position being exited

Notes

IsExit is provided for the few strategy formulas that are evaluated at both entry time and exit time.

These include:

Commission

Slippage

OrderNote / OrderExtra

Use IsExit in any of the above formulas as needed to differentiate entry vs. exit values.

For example in a long strategy you could account for the extra SEC Section 31 fee on the sale of shares:

Commission: 0.005 & Shares + if(IsExit, 8 * FillValue/1e6, 0)

When IsExit is used in a boolean expression such as in the above example, it is interpreted as a number (0 means false, 1 means true in all boolean conditions in RealTest).

When IsExit is used in a string expression such as in the following example and this is an exit, it is interpreted as a string containing the exit reason code from the trade list.

OrderExtra3: Format("{?}" if(IsExit, IsExit, ""))

This stores the exit reason string in the extra3 variable for OrdersTemplate output.

 

 

 

Copyright © 2020-2026 Systematic Solutions, LLC