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 11-20-2008, 04:51 AM   #1
max-td
Senior Member
 
Join Date: Feb 2008
Posts: 177
Thanks: 0
Thanked 0 times in 0 posts
Default How to check properly ?

Hi,
i have to check this condition for the last 5 Bars :
if (Stochastics(3, 14, 7).D > 80
and want to combine it e.g. with a Volume of the curent Bar-condition.
Vol[0] >5000


i can do it like this i think :

if
(Stochastics(3, 14, 7).D[0] > 80
&&
Vol[0] >5000
(
do that ...
)

else if
(Stochastics(3, 14, 7).D[1] > 80
&&
Vol[0] >5000
(
do that ...
)

else if
(Stochastics(3, 14, 7).D[2] > 80
&&
Vol[0] >5000
(
do that ...
)

and so on up to bar (5) back -- so i have this list that will be checked through every time.

Is there an easier solution then this list to do this ?

Thank
max-td
max-td is offline  
Reply With Quote
Old 11-20-2008, 07:13 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

Yes, you can do something like:

Code:
if (MIN(Stochastics(3, 14, 7).D, 5)[0] > 80 && Volume[0] > 5000))
    // Do something here
More information on the MIN() method - http://www.ninjatrader-support.com/H...inimumMIN.html
NinjaTrader_Ray is offline  
Reply With Quote
Old 11-20-2008, 01:39 PM   #3
max-td
Senior Member
 
Join Date: Feb 2008
Posts: 177
Thanks: 0
Thanked 0 times in 0 posts
Default

Thank you - works fine
max-td
max-td 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
SubscribeMarketData does not work properly moscu Automated Trading 18 11-13-2008 09:57 PM
Ninja not properly closing orders? islandtrader50 Miscellaneous Support 1 10-03-2008 08:42 AM
BUG: Wizard does not escape properly NinjaCustomer Indicator Development 1 06-19-2008 11:04 AM
Chart not updating properly rally7 Miscellaneous Support 7 09-14-2007 07:42 AM
NT6 not closing properly nightowl Suggestions And Feedback 7 02-05-2007 12:06 AM


All times are GMT -6. The time now is 10:02 AM.