![]() |
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
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Jul 2007
Posts: 93
Thanks: 0
Thanked 0 times in 0 posts
|
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? |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
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].
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: Jul 2007
Posts: 93
Thanks: 0
Thanked 0 times in 0 posts
|
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. |
|
|
|
|
|
#4 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
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.
Ray
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |