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 ETFVoyageur, Today, 07:55 PM
|
0 responses
6 views
0 likes
|
Last Post
by ETFVoyageur
Today, 07:55 PM
|
||
Started by janio973, Today, 07:24 PM
|
1 response
7 views
0 likes
|
Last Post Today, 07:35 PM | ||
Started by aligator, 01-06-2022, 12:14 PM
|
4 responses
242 views
0 likes
|
Last Post
by john_44573
Today, 06:11 PM
|
||
Started by reynoldsn, Today, 05:56 PM
|
0 responses
13 views
0 likes
|
Last Post
by reynoldsn
Today, 05:56 PM
|
||
Started by bortz, 11-06-2023, 08:04 AM
|
51 responses
1,996 views
0 likes
|
Last Post
by aligator
Today, 05:50 PM
|
Comment