between

Syntax

<parameter> between <value1> and <value2>

Description

This reserved word is used in the between logical expression. It tests if the specified parameter is within the range of value1 and value2 (inclusive). Note that in thinkScript®, there is also the Between function with a different syntax and usage.

Example

declare lower;
def isIn = close between close[1] * 0.9 and close[1] * 1.1;
plot isOut = !isIn;

In this example between is used to check whether the current closing price hits the 10% channel of the previous closing price. The isOut plot reflects the opposite condition.