NinjaTrader Support Forum High/Low since session start
 User Name Remember Me? Password
 NinjaTrader Register FAQ Members List

 General Programming General NinjaScript programming questions.

 Thread Tools Display Modes
 06-17-2012, 06:32 AM #1 freewind Senior Member   Join Date: Jan 2010 Posts: 273 Thanks: 15 Thanked 4 times in 3 posts High/Low since session start Hi, I'm developing a multi-instrument stocks 5m intraday strategy on US session. I want to find out for each instrument the High/Low points since the session start. For example for stocks XYZ 2 hours from the start of the trading day(9:30EST) I want to know what was the High point and the low point. I thought about using the Max/Min function and to give them the number of bars since the session started something like that: Code: `max = MAX(Highs[5], BarsSinceSession)[0];` My problem is that I don't know how many bars there are for each instrument, Maybe the primary BIP has more bars since the other BIP. What do you think is the best approach to solve this? TX, Roy
06-17-2012, 07:06 AM   #2
koganam
Senior Member

Join Date: Feb 2008
Location: Durham, North Carolina, USA
Posts: 3,199
Thanks: 24
Thanked 1,225 times in 996 posts

Quote:
 Originally Posted by freewind Hi, I'm developing a multi-instrument stocks 5m intraday strategy on US session. I want to find out for each instrument the High/Low points since the session start. For example for stocks XYZ 2 hours from the start of the trading day(9:30EST) I want to know what was the High point and the low point. I thought about using the Max/Min function and to give them the number of bars since the session started something like that: Code: `max = MAX(Highs[5], BarsSinceSession)[0];` My problem is that I don't know how many bars there are for each instrument, Maybe the primary BIP has more bars since the other BIP. What do you think is the best approach to solve this? TX, Roy
Reference specific bar series by either;
Using a BarsInProgess filter when needed: http://www.ninjatrader.com/support/h...inprogress.htm,
or by specifying the bar series with an index: http://www.ninjatrader.com/support/h...html?highs.htm

 The following user says thank you to koganam for this post:
 06-17-2012, 07:28 AM #3 freewind Senior Member   Join Date: Jan 2010 Posts: 273 Thanks: 15 Thanked 4 times in 3 posts If I understood what you meant the BarsSinceSession is tight to the BIP the called the OnBarUpdate(), am I correct?
06-17-2012, 11:14 AM   #4
koganam
Senior Member

Join Date: Feb 2008
Location: Durham, North Carolina, USA
Posts: 3,199
Thanks: 24
Thanked 1,225 times in 996 posts

Quote:
 Originally Posted by freewind If I understood what you meant the BarsSinceSession is tight to the BIP the called the OnBarUpdate(), am I correct?
Not quite. You said that you want to find when each instrument in a multi-instrument ...

The BarsInProgress will filter calculations to the instrument which matches its BarsInProgress index, and exclude the other instruments.

 Thread Tools Display Modes Linear Mode

 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 Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home News and Announcements     News and Announcements Application Technical Support     ATM Strategies (Discretionary Trading)     Automated Trading     Charting     Connecting     Installation and Licensing     Market Analyzer     Miscellaneous Support         Historical Version 7 Beta Threads             Critical Information - Please review             Version 7 Beta General Questions & Bug Reports         Historical NinjaTrader 6.5 Archive             Historical NinjaTrader 6.5 Beta Threads     Strategy Analyzer     SuperDOM and other Order Entry Windows NinjaScript Development Support     General Programming     Indicator Development     Strategy Development NinjaScript Educational Resources     Reference Samples     Tips NinjaScript File Sharing     NinjaScript File Sharing Discussion     Version 7 Indicators     Version 7 Strategies     Version 7 Miscellaneous Suggestions and Feedback     Suggestions And Feedback

 Similar Threads Thread Thread Starter Forum Replies Last Post MJUK10 Strategy Development 23 06-08-2011 05:11 AM Art09 Suggestions And Feedback 1 03-09-2011 09:03 AM Art09 Charting 3 03-02-2011 12:02 PM suprsnipes Charting 11 03-24-2010 12:53 PM ChiTrader2000 Strategy Development 5 01-30-2009 10:29 AM

All times are GMT -6. The time now is 03:35 AM.

 -- Fixed Width ---- Fluid Width NinjaTrader Support Forum - Archive - Top