![]() |
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 |
|
Junior Member
Join Date: Aug 2009
Posts: 3
Thanks: 0
Thanked 0 times in 0 posts
|
I am trying to write an indicator to find the Highest High of the past 10 bars. I am not sure whether to use MAX
or I also tried using the HighestBar and then placing the result in High[barsAgo] where the barsAgo = HighestBar but the data type gets mixed up Would appreciate some help as I am new to this programming language I understand the logic to use but am unfamiliar with the syntax and commands I can use. Hilltop |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: May 2008
Location: Hartford, CT. USA
Posts: 618
Thanks: 12
Thanked 24 times in 18 posts
|
Hilltop,
put this in the variables section. ---------------------------------------- private double HH = 0; ----------------------------------- In the OnBarUpdate() section, ---------------------------------------- HH = High[Bars.HighestBar(10)]; ----------------------------------- OR You can do something similar with "Max" Your choice, RJay |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Dec 2007
Posts: 314
Thanks: 0
Thanked 0 times in 0 posts
|
or something like this
double lowestlow = MIN(Low, 10)[0]; double highesthigh = MAX(High, 10)[0]; then use it like this if(Low[0] <= lowestlow){ whatever } |
|
|
|
|
|
#4 | |
|
Junior Member
Join Date: Aug 2009
Posts: 3
Thanks: 0
Thanked 0 times in 0 posts
|
Thanks rt That's a great help
Quote:
|
|
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Aug 2009
Posts: 3
Thanks: 0
Thanked 0 times in 0 posts
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Compute Highest High between 9:30 AM and 10:30 AM | mgbloomfield | Indicator Development | 5 | 03-20-2013 04:26 PM |
| Highest High | jjthetrader | General Programming | 4 | 05-14-2009 12:19 PM |
| alert on Highest High in 7 bars | rakeshSharma | Miscellaneous Support | 13 | 04-22-2009 07:08 AM |
| Highest high of a time frame | pablo_lasuncion | Strategy Development | 5 | 09-04-2007 02:05 PM |
| High greater than Highest High of last 20 Bars | SamIam | Strategy Development | 1 | 08-19-2007 04:58 PM |