Support Board
Date/Time: Fri, 19 Dec 2025 21:30:32 +0000
Study Alert Question
View Count: 889
| [2020-04-06 07:52:06] |
| kasabo - Posts: 27 |
|
Is it possible to reference the first week of the current month via Spreadsheet formula or preferably by color bar based alert condition study? I could not construct it by using WEEKNUM function defined here https://www.sierrachart.com/index.php?page=doc/SpreadsheetFunctions.html#SerialDateTimeValues. Thank you. Date Time Of Last Edit: 2020-04-06 07:56:28
|
| [2020-04-06 12:55:33] |
| Sawtooth - Posts: 4300 |
|
This returns the week number of the 1st of the month, and its value is persistent until the 1st of the subsequent month: WEEKNUM(DATE(YEAR(BARDATE),MONTH(BARDATE),1)) So to get the 1st week of the month, compare it to the previous bar: =WEEKNUM(DATE(YEAR(BARDATE),MONTH(BARDATE),1))<>WEEKNUM(DATE(YEAR(BARDATE[-1]),MONTH(BARDATE[-1]),1)) The spreadsheet formula would look like this: =WEEKNUM(DATE(YEAR(A3),MONTH(A3),1))<>WEEKNUM(DATE(YEAR(A4),MONTH(A4),1)) |
To post a message in this thread, you need to log in with your Sierra Chart account:
