Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Close position closes also the strategy
Collapse
X
-
Close position closes also the strategy
Hi, in my code I need to flatten a position for a single instrument. I'm using Account.Positions.FindByInstrument(Instrument).Clo se() which works OK regarding closing the position, but it also closes (disables) the strategy. Is there a call that closes a position but keeps the strategy runnig? Or any parameter of the strategy to set? Any help, even undocumented or unsupported :-), appreciated. Thank you.Tags: None
-
Hello mantak007,
Thank you for your post.
You can use the barsInProgess index to submit Exit() methods to the instrument in your strategy. For information on using multiple instruments in your strategy please visit the following link: http://www.ninjatrader.com/support/h...nstruments.htm
For information on the Managed Order Methods in NinjaScript please visit the following link: http://www.ninjatrader.com/support/h...d_approach.htm
Please let me know if I may be of further assistance.
-
Hello mantak007,
Thank you for your response.
The barsInProgressIndex is present in the SubmitOrder() method as well: http://www.ninjatrader.com/support/h...ubmitorder.htm
You cannot use the strategy to close positions that were opened from other strategies or order entry windows. You can however sync the account position on start up of the strategy, for information on syncing your account position and strategy position please visit the following link: http://www.ninjatrader.com/support/h..._positions.htm
Please let me know if I may be of further assistance.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
672 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
379 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
111 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
577 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
582 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment