GetLastMonth

GetLastMonth ();

Description

Returns the number of the last bar month in the CST timezone. The output is returned in the range from 1 through 12.

Example 1

plot Price = if GetLastMonth() == GetMonth() and GetLastYear() == GetYear()  then close else Double.NaN;

The example draws the close plot for the last month of the current year.

Example 2

plot Price = if GetLastMonth() == GetMonth() then open else Double.NaN;

This code draws the open plot for the last month of each year.