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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
39 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
19 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
26 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
42 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
35 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment