rec

Notice: this is an article about an obsolete thinkScript® notation. Although rec variables are still supported by thinkScript®, they can be completely replaced by def.

Syntax

rec

Description

Enables you to reference a historical value of a variable that you are calculating in the study or strategy itself. Rec is short for "recursion".

Example

rec C = C[1] + volume;
plot CumulativeVolume = C;

This example plots the cumulative volume starting from the beginning of the time period.