Skip to content

Commit 4fe7305

Browse files
authored
Update README.md
1 parent d7c944c commit 4fe7305

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

faq_and_code/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,6 +1580,24 @@ f_print(_text) => var table _t = table.new(position.middle_right, 1, 1), table.c
15801580
f_print(countDown)
15811581
```
15821582

1583+
### How can I get the weeek of the month?
1584+
This code uses changes in the week of the year to determine the week of the month:
1585+
1586+
```js
1587+
//@version=5
1588+
//@author=Bjorgum, for PineCoders
1589+
indicator("weekOfMonth()")
1590+
weekOfMonth(timestamp = time) =>
1591+
var week = weekofyear(timestamp) %4
1592+
if ta.change(weekofyear(timestamp))
1593+
week += 1
1594+
if ta.change(month(timestamp))
1595+
week := 1
1596+
int result = timeframe.ismonthly ? na : week
1597+
1598+
plot(weekOfMonth())
1599+
```
1600+
15831601
**[Back to top](#table-of-contents)**
15841602

15851603

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy