Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cancelling Orders - BUG ???

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

    Cancelling Orders - BUG ???

    Hi

    I have seen a fair few threads with issues/bugs around cancelling orders. I have a strategy, within the strategy I maintain a list of orders - I add to it when a limit order is placed and remove from it when it is filled - so it is a list of open orders. Yestersday I made a call to my function that loops through my list of orders in order to cancel them all - in doing so it cancelled the entire position and the unfilled orders! ... Is that something anybody has run across before ... I hope it is a bug in my code but how can a call to CancelOrder actually close a position - if a call to CancelOrder is made with an IOrder that has been filled does it close the position???

    Many Thanks

    Paul

    #2
    Paul, CancelOrder does not close a position, we would recommend you work with TraceOrders = true in the Initialize and check which part of code closes the position to debug this.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    65 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    149 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    162 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    99 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    286 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X