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
How to get current session with SessionIterator
Collapse
X
-
How to get current session with SessionIterator
I'm developing both indicators and strategies that need to know when I'm in a session. I've written it like it is written in the language reference and works great except one aspect. When I tell it to GetNextSession(Time[0]), it does that. But I want it to get the current session. I am putting the call within a IsFirstBarOfSession block. Should I not? How do I get the current session?Tags: None
-
Hello dweems,
Thanks for your post.
You can get a template by name with TradingHours.Get(string instrumentName).
There is an example of this in the help guide on the BarsRequest page.
https://ninjatrader.com/support/help...arsrequest.htm
The sessionIterator would provide the start and end session times with ActualSessionBegin and ActualSessionEnd.
https://ninjatrader.com/support/help...oniterator.htm
Let me know if I may assist further.Brandon H.NinjaTrader Customer Service
-
I could be wrong but I think this is what you are looking for: https://ninjatrader.com/support/help...sinsession.htm
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by love2code2trade, Today, 01:45 PM
|
0 responses
2 views
0 likes
|
Last Post Today, 01:45 PM | ||
Started by 09try, 03-29-2024, 01:27 PM
|
9 responses
81 views
0 likes
|
Last Post
by ntcat
Today, 01:16 PM
|
||
Started by ninza33, Today, 06:28 AM
|
4 responses
17 views
0 likes
|
Last Post
by ninza33
Today, 12:38 PM
|
||
Started by ScottWalsh, Yesterday, 04:29 PM
|
4 responses
18 views
0 likes
|
Last Post Today, 12:00 PM | ||
Started by Gibranes, Today, 10:05 AM
|
4 responses
20 views
0 likes
|
Last Post
by Gibranes
Today, 11:54 AM
|
Comment