NinjaTrader Support Forum  
X

Attention!

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


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 08-23-2012, 03:23 AM   #1
savekad
Senior Member
 
Join Date: Jul 2012
Posts: 158
Thanks: 28
Thanked 4 times in 4 posts
Default What is BarsSinceSession

I've noticed that BarsSinceSession returns the same int asCurrentBar so what's the actual use of it?

And what exactly is the meaning of 'Session'? is it the time of the current trading session? the time of opening a new chart? of loading the indicator?

Thanks.
savekad is offline  
Reply With Quote
Old 08-23-2012, 03:43 AM   #2
NinjaTrader_Joydeep
NinjaTrader Customer Service
 
NinjaTrader_Joydeep's Avatar
 
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
Default

Hello savekad,
Bars since session returns how many bars has elapsed since the start of the session.
http://www.ninjatrader.com/support/h...ncesession.htm

Session is the session template you apply on the chart via the Data Series parameter dialog.
http://www.ninjatrader.com/support/h...on_manager.htm
Last edited by NinjaTrader_Joydeep; 08-23-2012 at 03:45 AM.
NinjaTrader_Joydeep is offline  
Reply With Quote
Old 08-25-2012, 11:39 PM   #3
savekad
Senior Member
 
Join Date: Jul 2012
Posts: 158
Thanks: 28
Thanked 4 times in 4 posts
Default

So it is the number of bars since the starting of the session according the to session template in use?

That means that there could be a chart loaded with bars of two sessions, and the BarsSinceSession will return the number of bars for the current one, ignoring the previous one, correct?
savekad is offline  
Reply With Quote
Old 08-25-2012, 11:48 PM   #4
savekad
Senior Member
 
Join Date: Jul 2012
Posts: 158
Thanks: 28
Thanked 4 times in 4 posts
Default

I've checked. According to my test the answer is yes.
savekad is offline  
Reply With Quote
Old 08-27-2012, 03:57 AM   #5
NinjaTrader_Joydeep
NinjaTrader Customer Service
 
NinjaTrader_Joydeep's Avatar
 
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
Default

Hello savekad,
Yes, if you have data for 2 sessions then the Bars.BarsSinceSession will return the bar number of the latest/current session.
NinjaTrader_Joydeep is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
BarsSinceSession coolmoss Indicator Development 5 05-30-2012 12:52 PM
Bars.BarsSinceSession zehua Automated Trading 1 03-06-2012 02:13 AM
no BarsSinceSession in strategies? arnonmoscona Strategy Development 1 02-20-2012 03:15 PM
BarsSinceSession with futures? heech General Programming 5 05-28-2009 04:24 AM
BarsSinceSession? heech General Programming 1 05-17-2009 04:15 AM


All times are GMT -6. The time now is 07:17 PM.