within

Syntax

<condition> within 1 bar

<condition> within <length> bars

Description

This reserved word is used to check if the specified condition is true at least one time for the given number of bars starting from the current one.

Example


plot IsDoji3 = Doji() within 3 bars;
IsDoji3.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);

This example script adds a point mark if there is at least one Doji among three candles including the current one.