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 07-30-2007, 07:27 AM   #1
Richard Von
Member
 
Join Date: Jul 2007
Posts: 93
Thanks: 0
Thanked 0 times in 0 posts
Default MAX/MIN limits

I am trying to use the MAX or MIN functions as part of an if condition to determine if a built-in indicator has attained at least a specified value over the past number of bars. For example,

if MAX(MACD(4,5,3),5) > .05

I get a message that the > operator cannot be used with MAX.

How can I do this?
Richard Von is offline  
Reply With Quote
Old 07-30-2007, 07:38 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

Hi Richard,

In case you may have not seen this, the following section of our Help Guide might be of some value.

http://www.ninjatrader-support.com/H...ataSeries.html

You are trying to compare the indicator to a value of 0.05 NOT the value of the indicator at a specific bar. It should be written as:

if (MAX(MACD(4, 5, 3), 5)[0] > 0.05)
// Do something

Not the reference to the value of the indicator at the current bar by using [0].
NinjaTrader_Ray is offline  
Reply With Quote
Old 07-30-2007, 08:17 AM   #3
Richard Von
Member
 
Join Date: Jul 2007
Posts: 93
Thanks: 0
Thanked 0 times in 0 posts
Default

You are very patient. Thank you for the help.

Little by little some of this is sinking in. I have read the DataSeries reference several times, but when you are starting out it is very confusing. I'll keep working on it.
Richard Von is offline  
Reply With Quote
Old 07-30-2007, 08:29 AM   #4
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

No problem Richard. What I have personally done in the past when challenged with new concepts is to start off with simple tasks and layer complexity on top of it. This has always helped keep the 'learning' under control.
NinjaTrader_Ray 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
IB Historical Data Refresh Limits and Backup Feed Drew Connecting 1 05-10-2007 05:18 PM


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