Announcement
Collapse
No announcement yet.
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.<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
-
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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
43 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
20 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
29 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
46 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
38 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment