RealTest User Guide
RealTest User Guide

 

 

Navigation: Realtest Script Language > Syntax Element Details >

MaxLongExp

 

 

 

 

Category

Strategy Elements

Description

Open long position exposure limit for a strategy or group of strategies

Input

Any formula specifying a percentage

Notes

MaxLongExp is one of the Capacity Constraints formulas used in the setup selection process.

A long setup is only selected if its position size plus those of other long setups selected so far plus current S.LongInv of open positions divided by current S.Alloc would not exceed the percentage expressed as MaxLongExp.

If a setup cannot be selected due to this constraint and the strategy specifies Reduce: True, then the position's Quantity will be reduced to allow the position to be ordered for entry at smaller size if possible.

Setups skipped for this reason display "max long exp" in the Reason column of the Trade List, provided that the KeepTrades setting included Skipped.

If MaxLongExp is not specified then there is no limit placed on long percent exposure, though there might still be a long investment limit if the strategy specifies MaxLongInv.

Note that opening gaps beyond a specified order price may cause actual long exposure to exceed the specified cap in some situations -- think of this constraint as "maximum intended long exposure".

See Also: Backtest Engine Details and Capacity Constraints

 

 

 

Copyright © 2020-2025 Systematic Solutions, LLC