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 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