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 cmoran13, 04-16-2026, 01:02 PM
|
0 responses
76 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
45 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|
||
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
168 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
101 views
1 like
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
165 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|

Comment