![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Version 7 Beta General Questions & Bug Reports Ask questions here and post bug reports. |
|
|
Thread Tools | Display Modes |
|
|
#1 | |
|
Senior Member
Join Date: Oct 2007
Posts: 333
Thanks: 2
Thanked 12 times in 7 posts
|
Suppose I use the Default 24/7 session template.
It means that I have session times : HTML Code:
StartTime EndTime Session 1 25/10/2010 06:00:00 26/10/2010 06:00:00 Session 2 26/10/2010 06:00:00 27/10/2010 06:00:00 etc I get BeginTime=25/10/2010 06:00:00 EndTime=26/10/2010 06:00:00 Where I think the correct answer is BeginTime=26/10/2010 06:00:00 EndTime=27/10/2010 06:00:00 The tick happening at 26/10/2010 06:00:00 should actually first tick of 26/10 session, not last tick of 25/10 session, meaning EndTime in session templates should be excluded from the session times. The same kind of problems happens with Volume[0]. I have session data on the ES that has a tick of volume 1 happening exactly at 06:00:00 For testing purposes I made an indicator that cumulated volume of the day PHP Code:
(session in question is the last one: volume is either 1757247 either 1757246) Quote:
|
|
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,404
Thanks: 252
Thanked 974 times in 957 posts
|
gomi, sorry for our late reply here - we'll look into matters and get back to you.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,404
Thanks: 252
Thanked 974 times in 957 posts
|
gomi, when would you call your GetNextSessionBeginEnd? I tried a call at session break on ES 1 tick and see this output, whicb would be expected -
11/15/2010 12:00:01 AM Session Start: 11/15/2010 12:00:00 AM Session End: 11/16/2010 12:00:00 AM
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Oct 2007
Posts: 333
Thanks: 2
Thanked 12 times in 7 posts
|
Yes, but you tried 12:00:01, not 12:00:00
|
|
|
|
|
|
#5 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,404
Thanks: 252
Thanked 974 times in 957 posts
|
That would not be the session break then, the new bar starts as the closing tick of the last is received - this is the 12:00:01 tick here - opening tick of the new session.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#6 |
|
Senior Member
Join Date: Oct 2007
Posts: 333
Thanks: 2
Thanked 12 times in 7 posts
|
If I have session start at 8:30:00 for CME for instance, I will have lots of ticks at the open , which is at the 8:30:00 second. These ticks during the whole 00 second belong to the new session, don't they ?
|
|
|
|
|
|
#7 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,404
Thanks: 252
Thanked 974 times in 957 posts
|
NinjaTrader stamps the bar at their close, thus you would need to set the session to begin at 8:29:59 to also use the first closed tick bar in your new session (the 8:30:00 closed one).
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#8 |
|
Senior Member
Join Date: Oct 2007
Posts: 333
Thanks: 2
Thanked 12 times in 7 posts
|
????? Sorry, this is not how ninja works.....
I made a quick indicator showing ticks and bar volumes with their timestamps HTML Code:
protected override void OnBarUpdate()
{
// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.
if ((FirstTickOfBar) && (CurrentBar>1))
Print("BAR : "+Time[1]+ " "+Volume[1]);
}
protected override void OnMarketData(MarketDataEventArgs e)
{
if (e.MarketDataType==MarketDataType.Last)
Print("Tick : "+e.Time+" "+e.Volume);
}
Here are the results: Tick : 27/10/2010 15:29:59 7 Tick : 27/10/2010 15:30:00 1 BAR : 26/10/2010 22:14:59 18 Tick : 27/10/2010 15:30:00 34 Tick : 27/10/2010 15:30:00 22 Tick : 27/10/2010 15:30:00 435 Tick : 27/10/2010 15:30:00 1 Tick : 27/10/2010 15:30:00 2 . . . . Tick : 27/10/2010 15:30:00 4 Tick : 27/10/2010 15:30:00 1 Tick : 27/10/2010 15:30:00 50 Tick : 27/10/2010 15:30:00 4 Tick : 27/10/2010 15:30:00 200 Tick : 27/10/2010 15:30:01 250 BAR : 27/10/2010 15:30:00 2797 Tick : 27/10/2010 15:30:01 25 Tick : 27/10/2010 15:30:01 16 So as you can see the 15:30:00 ticks are used, no need to use a 15:29:59 session start time.... |
|
|
|
|
|
#9 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Unfortunately I am not following you. The bars are most definitely timestamped with the closing timestamp of the bar. If it is a tick based bar then it will be the timestamp of the last tick in that bar. If it is a time based bar then it will be whatever ending timestamp of that time frame would be.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#10 |
|
Senior Member
Join Date: Oct 2007
Posts: 333
Thanks: 2
Thanked 12 times in 7 posts
|
This subject has moved to timestamping of the bar but it is totally irrelevant to my issue.
Reread first post : I am only stating that if session begin time==session end time, 06:00:00 for instance, the GetNextBeginEnd has to choose if the tick is in last bar of previous session or first bar of next session. It chooses to decide it belongs to the last bar of previous session which is not logical, because if Begin Time != End Session, like 8:30:00 and 15:00:00, the 8:30:00 tick is included in the session and the 15:00:00 tick is excluded (last tick of session is 14:59:59) So Begin Time should be considered inclusive, and End Time exclusive, which mean the 06:00:00 tick we mentioned should be first tick of next session Which means GetNextBeginEnd (10/10/2010 06:00:00) should give Begin Time=10/10 End Time 11/10 and not Begin Time=9/10 End Time 10/10 like it does today |
|
|
|
|
|
#11 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Code:
FirstBarOfSession Time: 11/15/2010 6:01:00 AM Session Start: 11/15/2010 6:00:00 AM Session End: 11/16/2010 6:00:00 AM First bar of the session is timestamped as 6:01AM which is the end timestamp of a 1min bar equivalent to what my chart is using. Now we check out GetNextBeginEnd, providing me accurate 11/15 to 11/16. Running off a 150-tick chart now... Code:
FirstBarOfSessionTime: 11/15/2010 6:09:32 AM Session Start: 11/15/2010 6:00:00 AM Session End: 11/16/2010 6:00:00 AM
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#12 | |
|
Senior Member
Join Date: Oct 2007
Posts: 333
Thanks: 2
Thanked 12 times in 7 posts
|
Quote:
Imagine the flow of the ticks with a millisecond granularity. If we set start/end session at 06:00:00, we will get with your solution all the ticks from 06:00:01.000 to next day 06:00:999 If you decide to include begin time and exclude end time, we will get all ticks from 06:00:00.000 to next day 05.59.999, which seems much more what we are willing to do when we set start/end session at 06:00:00 ... Or maybe is it "by design" ? |
|
|
|
|
|
|
#13 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,404
Thanks: 252
Thanked 974 times in 957 posts
|
We plan to have a resolution to this with NinjaTrader 7.0.1000.5.
Bertrand
NinjaTrader Customer Service |
|
|
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Session Problems : FirstBarOfSession isn't | zark.be | Version 7 Beta General Questions & Bug Reports | 3 | 10-06-2010 09:10 AM |
| Beta 15 - problems loading last few ticks of data for CL 09-10 | JS999 | Version 7 Beta General Questions & Bug Reports | 6 | 07-19-2010 08:43 AM |
| End of session BaRs problem/Residual ticks | david111 | Version 7 Beta General Questions & Bug Reports | 3 | 04-15-2010 09:08 AM |
| BeginTime EndTime timezone ? | gomifromparis | Version 7 Beta General Questions & Bug Reports | 21 | 02-12-2010 09:11 AM |
| Draw a line, session open minus 20 ticks | suprsnipes | Indicator Development | 5 | 11-07-2009 09:36 AM |