RealTest User Guide
RealTest User Guide

 

 

Navigation: RealTest Script Language > Syntax Element Details >

OrderSum

 

 

 

 

Category

General-Purpose Functions

Description

Evaluates an expression for each non-skipped setup and returns the sum of the values

Syntax

OrderSum(expression, symbol {0})

Notes

This is a specialized function meant to be used in entry-related formulas that want the sum of something across all current non-skipped setups (stocks for which an entry order will be placed).

OrderSum(1) can be used to count today's orders for the current strategy.

Scope: in a strategy context the sum covers that strategy's own setups. Inside Combined(...) or Extern(@group, ...) it covers the setups of all member strategies. Timing follows the same rules as IsOrder: sums over strategies in an earlier EntryPhase are final, while sums over strategies in the current phase include only the selection turns completed so far.

The optional symbol argument (a symbol number, default 0 = all symbols) restricts the sum to setups for that one symbol.

Use SetupSum to count or calculate something for all setups, not just the non-skipped ones.

Note that OrderSum cannot be used to refer to past setups in a strategy. It only has access to setups for the current date in the test. Therefore OrderSum(expression)[offset] will probably not have meaningful results.

 

 

 

Copyright © 2020-2026 Systematic Solutions, LLC