CloseW (Series Function)

image\trumpet2.gif Disclaimer

The CloseW function allows you to reference the weekly Close of previous weeks in an intraday chart (minute, second, or tick-based), or a daily or weekly chart.

CloseW is a function in a family of functions that allows historical daily, weekly, monthly, and yearly references in intraday charts.

Syntax

CloseW(PeriodsAgo)

Returns (Double)

A numeric value for the current bar. If there is not enough data, the function will return –1.

Parameters

Name

Type

Description

PeriodsAgo

Numeric

The number of days/periods back to reference a previous day’s closing price. (0 = This week’s current Close)

Remarks

With intraday charts, you must have enough intraday data in the chart in order to look back and reference any previous close. For example, if you want to look back at the close of 3 weeks ago on a 5-minute chart, you must have 3 weeks of 5-minute bars in the chart.

The value for the PeriodsAgo input parameter should always be a whole number greater than or equal to 0. Setting PeriodsAgo to 0 equals today’s current Close.

Example

Assigns the Close of the previous week on an intraday chart to Value1, then plots Value1:

Value1 = CloseW(1);

Plot1(Value1, "PrevWClose");

See also

HighW LowW OpenW CloseD CloseM and CloseY.