Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order cancel question

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

    Order cancel question

    Hi guys,

    I want to ask if there is anything wrong in cancelling MIT orders(isLiveUntilCancelled=true) like that on OnBarUpdate?

    PHP Code:
    
    protected override void OnBarUpdate()
    {
          foreach(var order in Orders)
          {
                CancelOrder(order);
          }
    
         //some strategy logic here
    } 
    
    Last edited by login_dejavu; 01-15-2020, 02:16 PM.

    #2
    Hello login_dejavu,

    Thank you for your post.

    I don't see anything that would be an issue there other than "o" would need to be an Order variable with the corresponding order to cancel saved to it. You could replace that with order to cancel whatever order you've iterated to:

    Code:
                      foreach(var order in Orders)
                      {
                            CancelOrder(order);
                      }
    Please let us know if we may be of further assistance to you.

    Comment


      #3
      Yes, it was a typo, I meant "order" instead of "o". Thank you

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CaptainJack, 05-29-2026, 05:09 AM
      0 responses
      474 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 05-29-2026, 12:02 AM
      0 responses
      315 views
      0 likes
      Last Post CaptainJack  
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      253 views
      1 like
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      340 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      305 views
      0 likes
      Last Post CarlTrading  
      Working...
      X