Summation

Category: Indicators

The Summation function in ProBuilder language is used to calculate the total sum of a specified price over a given number of periods. This function is particularly useful in financial analysis for aggregating price data over time to observe trends or make comparative assessments.

Syntax:

summation[N](price)

Where N represents the number of periods over which the price should be summed, and price indicates the price type (e.g., open, close, high, low).

Example:

i1 = summation[10](open)
i2 = summation[10](close)
RETURN ABS(i1-i2)

In this example, the summation function is used to calculate the total of the opening prices (i1) and closing prices (i2) over the last 10 periods. The result returned is the absolute difference between these two sums, which could be useful for identifying significant changes between opening and closing prices over the specified period.

  • The summation function can be applied to any price type available in the dataset.
  • It is essential to ensure that the number of periods specified does not exceed the available data range to avoid errors.

This function is a fundamental tool in creating indicators or strategies that require a straightforward aggregation of price data over a set number of periods.

Logo Logo
Loading...