Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CancelOrder not working

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

    CancelOrder not working

    RC1 - I have a strategy which issues orders from on market data - all works fine, except cancelorder doesn't work - test strat is below. The status never goes from working to cancelled. Run this on market replay, 16 nov 2010, FGBL 12-10, starting 15:12:00 GMT.

    Please don't say you can't trade from on market data - trades work fine - limits, stops, profits etc

    thanks
    Dave

    Code:
            protected override void OnMarketData (MarketDataEventArgs e) {
            
                if (e.Time.Hour == 15 && e.Time.Minute == 13 && entry == null)
                    entry = EnterShortLimit(9999999);
                
                if (entry != null && entry.OrderState == OrderState.Working) {
                    Print("Call cancel");
                    CancelOrder(entry);
                }
            }
            
            
            protected override void OnOrderUpdate(IOrder o) {
                Print("ORDER: "+o.ToString());    
            }

    #2
    I think this is OK if I set live until cancelled in the entry. I still don't understand why without that the trade stays working all the time. Maybe because I have no OnBarUpdate.

    Comment


      #3
      Dave, the expiration of orders (normally on the next bar update if not liveUntilCancelled) is tied to the OnBarUpdate() - was TraceOrders giving you any insight?

      Thanks,

      Comment


        #4
        No. I guess, as I said, it doesn't expire if there's no OBU.

        Comment


          #5
          Originally posted by dave1992 View Post
          No. I guess, as I said, it doesn't expire if there's no OBU.
          Correct those are tied together.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Hwop38, 05-04-2026, 07:02 PM
          0 responses
          164 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Started by CaptainJack, 04-24-2026, 11:07 PM
          0 responses
          319 views
          0 likes
          Last Post CaptainJack  
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          246 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          350 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          179 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Working...
          X