Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Higher Lows/Lower Highs on pullback
Collapse
X
-
Higher Lows/Lower Highs on pullback
I am looking for some help/ideas on how I can do this. I want to identify when a pullback has a "smooth" move, i.e. each bars low is higher than the previous bars low, if during the pullback, any bars low moves lower than the previous bars low, it's invalid. I have tried if Low[0] > Low[1] but the problem is, I don't know how many bars there could be in the pullback, they vary. I have wracked my brain trying to figure out a way to accomplish this. Any ideas would be appreciated. I included screenshots of a good & bad pullback. Thanks in advanceTags: None
-
Hello mlarocco,
Thank you for your post.
Some members of our forum community may feel free to chime in with their ideas, although it does seem like you will need to use additional logic in your conditions to define what you determine to be a good pullback. For example, if you decide how many bars in a row the low must be higher than the previous low and add additional logic, this could help to narrow down the definition of what you are looking for in a good pullback. You could check not only for Low[0] > Low[1], but also for Low[1] > Low[2] && Low[2] > Low[3], etc. if you would like to check for several increasing lows over the course of a few bars.
Please let us know if we may be of further assistance.
-
Thanks, but that's my dilemma, there could be 2 bars or 5, maybe it just can't be doneOriginally posted by NinjaTrader_Emily View PostHello mlarocco,
Thank you for your post.
Some members of our forum community may feel free to chime in with their ideas, although it does seem like you will need to use additional logic in your conditions to define what you determine to be a good pullback. For example, if you decide how many bars in a row the low must be higher than the previous low and add additional logic, this could help to narrow down the definition of what you are looking for in a good pullback. You could check not only for Low[0] > Low[1], but also for Low[1] > Low[2] && Low[2] > Low[3], etc. if you would like to check for several increasing lows over the course of a few bars.
Please let us know if we may be of further assistance.
Comment
-
Hello mlarocco,
You will need to define the exact rules that qualify a 'good pullback'.
We can help with turning the logic you come up with into c#, but you need to define the rules of what you are wanting.
"there could be 2 bars" This would mean any amount of bars greater than 2 in a row where the low is greater than the previous low would meet the condition correct? This would include 3, 4, 5, 6, etc..
Chelsea B.NinjaTrader Customer Service
Comment
-
"This would mean any amount of bars greater than 2 in a row where the low is greater than the previous low would meet the condition correct?"... that is correct and if any of those lows were lower than a previous low, it would be invalid.Originally posted by NinjaTrader_ChelseaB View PostHello mlarocco,
You will need to define the exact rules that qualify a 'good pullback'.
We can help with turning the logic you come up with into c#, but you need to define the rules of what you are wanting.
"there could be 2 bars" This would mean any amount of bars greater than 2 in a row where the low is greater than the previous low would meet the condition correct? This would include 3, 4, 5, 6, etc..
Comment
-
Hello mlarocco,
That would mean if the Low[0] is greater than Low[1] and Low[1] is greater than Low[2], then it wouldn't matter how many bars before that the low is greater than the previous bar.
You could certainly count and find how many bars back this condition is true using a loop.. but if you don't care about the number of bars back it goes and you just want to know there are at least 2 bars in a row where the low is greater than the previous bar, then thats all you need in the condition.Chelsea B.NinjaTrader Customer Service
Comment
-
That was my original thought, but then I realized that if I set the lookback to say 5 bars and there were only 3 bars to where my signal (EMA) would trigger, it would be considered invalid, even though it would be valid. Hope I'm making sense.Originally posted by NinjaTrader_ChelseaB View PostHello mlarocco,
That would mean if the Low[0] is greater than Low[1] and Low[1] is greater than Low[2], then it wouldn't matter how many bars before that the low is greater than the previous bar.
You could certainly count and find how many bars back this condition is true using a loop.. but if you don't care about the number of bars back it goes and you just want to know there are at least 2 bars in a row where the low is greater than the previous bar, then thats all you need in the condition.
Comment
-
Hello mlarocco,
If you are checking there are 2 bars in a row where the low is higher than the previous bar, this would also be true when there are 5 or 10, or how ever many bars are in a row.
For example if you are asking if there is 1 green ball in a backest of balls, it wouldn't matter if there are 500 green balls or 1 green ball. As long as there is 1 green ball, then the condition is true.
If you want to make sure there are 5 bars where the condition is true, then compare for 5 bars. If the condition can be true or 2 or greater, then measure for 2.Chelsea B.NinjaTrader Customer Service
Comment
-
The problem would be if I choose 2 bars to lookback and there were 5 or 6 bars in the pullback, 2 bars could be valid, then another bar could be invalid, then 2 more bars could be valid, it wouldn't be a valid pullback but it would be treated as if it were. I think it just isn't possible. ThanksOriginally posted by NinjaTrader_ChelseaB View PostHello mlarocco,
If you are checking there are 2 bars in a row where the low is higher than the previous bar, this would also be true when there are 5 or 10, or how ever many bars are in a row.
For example if you are asking if there is 1 green ball in a backest of balls, it wouldn't matter if there are 500 green balls or 1 green ball. As long as there is 1 green ball, then the condition is true.
If you want to make sure there are 5 bars where the condition is true, then compare for 5 bars. If the condition can be true or 2 or greater, then measure for 2.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
51 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
127 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
69 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
42 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
46 views
0 likes
|
Last Post
|

Comment