Results 1 to 6 of 6
 0 Attachment(s)    

Thread: Delete all pending order

  1. #1

    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,003

    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

    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,003

    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

    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..

Similar Threads

  1. Replies: 2
    Last Post: 08-04-2014, 19:03
  2. PENDING ORDER EA
    By bero in forum Expert advisors backtesting
    Replies: 4
    Last Post: 12-03-2010, 17:23
  3. Pending Order EA
    By arfian in forum Ideas for expert advisors
    Replies: 0
    Last Post: 10-14-2010, 06:59
  4. Delete pending Order when limit is reached
    By Anthares in forum Scripts and other tools
    Replies: 0
    Last Post: 07-04-2009, 06:35

Tags for this Thread

magic, magic number, mql, scripts, sells

Posting Permissions

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