+ Reply to Thread
Results 1 to 6 of 6
 0 Attachment(s)    

Thread: Delete all pending order

  1. #1
    Member
    Join Date
    Sep 2009
    Posts
    57

    Default Delete all pending order

    Any one have this script?

    delete all pending order.

    Thank you very much

  2. #2
    Administrator funyoo's Avatar
    Join Date
    Sep 2008
    Posts
    7,455

    Default

    Quote Originally Posted by fairylord View Post
    Any one have this script?

    delete all pending order.

    Thank you very much
    Hi fairylord,

    In the functions area, add :

    Code:
    void deleteallpendingorders(int magic){
       for(int i=0;i<OrdersTotal();i++){
         OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
         if(OrderSymbol()==Symbol() && OrderMagicNumber()==magic && ((OrderType()==OP_BUYSTOP) || (OrderType()==OP_SELLSTOP) || (OrderType()==OP_BUYLIMIT) || (OrderType()==OP_SELLLIMIT))){
           OrderDelete(OrderTicket());
         }   
       }
    }
    In the start body :

    Code:
    deleteallpendingorders(magic);
    Replace magic by your magic number.

    You can find a script here : Delete pending order, Delete pending - MQL4 Code Base

  3. #3
    Member
    Join Date
    Sep 2009
    Posts
    57

    Default

    Quote Originally Posted by funyoo View Post
    Hi fairylord,

    In the functions area, add :

    Code:
    void deleteallpendingorders(int magic){
       for(int i=0;i<OrdersTotal();i++){
         OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
         if(OrderSymbol()==Symbol() && OrderMagicNumber()==magic && ((OrderType()==OP_BUYSTOP) || (OrderType()==OP_SELLSTOP) || (OrderType()==OP_BUYLIMIT) || (OrderType()==OP_SELLLIMIT))){
           OrderDelete(OrderTicket());
         }   
       }
    }
    In the start body :

    Code:
    deleteallpendingorders(magic);
    Replace magic by your magic number.

    You can find a script here : Delete pending order, Delete pending - MQL4 Code Base

    Sir Funyoo...


    Really sorry to confess i'm zero in script writing, i have tried to understand it...

    but i am totally no idea what is function area and start body, why need magic number?

    sorry, Sir.



    Fairylord

  4. #4
    Administrator funyoo's Avatar
    Join Date
    Sep 2008
    Posts
    7,455

    Default

    Quote Originally Posted by fairylord View Post
    Sir Funyoo...


    Really sorry to confess i'm zero in script writing, i have tried to understand it...

    but i am totally no idea what is function area and start body, why need magic number?

    sorry, Sir.



    Fairylord
    Hi fairylord,

    Ok, so you can use the script in the link above.

    The magic is an option.

  5. #5
    Junior Member
    Join Date
    Jun 2009
    Posts
    4

    Default

    Sorry Funyoo, pls check this thread out, i suppose leave my messg here but dont know Y it just direct to another new thread, i need ur advice at below... Thanks a lot

    http://www.tradingsystemforex.com/sc...html#post20383

  6. #6
    Member
    Join Date
    Sep 2009
    Posts
    57

    Default

    Quote Originally Posted by funyoo View Post
    Hi fairylord,

    Ok, so you can use the script in the link above.

    The magic is an option.

    Ok, Sir....^^

    thanks..

+ Reply to Thread

Similar Threads

  1. Hedge order
    By claypot in forum MQL programming
    Replies: 11
    Last Post: 10-02-2010, 09:23
  2. Delete pending Order when limit is reached
    By Anthares in forum Scripts and other tools
    Replies: 0
    Last Post: 07-04-2009, 05:35
  3. Broker allow lot 50.00, will MT4 EA split an order?
    By sleepypipsCDN in forum Metatrader brokers
    Replies: 2
    Last Post: 05-28-2009, 16:27
  4. Add reverse order
    By darkkiller in forum MQL programming
    Replies: 1
    Last Post: 05-16-2009, 07:15
  5. Pending orders expiration
    By funyoo in forum MQL programming
    Replies: 0
    Last Post: 11-26-2008, 20:10

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts