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 Mindset, 04-21-2026, 06:46 AM
|
0 responses
115 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
161 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
83 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
127 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
87 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|

Comment