NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > Application Technical Support > Automated Trading

Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader.

Reply
 
Thread Tools Display Modes
Old 06-02-2012, 02:58 AM   #1
trail
Junior Member
 
Join Date: Mar 2012
Posts: 13
Thanks: 2
Thanked 1 time in 1 post
Default Highest bar from certain period

Hi,
This is my first post on this forum and I'm relatively new so this might be a stupid question....
I want to find the Highest bar in a certain period, say in the period from bar[5] to bar[20].
How can I get this value in the best way. Because standard I get the Highest bar from "bars ago" (from the newest bar [0]) and that is not what I want.

Thanks in advance.
Anne
trail is offline  
Reply With Quote
Old 06-02-2012, 06:57 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
Send a message via Skype™ to koganam
Default

Quote:
Originally Posted by trail View Post
Hi,
This is my first post on this forum and I'm relatively new so this might be a stupid question....
I want to find the Highest bar in a certain period, say in the period from bar[5] to bar[20].
How can I get this value in the best way. Because standard I get the Highest bar from "bars ago" (from the newest bar [0]) and that is not what I want.

Thanks in advance.
Anne
Use the MAX() class. ref: http://www.ninjatrader.com/support/h...aximum_max.htm
koganam is offline  
Reply With Quote
The following 2 users say thank you to koganam for this post:
Old 06-04-2012, 09:45 AM   #3
trail
Junior Member
 
Join Date: Mar 2012
Posts: 13
Thanks: 2
Thanked 1 time in 1 post
Default

Thanks for your quick answer, koganam. I will try to work it out with the MAX class.
Should I use a BarsArray in it? (To be clear: I don't need bars of another timeframe.)
I hoped there would be a more simple way to do this. (For instance, just like in MS Excel when using formula's you can specify the place in a string.)
trail is offline  
Reply With Quote
Old 06-04-2012, 01:33 PM   #4
trail
Junior Member
 
Join Date: Mar 2012
Posts: 13
Thanks: 2
Thanked 1 time in 1 post
Default

The MAX class was usefull. This gave me the right answer:
MAX(High,15)[5])

Thanks again,
Anne
trail is offline  
Reply With Quote
The following user says thank you to trail for this post:
Reply

Tags
frombar, highest, period, tobar

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
Highest Bar in an earlier range of bars Light General Programming 6 01-26-2010 01:28 PM
Highest Bar of e.g. ADX Tobias1985 Strategy Development 4 02-26-2009 02:04 PM
Retrieving Highest Highs from any period TAJTrades Indicator Development 7 08-26-2008 11:07 PM
Highest High in a LookBack Period daven Indicator Development 2 09-28-2007 12:39 PM
Chart's highest is different to dome highest MrBaffalo Charting 16 03-08-2007 04:21 AM


All times are GMT -6. The time now is 10:58 PM.