Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order Lists

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

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

    #2
    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.

    Comment


      #3
      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.

      Comment


        #4
        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.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by joostb, Today, 04:40 AM
        0 responses
        2 views
        0 likes
        Last Post joostb
        by joostb
         
        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
        3 responses
        44 views
        0 likes
        Last Post Liquidfusion  
        Started by jjanguda, Yesterday, 10:57 PM
        1 response
        33 views
        0 likes
        Last Post NinjaTrader_ChrisSch  
        Working...
        X