We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d7c944c commit 4fe7305Copy full SHA for 4fe7305
faq_and_code/README.md
@@ -1580,6 +1580,24 @@ f_print(_text) => var table _t = table.new(position.middle_right, 1, 1), table.c
1580
f_print(countDown)
1581
```
1582
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
1601
**[Back to top](#table-of-contents)**
1602
1603
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments