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, 07: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 goodknight777, Today, 11:39 AM
        0 responses
        2 views
        0 likes
        Last Post goodknight777  
        Started by MohammedAmine, Today, 10:44 AM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Kate  
        Started by Nolyn, Today, 10:59 AM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by Gkomi, Today, 10:02 AM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Jim  
        Started by JTizz, Today, 08:58 AM
        10 responses
        34 views
        0 likes
        Last Post JTizz
        by JTizz
         
        Working...
        X