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 Mindset, 04-21-2026, 06:46 AM
|
0 responses
91 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
137 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
68 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
121 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
72 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|

Comment