RealTest User Guide
RealTest User Guide

 

 

Navigation: Realtest Script Language > Syntax Element Details >

BarsHeld

 

 

 

 

Category

Current Position Information

Description

The number of bars since this position was entered, not including the entry day

Notes

For daily bars, it is easiest to think of this as Nights Held.

This will generally be used in the ExitRule formula to implement a Time Stop.

For example, if you entered on Monday and want to exit on Friday, your ExitRule formula would be BarsHeld=4 (assuming there were no holidays that week). You are exiting the 4th trading day after your entry day.

If used as Combined(BarsHeld) when multiple positions are open in the same symbol (whether due to pyramiding or multiple strategies), the oldest entry date (largest value of BarsHeld) for that symbol will be returned.

See also EntryDate.

 

 

 

Copyright © 2020-2024 Systematic Solutions, LLC