Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CancelOrder()

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

    CancelOrder()

    Hi,

    With the UNMANAGED APPROACH.

    For som reason this code is not canceling the LngOrder3 and submitiing the LngOrder1BE order, I can´t find the error

    protected override void OnExecution(IExecution execution)

    if((BESrtOrder1 != null && BESrtOrder1 == execution.Order) && (LngOrder3 !=null) && (LngOrder1BE == null))
    {

    BESrtOrder1 = null;
    CancelOrder(LngOrder3);
    LngOrder1BE = SubmitOrder(0,OrderAction.Buy, OrderType.Stop,lotes,0,upper+(TickSize*offSet),"", "");
    }

    Any clue about it?

    Thanks a lot in advance.

    #2
    CJS, first of all I would ensure with Prints that the condition is really evaluating to 'true' that you've setup.

    Comment


      #3
      Well, the condition is just that BESrtOrder1 triggers, and whent it triggers the CancelOrder(LngOrder3); statement is not working.

      I have ensured with Prints that the BESrtOrder1 triggers.

      Also, LngOrder3 !=null since is has been submited
      And, LngOrder1BE == null since is has not been used yet.

      Any other idea?

      Comment


        #4
        You would need to simpilfy the code until it does what you expect and then add back other parts - I didn't really mean if you checked that the one order triggers, but that you just add a print after your order entry condition to see if all parts are working as you expect...for example a non reset IOrder from historical use, so it would not be null as you check and therefore render the complete condition false.

        also: have you checked for any log tab errors in the Control Center?

        What is the TraceOrders output saying?

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        647 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        369 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        572 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X