Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
How do I know if an IOrder is already exited?
Collapse
X
-
How do I know if an IOrder is already exited?
E.g. i have a list of IOrder objects, and I want to loop over them, and find out which ones have hit stop losses, and which are still open?Tags: None
-
After the initial entry order being filled, isn't this always "OrderState.Filled", even if we have since closed this position? I would like to know if an entryOrder is now closed/flat.
Comment
-
The problem I have is that I have multiple entry orders for a given instrument. Thus I could still be long with Order1, but now flat (having hit my stoploss) with order2.
With Position.MarketPosition, it will reveal that I am long
With OrderState, both will be Filled.
How do I determine that Order1 is still long, but order2 is now flat?Last edited by AntiMatter; 07-06-2011, 07:20 AM.
Comment
-
AntiMatter, it sounds like you'll need to write some custom code to keep track of the position. You could keep track of executions in OnExecution() and then every time Order1 is filled long, you add 1 to the position counter and every time it is filled short you subtract 1 from the position counter.AustinNinjaTrader Customer Service
Comment
-
-
-
Hello,
You would need to compare the order ID of your stop loss to the order ID that got filled.
Please see this sample monitoring your stop loss:
Monitoring Stop-Loss and Profit Target Orders
Let me know if I can be of further assistance.BrettNinjaTrader Product Management
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
673 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