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 CaptainJack, 05-29-2026, 05:09 AM
|
0 responses
173 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 05:09 AM
|
||
|
Started by CaptainJack, 05-29-2026, 12:02 AM
|
0 responses
91 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 12:02 AM
|
||
|
Started by charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
129 views
0 likes
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
209 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
186 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|

Comment