tradingday

How can I select the first and the fifth trading day in a year?

Hi Jan,

The first trading day of the year occurs when the YEARNUM() is higher than the previous bar, ie the year changes from 2023 to 2024. Using the following in a Show Bar highlights that bar (green line in the image below):

YEARNUM() IsUp

For the 5th day you can use the TIMSINCESIGNAL() function combined with the above. Because the day of the event has a time count of 0, the 5th day will have a timecount of 4 (red line in the image below):

Y1=YEARNUM() IsUp;
TIMESINCESIGNAL(Y1)==4

Capture