View Full Version : FirstBarOfSession set to true on the settlement bar
blar58
06-14-2010, 02:05 PM
Hi guys
Can you tell me why Bars.FirstBarOfSession is true on the ES between 4:00PM and 4:15PM
Is it a bug ?
Thanks
NinjaTrader_Brett
06-14-2010, 02:54 PM
Hello,
Thank you for your first forum post.
What session template are you using?
I was not able to duplicate this with the default session template. Please see the following output good when I ran this on a 1 minute chart.
BARS TRUE 6/10/2010 7:31:00 AM
BARS TRUE 6/11/2010 7:31:00 AM
BARS TRUE 6/14/2010 7:31:00 AM
Do you have strategy code that you can post that does this?
I look forward to assisting you further.
blar58
06-14-2010, 03:06 PM
Brett,
I am using E-Mini SP Sep 2010 contract Session template : <Use instrument settings>
When I run the following line of code :
Print(Time[0]+" First Bar Of Session :"+Bars.FirstBarOfSession);
I get :
6/14/2010 4:05:00 PM First Bar Of Session : True
as my Output window result
NinjaTrader_Brett
06-14-2010, 03:13 PM
Hello,
What version of NinjaTrader are you using. This can be found in the Control Center->Help->About to the right of the NinjaTrader logo.
Also, is this output coming from running live or running backtest?
I look forward to assisting you further.
blar58
06-14-2010, 03:19 PM
Brett
I am using NinjaTrader 7.0.0.17
The problem is with Historical and real time data.
NinjaTrader_Brett
06-14-2010, 03:26 PM
Hello,
Here is what I get.
6/11/2010 7:31:00 AM First Bar Of Session :True
Can you please provide the strategy that you are running this on so that I may see if it is the strategy you are running that may be causing this. Have you changed the Session Template for the ES when you go to Tools->Instrument Manager and Edit the settings for the ES what is shown for Session Template?
Also what time frame chart are you running this strategy on?
I look forward to assisting you further.
blar58
06-14-2010, 03:37 PM
Brett
I am looking at a 1 minute Chart. So you should have bars showing between 4:00 and 4:15 PM.
The problem is in between these bars
NinjaTrader_Brett
06-14-2010, 03:42 PM
Hello,
No issue on my side. Now I"m in MST so this is why the hours are 2 hours off.
6/10/2010 2:00:00 PM First Bar Of Session :False
6/10/2010 2:01:00 PM First Bar Of Session :False
6/10/2010 2:02:00 PM First Bar Of Session :False
6/10/2010 2:03:00 PM First Bar Of Session :False
6/10/2010 2:04:00 PM First Bar Of Session :False
6/10/2010 2:05:00 PM First Bar Of Session :False
6/10/2010 2:06:00 PM First Bar Of Session :False
6/10/2010 2:07:00 PM First Bar Of Session :False
6/10/2010 2:08:00 PM First Bar Of Session :False
6/10/2010 2:09:00 PM First Bar Of Session :False
6/10/2010 2:10:00 PM First Bar Of Session :False
6/10/2010 2:11:00 PM First Bar Of Session :False
6/10/2010 2:12:00 PM First Bar Of Session :False
6/10/2010 2:13:00 PM First Bar Of Session :False
6/10/2010 2:14:00 PM First Bar Of Session :False
6/10/2010 2:15:00 PM First Bar Of Session :False
6/11/2010 7:31:00 AM First Bar Of Session :True
So there is something different with how your running it. Can you please post your code file that your using so that I may check it. Also can you please let me know what Session template the ES is using that I mentioned in my previous forum post.
Thank You.
blar58
06-14-2010, 04:01 PM
Brett
There must be a misunderstanding.
The E Mini SP is trading between 9:30AM 4:15PM Eastern time.
When I use the Instrument settings on the session template for the ES 09-10 contract I automatically get a chart that starts at 9:30AM and ends at 4:15PM
Bernard
blar58
06-14-2010, 04:10 PM
OK
I understand the difference in time Zone.
I don't know why I get this bug
NinjaTrader_Josh
06-14-2010, 04:37 PM
Bernard,
Brett's output would correlate with your 9:30 to 4:15 timestamps. Mountain Time is two hours behind Eastern time so 7:30 = 9:30 and 2:15 = 4:15.
The first timestamp of the bar starting on 9:30 is 9:31 or the equivalent of 7:31 Mountain. Can you please attach a reference sample that you used that exhibits the behavior you described as we were unable to reproduce on our end with the simple base scenario of printing nothing but FirstBarOfSession.
Thank you.
Harry
06-17-2010, 02:34 PM
This is a bug and I had already communicated it. It still occurs regularly.
NinjaTrader_Brett
06-17-2010, 02:39 PM
Harry,
Can you please post a simple code segment so that I can attempt to duplicate this on my side as I am unable to duplicate this on the current NinjaTrader 7 beta 17 build.
I look forward to assisting you further.
Harry
06-17-2010, 02:54 PM
Josh has taken care of this -> see other thread, I have just posted here, because there is evidence that somebody else has detected the same bug. I attach my indicator that I use to check for FirstBarOfSession, but obviously I do not want you to make two requests for the same problem.
You can only detect this with real-time data. So you need to connect a couple of hours prior to the close and then watch. If you reload historical data, there will be no problem.
It may will be that this problem only occurs with real-time data from Interactive Brokers, as it is not time-stamped.
NinjaTrader_Brett
06-17-2010, 03:01 PM
Hello,
If Josh is already looking into then there is no need to post elsewhere as I report directly to Josh on bugs. I will consider this case closed and you can follow up with him on the other thread Thank You.
Let me know if I can be of further assistance.