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
Session Start Time
Collapse
X
-
Session Start Time
I am looking for the equivilant to TradeStation's Sess1StartTime reserve word. What is the best method to find the session start time in NinjaTrader?Tags: None
-
How to use FirstBarOfSession
How can we test FirstBarOfSession in the simulated data feed environment ? Here I always get False.
If I use Time[0], then it is giving the system time than the session start time.
If we want to get a specific session like, 1st session or 2nd session how can I achieve the same in NT. In Tradestation we have the functions like SessionStartTime(1,2) means, the second session's start time.
Comment
-
Hello,
Yes, the simulated data feed doesn't have sessions. Try connecting to another data feed so the session times will work.
>>If I use Time[0], then it is giving the system time than the session start time.
I am sorry I don't understand the above statement. As soon as you get to the first bar of the session Time[0] return the time of the first tick of the first bar of the session, which is what I thought you wanted. You could also use Open[0] of that bar.
It sounds like you are trying to find the session begin times retroactively. For this you may need to loop backward with a "for" loop through the bars until FirstBarOfSession returns true then use the for loop index like this Open[i] (where "i" is your for loop index) to find the time for that bar and the start of that session. I'm not aware of any easier way. However I will have someone double check this for you.DenNinjaTrader Customer Service
Comment
-
You could also use SessionBreak and store the time stamp then if it returns true - http://www.ninjatrader-support.com/H...sionBreak.html
Generally sessions can be set from the 'Chart Properties' - http://www.ninjatrader-support.com/H...roperties.htmlBertrandNinjaTrader Customer Service
Comment
-
Thank you !
Thank you for the suggestions. I believe Bars.GetSessionBar(1) will give the first bar in the 2nd session information. I am getting the time of Bars.GetSessionBar(1).Time if (Bars.GetSessionBar(1) != null).
Is this code has any problems to access individual session begin times ?
Comment
-
Hi Kirannarik, unfortunately this is not supported - you will need debug your custom code and make sure it works as expected, for proper debugging techniques please review this tip - http://www.ninjatrader-support2.com/...ead.php?t=3418BertrandNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by bmartz, Today, 09:30 AM
|
2 responses
11 views
0 likes
|
Last Post
by bltdavid
Today, 11:24 AM
|
||
Started by f.saeidi, Today, 11:02 AM
|
1 response
4 views
0 likes
|
Last Post Today, 11:08 AM | ||
Started by geotrades1, Today, 10:02 AM
|
4 responses
12 views
0 likes
|
Last Post
by geotrades1
Today, 11:08 AM
|
||
Started by rajendrasubedi2023, Today, 09:50 AM
|
3 responses
16 views
0 likes
|
Last Post Today, 10:57 AM | ||
Started by lorem, Today, 09:18 AM
|
2 responses
11 views
0 likes
|
Last Post Today, 10:55 AM |
Comment