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 > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 10-23-2007, 04:46 AM   #1
Jenny
Member
 
Join Date: Jun 2007
Posts: 72
Thanks: 0
Thanked 0 times in 0 posts
Default How to compare Low and new Low

I would like to compare low and new low in certain time. How to do that?
Have nice day!
Jenny is offline  
Reply With Quote
Old 10-23-2007, 06:27 AM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

Using the wizard?
NinjaTrader_Ray is offline  
Reply With Quote
Old 10-23-2007, 07:29 AM   #3
Jenny
Member
 
Join Date: Jun 2007
Posts: 72
Thanks: 0
Thanked 0 times in 0 posts
Default

Yes, if you can. But if we can't use Wizard, how to do it in others ways?
Thanks
Jenny is offline  
Reply With Quote
Old 10-23-2007, 01:23 PM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Hi Jenny,

Can you please clarify the exact condition you want? From my current understanding you want to keep a Low value from a certain time and then later in the day compare that Low value with the current Low?
NinjaTrader_Josh is offline  
Reply With Quote
Old 10-23-2007, 06:50 PM   #5
Jenny
Member
 
Join Date: Jun 2007
Posts: 72
Thanks: 0
Thanked 0 times in 0 posts
Default

I would like to compare Low and newLow or Most recent low with second most low, High and new High or Most recent high with second most recent high, to konw it is Bull or Bear to deside to buy or sale. Do you have some easy way?
Last edited by Jenny; 10-23-2007 at 06:54 PM.
Jenny is offline  
Reply With Quote
Old 10-23-2007, 08:36 PM   #6
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

If I am understanding you correctly by most recent high you mean current bar and by second most recent high you mean the high of the previous bar. If this is what you mean you can achieve this in a very nice and convenient method.
High[0] <- current bar's high
High[1] <- previous bar's high
High[2] <- the prior bar to the previous bar's high
etc. etc.

This can be done on anything using the indexing [].
NinjaTrader_Josh 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


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