RealTest User Guide
RealTest User Guide

 

 

Navigation: Realtest Script Language > Syntax Element Details >

PrevExitStop

 

 

 

 

Category

Current Position Information

Description

Previous exit stop price

Notes

At position entry time, PrevExitStop is set to 0.

On each bar that the position is open, after the ExitStop formula is calculated, its value is placed in PrevExitStop.

This makes it possible to implement a "trailing stop", or any type of price stop concept that needs to refer to its own prior value to be calculated.

(Previously this required using the Data Section and was therefore more complex.)

It is also possible for a strategy to refer to the current exit stop price of another strategy by using Extern(@other, PrevExitStop).

Examples

This is a very simple trend-following strategy with a 3*ATR trailing stop:

 

 

 

 

Copyright © 2020-2024 Systematic Solutions, LLC