&& (EntryCandleDirection ? (Close[x] < Close[x+1] && Close[x+1] <Close[x+2] && Close[x+2] < Close[x+3] && Close[x+3] < Close[x+4] && Close[x+4] < Close[x+5] && Close[x+5] < Close[x+6] && Close[x+6] < v[x+7]&& Close[x+7] < Close[x+8]&& Close[x+8] < Close[x+9]) : Close[0] > 0)
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Adding Candle Close Strategy
Collapse
X
-
Adding Candle Close Strategy
I have a functioning code that uses this type of format. I have a bunch of parameters that all need to be true at the same time for an entry, so I am thinking of adding this in to test a theory I have been thinking for my scalp trades. This would be looking at entering a short looking for a continuation with my other parameters. Is there a way for me to do this shorthand and have the ability to create an extra variable that allows me to test the previous certain number of candles or do they have to be written out each time. It's obviously not too difficult to add another Close[x+?]<Close[x+?] just looking to simplify my replay tests.
&& (EntryCandleDirection ? (Close[x] < Close[x+1] && Close[x+1] <Close[x+2] && Close[x+2] < Close[x+3] && Close[x+3] < Close[x+4] && Close[x+4] < Close[x+5] && Close[x+5] < Close[x+6] && Close[x+6] < v[x+7]&& Close[x+7] < Close[x+8]&& Close[x+8] < Close[x+9]) : Close[0] > 0)Tags: None
-
Hi durdcash, thanks for posting. The code here can be placed inside it's own method that returns a boolean e.g.
private bool MyBoolVariable()
{
return ((EntryCandleDirection ? (Close[x] < Close[x+1] && Close[x+1] <Close[x+2] && Close[x+2] < Close[x+3] && Close[x+3] < Close[x+4] && Close[x+4] < Close[x+5] && Close[x+5] < Close[x+6] && Close[x+6] < v[x+7]&& Close[x+7] < Close[x+8]&& Close[x+8] < Close[x+9]) : Close[0] > 0));
}
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
47 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
22 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
33 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
50 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
42 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment