Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
limit a study to 2 days, today and yesterday
Collapse
X
-
thanks,
I have;
if (Bars.GetSessionBar(1) != null) // yesterday processing
{ check yesterday data, draw an arrow at 4:15 PM }
if (Bars.GetSessionBar(0) != null) // today processing
{ check today data, draw an arrow at 9:30 AM }
and it should be no arrow for any other day but arrows shows up on all of the days I load.
Comment
-
nkhoi,
That would not work. Processing of data goes from the very oldest to the very newest. As each new day is processed you have a keep rolling forward and your conditions are true for every single day moving forward. The only way you can limit it to the last two days is if you knew definite dates for the last two days you want to process and limit it that way with DateTime checks.Josh P.NinjaTrader Customer Service
Comment
-
you manual is terrible there is no example for getting today date or yesterday date, a search on key word yesterday or prior day return zero hit. But you also have a cs file that shows some related example that just enough to keep me going so thanks. I upload 2 versions of open range with overnight session, one plots continuously and one doesn't in case anybody interests.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
558 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
324 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 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
545 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
547 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment