Sidechair

month

Browse the reference

The calendar month of the current bar's open time, from 1 for January to 12 for December.

Try it in the editor

month is a series int. It changes on the first bar of each month in the exchange time zone, which makes month != month[1] a monthly reset signal.

Type

series int

Remarks

  • month[n] is na before the first bar.
  • On Sidechair: the parts are read in the symbol's exchange time zone, the same as syminfo.timezone.
  • A weekly bar that opens on 30 December reads 12 for all of its days, even those that fall in January.

Example

Pine ScriptMonthly openOpen in editor
//@version=6
indicator("Monthly open", overlay = true)
var float monthOpen = na
if month != month[1]
    monthOpen := open
plot(monthOpen, "Month open", color.orange, 2, plot.style_stepline)

See also

Runs on Sidechair