Any help would be greatly appreciated.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Comparing bar lows/highs
Collapse
X
-
Comparing bar lows/highs
I would like to compare the lows/highs of previous bars, but have no idea how to accomplish this. So say the Low[9] was 700 and Low[0] is 705. What code could be written to compare those numbers and recognize that the Low[0] was higher than Low[9]?
Any help would be greatly appreciated.Tags: None
-
Hello,
Thanks for the forum post.
To check these two bars I would check this.
if (Low[0] >= Low[9])
{
//Do something since the Low[0] is greater then or equal to the Low of 9 bars back.
}
If you dont know what bar you want to compare you can use this indicator to do this as well.
if(Low[0] > MIN(9)[0])
{
// The current low is greater then all the lows of the last 9 bars if this check is successfull
}
Let me know if I can be of further assistance.BrettNinjaTrader Product Management
-
Thanks for the reply Brett. Great solution. Your second suggestion is along the lines of what I was looking for. I'm trying to find specific lows/highs that deal with the RValueCharts indicator. Specifically when (RValueCharts(Color.Blue, 3, 3).VClose[0] <= -4 ) or (RValueCharts(Color.Blue, 3, 3).VClose[0] >= 4 ) So when the RValueCharts VClose is +/- 4 I would like to know what the Low/High of that bar is and then be able to compare that to future bars. Your suggestion is wonderful. Could you give me an example of how to combine these two ideas? Thanks.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
574 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
332 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
553 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
551 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment