if(ADX(8)[0] > 25
&& Rising(ADX(8)) == true
&& CCI(28)[0] >= 100
&& CCI(7)[0] >= 100)
{
EnterLong(DefaultQuantity,"");
}
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
BarsAgo
Collapse
X
-
BarsAgo
I have searched and read on trying to make the code below only enter long if CCI(7) is at or above 100 for 3 or more bars before CCI(28) is at or above 100, but was unsuccesful at finding a solution that or a solution that made sense. It is vital that it does not just go above, but it must stay above. I looked into MRO, but don't even know if I was going in the right direction. Help is very much appreciated.
Code:Tags: None
-
Originally posted by Hammerhorn View PostI have searched and read on trying to make the code below only enter long if CCI(7) is at or above 100 for 3 or more bars before CCI(28) is at or above 100, but was unsuccesful at finding a solution that or a solution that made sense. It is vital that it does not just go above, but it must stay above. I looked into MRO, but don't even know if I was going in the right direction. Help is very much appreciated.
Code:if(CurrentBar < 4) return; if(ADX(8)[0] > 25 && Rising(ADX(8)) && CCI(7)[0] >= 100 && CCI(7)[1] >= 100 && CCI(7)[2] >= 100 && CCI(28)[0] >= 100 && // to avoid pyramiding (ADX(8)[1] < ADX(8)[2] || CCI(7)[3] < 100 || CCI(28)[1] < 100))) { EnterLong(DefaultQuantity,""); }
Changed the code above.
-
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by argusthome, Yesterday, 10:06 AM
|
0 responses
14 views
0 likes
|
Last Post
by argusthome
Yesterday, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
11 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
9 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
4 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
31 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment