Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
How to get Day of Month
Collapse
X
-
Thanks Bertrand.
Sorry, I'm novice as you may figure out. I´ve written this simple indicator but it doesn´t draw anything.
protected override void OnBarUpdate()
{
if (Time[0].Date.Month > Time[1].Date.Month || Time[0].Date.Month < Time[1].Date.Month) Plot0.Set(1);
else Plot0.Set(0);
}
Comment
-
-
This approach may run into problems, if the first day of the month is a Saturday.Originally posted by NinjaTrader_Cal View PostHarry,
Yes, that would work as well.
I have provided a sample script of another method of how to detect a new month.
This script will detect when its the first of the month thus a new month is checked.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
149 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
84 views
1 like
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
129 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
125 views
1 like
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
102 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

... but then couldn't we use
Comment