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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    67 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    36 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    60 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Working...
    X