What is the best way to find out if a datetime from a few days ago was in a session?
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Finding out if a time is in a prior session
Collapse
X
-
Finding out if a time is in a prior session
I want to find out if a bar from a few days ago is in the RTH or ETH session. I made a couple of sessionIterators with the trading hours templates. But it seems that session Iterators will only tell me if a DateTime is in the current session, not if it was in a past session.
What is the best way to find out if a datetime from a few days ago was in a session?Tags: None
-
Here's an example of what I'm doing. If you scroll around, it prints out whether the last bar visible on the screen is in the globex session or cash sessionAttached Files
-
Hello frantic,
Thanks for your post.
NT is only going to be able to check and see if the bar index you are referencing is inside the currently assigned session template. You would need to assign a static variable and store that information if you want to access it later.
I think it would be easier to simply reference the template that you have(or had) attached to that instrument during that time.
Please let me know if you have any questions.Josh G.NinjaTrader Customer Service
Comment
-
Hello frantic,
This is because that information is not recorded on the bar by NinjaTrader. If you want to have information about what session a specific bar was on than you will need to begin recording it.
I can submit this as a feature request for you if you like, just let me know.Josh G.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by frslvr, 04-11-2024, 07:26 AM
|
8 responses
111 views
1 like
|
Last Post Today, 10:30 AM | ||
Started by stafe, 04-15-2024, 08:34 PM
|
10 responses
44 views
0 likes
|
Last Post
by stafe
Today, 10:29 AM
|
||
Started by rocketman7, Today, 09:41 AM
|
3 responses
8 views
0 likes
|
Last Post Today, 10:07 AM | ||
Started by traderqz, Today, 09:44 AM
|
2 responses
5 views
0 likes
|
Last Post Today, 10:00 AM | ||
Started by rocketman7, Today, 02:12 AM
|
7 responses
31 views
0 likes
|
Last Post Today, 09:23 AM |
Comment