Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order Lists

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • NinjaTrader_Jesse
    replied
    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.

    Leave a comment:


  • delTik
    replied
    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, 06:43 AM.

    Leave a comment:


  • NinjaTrader_PatrickH
    replied
    Hello delTik,

    Thank you for your post.

    So we may provide assistance on this matter please clarify what you are referring to as the order list and how you add objects to that list.

    Leave a comment:


  • delTik
    started a topic Order Lists

    Order Lists

    Code:
    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?
    				}
    			}
    		}

Latest Posts

Collapse

Topics Statistics Last Post
Started by Johnny Santiago, Today, 03:11 AM
1 response
3 views
0 likes
Last Post NinjaTrader_Jason  
Started by pjsmith, Today, 12:44 AM
2 responses
17 views
0 likes
Last Post pjsmith
by pjsmith
 
Started by Liquidfusion, Yesterday, 10:51 PM
2 responses
43 views
0 likes
Last Post Liquidfusion  
Started by jjanguda, Yesterday, 10:57 PM
1 response
33 views
0 likes
Last Post NinjaTrader_ChrisSch  
Started by fscabrera03, Yesterday, 04:58 PM
0 responses
58 views
0 likes
Last Post fscabrera03  
Working...
X