Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Identify last trading day of the week
Collapse
X
-
Identify last trading day of the week
Is there any function to identify last trading day of the week? I need it when week is short due to holidays, so the last trading day is Thursday.Tags: None
-
Hello nysetrader,
Thanks for your post and I am happy to assist you.
There are no functions to determine the last trading week, but to know the day of the week you can use the DayOfWeek enum:
Please let me know if I can assist you any further.Code:if (Time[0].DayOfWeek = DayOfWeek.Thursday) { // do something }JoydeepNinjaTrader Customer Service
-
Thank you.
I know how to know the day of week, but I need to know if it last trading day of the week or not.
Comment
-
Hello nysetrader,
Unfortunately there are no native functions for it. You can however hard code the specific days and compare it. Say if 18th and 26th are the date you are looking for then hard code the date in an array and look if the bar date matches it or not
in variable:
in OnBarUpdateCode:DateTime[] holidays = {new DateTime(2012,4,18), new DateTime(2012, 4, 26)};
Code:if (Time[0].Date == holidays[0] || Time[0].Date == holidays[1]) { // do something }
Please let me know if I can assist you any further.JoydeepNinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
648 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
369 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
108 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
572 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
573 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment