Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Exit all positions based on open P/L
Collapse
X
-
Exit all positions based on open P/L
I need to be able to enter a script which allows me to exit multiple markets based on open P/L. Thanks for any help in advance.Last edited by thomaskrawczyk; 08-01-2014, 07:16 AM.Tags: None
-
Hello Thomaskrawczyk,
Thank you for your post.
You can use the Positions function within NinjaScript to access the other positions that they strategy has. You would then use GetProfitLoss() method to now the PnL
http://www.ninjatrader.com/support/h...?positions.htm
Let me know if I can be of further assistance.Cal H.NinjaTrader Customer Service
-
I looked over the script in the link you sent- if I am manually entering a spread and want to exit if both markets reach a total profit or loss of x does that script still apply? It looks like the script had to enter specific markets/time frame. And I just want to focus on open P/L. Something like =IF open P/L is +200.00, -200.00 exit all positions?
Comment
-
Thomaskrawczyk,
The Positions will apply to an active strategy. If you are placing orders manually you would not be able to access these through the script in any supported capacity.
There is an unsupported method to querying your accounts positions, however we have not tested this for getting PnL nor do we have documentation on the subject.
The method can be found below -
http://www.ninjatrader.com/support/f...ad.php?t=55718Cal H.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CaptainJack, 05-29-2026, 05:09 AM
|
0 responses
294 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 05:09 AM
|
||
|
Started by CaptainJack, 05-29-2026, 12:02 AM
|
0 responses
191 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
186 views
1 like
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
272 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
219 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|

Comment