RealTest User Guide
RealTest User Guide

 

 

Navigation: RealTest Script Language > Syntax Element Details >

SetupSum

 

 

 

 

Category

General-Purpose Functions

Description

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

Syntax

SetupSum(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 setups.

SetupSum(1) returns the count of today's setups, which is not yet available in S.Setups at position entry time.

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 IsSetup: values for strategies in an earlier EntryPhase are final, while values for strategies in the current phase reflect processing so far.

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

Use OrderSum to count or calculate something for non-skipped setups only.

Note that SetupSum 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 SetupSum(expression)[offset] will probably not have meaningful results.

 

 

 

Copyright © 2020-2026 Systematic Solutions, LLC