Login Page - Create Account

Support Board


Date/Time: Fri, 18 Jul 2025 22:54:22 +0000



[Programming Help] - last candle of each month

View Count: 1268

[2020-04-30 04:36:40]
arruga - Posts: 253
What would be the best way to set up an alert condition to identify the last trading day date or the last candle of each month?
[2020-04-30 13:08:06]
Sawtooth - Posts: 4244
This will find the last calendar day of the month:

Simple Alert syntax:
=EOMONTH(BARDATE,0)=BARDATE

Spreadsheet syntax:
=EOMONTH(A3,0)=INT(A3)
[2020-04-30 13:46:53]
Sawtooth - Posts: 4244
This will find the last workday of the month:

Simple Alert syntax:
=WORKDAY(EOMONTH(BARDATE,0)+1,-1)=BARDATE

Spreadsheet syntax:
=WORKDAY(EOMONTH(A3,0)+1,-1)=INT(A3)
[2020-05-05 04:00:54]
arruga - Posts: 253
many thanks mate
[2020-09-02 09:46:42]
User873130 - Posts: 48
when using above syntax with color based on alert, nothing shows up. SC V2135
[2020-09-02 14:03:48]
Sawtooth - Posts: 4244
It works for me.

What bar period are you using?
[2020-09-02 14:42:45]
User873130 - Posts: 48
daily
[2020-09-02 18:48:46]
Sawtooth - Posts: 4244
Note that May 31, 2020 is not colored in the Last Calendar Day of the Month pic because the last calendar day was not a trading day, so there is no data for that date.
imageLast calendar day of the month.PNG / V - Attached On 2020-09-02 18:44:17 UTC - Size: 65.11 KB - 304 views
imageLast WORKDAY of the month.PNG / V - Attached On 2020-09-02 18:44:28 UTC - Size: 64.53 KB - 275 views
[2020-09-02 21:26:40]
User873130 - Posts: 48
is the formula supposed to work only with the Spreadsheet formula study ? not the color bar based on alert condition? thanks
[2020-09-02 21:41:09]
Sawtooth - Posts: 4244
The Simple Alert syntax formulas will work in both the Color Bar Based On Alert Condition study, and the Spreadsheet Formula study.
The former will color the price bar with default settings, with the formula on the Alerts tab.
The latter will color the price bar if you change the Chart Region to 1 and set the Draw style to Color Bar, with the formula in the Formula field.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account