Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
single order on trend change
Collapse
X
-
Hello 270027,
The script you have provided was exported as an assembly, so we are not able to view the code.
To only allow one order to be taken, you can check the position to be flat before allowing an entry.
if (Position.MarketPosition != MarketPosition.Flat)
{
EnterLong();
}
You could also use bools to control this behavior as well. Once the order is submitted, set a bool to true. When the position is flat or an exit order is filled, set the bool back to flat. Require the bool to be false to allow an entry.
Last, you could control this by assigning orders to variables and checking the order state, or checking to see if the variable is null.
Below is a link to an example.
Chelsea B.NinjaTrader Customer Service
-
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by kinfxhk, 07-14-2026, 09:39 AM
|
0 responses
19 views
0 likes
|
Last Post
by kinfxhk
07-14-2026, 09:39 AM
|
||
|
Started by kinfxhk, 07-13-2026, 10:18 AM
|
0 responses
60 views
0 likes
|
Last Post
by kinfxhk
07-13-2026, 10:18 AM
|
||
|
Started by kinfxhk, 07-13-2026, 09:50 AM
|
0 responses
43 views
0 likes
|
Last Post
by kinfxhk
07-13-2026, 09:50 AM
|
||
|
Started by kinfxhk, 07-13-2026, 07:21 AM
|
0 responses
47 views
0 likes
|
Last Post
by kinfxhk
07-13-2026, 07:21 AM
|
||
|
Started by kinfxhk, 07-11-2026, 02:11 AM
|
0 responses
38 views
0 likes
|
Last Post
by kinfxhk
07-11-2026, 02:11 AM
|

Comment