Thank You
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Stop loss
Collapse
X
-
forexx, please take a look at the reference sample that goes over exactly what you're looking for - Halting a Strategy Once User Defined Conditions Are MetAustinNinjaTrader Customer Service
-
forexx, you can use the MarketPosition property to determine whether or not you are in a position and act accordingly:
If you decide to use this approach, be sure to set your stops and targets in a section of code that gets executed, or the position will never be closed.Code:if (Position.MarketPosition != MarketPosition.Flat) { // you are in a position, do nothing return; } else // you are not in a position { // put trading code here }AustinNinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
79 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
45 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
29 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
32 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
66 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment