Navigation: Realtest Script Language > Syntax Element Details >

SumSince

 

 

 

 

Category

Multi-Bar Functions

Description

Sum of values since a condition was last true, or until it becomes true

Syntax

SumSince(condition, expression, count {0}, nth {1})

Parameters

condition - formula to evaluate for each bar until true (non-zero)

expression - formula to evaluate for each non-true condition bar and add to a running sum

count - how many bars back to go (optional)

nth - which instance of condition to use (optional)

Notes

For each bar until condition is true, expression is evaluated and added to the sum.

The sum does not include the value of expression for the bar where the condition becomes true.

If condition is immediately true, the result is 0.

If nth is positive, condition is evaluated for the most recent bar, then continues back in time until the nth non-zero value is found.

If nth is negative, condition will be evaluated for the most recent bar, then continues forward in time until the abs(nth) non-zero value is found.

If nth is not specified, the default is 1.

Count most be provided if nth is to be provided (use 0 for the default of "all bars")

This function supports ultra-fast one-pass calculation when used in the Data Section without the optional arguments.

 

 

 

 

 

Copyright © 2020-2024 Systematic Solutions, LLC