Navigation: Realtest Script Language > Syntax Element Details >







Strategy Elements


Specifies the number of shares or contracts to buy or sell short when opening a new position


Any formula specifying a number of shares or contracts, or a position value, or an allocation percentage


The Quantity formula specifies the position size to use each trade in a strategy.

Quantity is calculated at setup selection time using the same current bar context as EntrySetup.

If there is no Quantity formula then a strategy will always invest 100% of current Allocation in each position.

If Quantity returns 0 then the entry is skipped and "zero quantity" is displayed as the skip reason.

Quantity can optionally be used to specify the Side (long vs. short) of a trade in a strategy that can go either way, such as a hedging strategy.

If Side is specified for a strategy, then the strategy always trades that side only and Quantity should always be expressed as a positive number.

If Side is not specified, then Quantity should return a positive number to enter a long position or a negative number to enter a short position.

See QtyType for important information about how Quantity is interpreted.

See Asset Allocation and Position Sizing for additional information.




Copyright © 2020-2024 Systematic Solutions, LLC