protected override void OnOrderUpdate(Order order ...)
{
if (order.Name.StartsWith("LimOrd"))
{
if (order.OrderState == OrderState.Accepted)
{
//add order to list
}
else if (order.OrderState == OrderState.Cancelled)
{
//how do I find which order to remove from the list?
}
}
}
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Order Lists
Collapse
X
-
Order Lists
Code:Tags: None
-
apologies
public List<Order> orderList = new List<Order>();
perhaps I could use FromEntrySignal and remove it using a predicate? but not sure how?
does this look ok?
orderList.RemoveAll(Order => Order.FromEntrySignal == execution.Order.FromEntrySignal);Last edited by delTik; 05-12-2016, 07:43 AM.
Comment
-
Hello,
If you are trying to remove elements from a list like this you certainly can, you could check that the order object is equal to the execution.order object or check if the signal name is the same.
You can use standard C# items in NinjaScript as it is just C#.
The best way to determine if this works is to just try it and ensure it both compiles and completes the expected action.
I look forward to being of further assistance.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CaptainJack, 05-29-2026, 05:09 AM
|
0 responses
45 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 05:09 AM
|
||
|
Started by CaptainJack, 05-29-2026, 12:02 AM
|
0 responses
30 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
99 views
0 likes
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
177 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
170 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|

Comment