CloseM (Series Function)
The CloseM function allows you to reference the monthly Close of previous months in an intraday chart (minute
CloseM is a function in a family of functions that allows historical daily, weekly, monthly, and yearly references in intraday charts.
Syntax
CloseM(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 month'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 months ago on a 5-minute chart, you must have 3 months 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 month on an intraday chart to Value1, then plots Value1:
Value1 = CloseM(1);
Plot1(Value1, "PrevMClose");