Results 1 to 4 of 4
 0 Attachment(s)    

Thread: Disable EA form EA or script

  1. #1
    Junior Member
    Join Date
    Jan 2009
    Posts
    11

    Smile Disable EA form EA or script

    Hi all,

    is possible to disable all active expert advisor in MT4 (the same of shortcut CTRL-E) from a call by an expert advisor or from a call by a script ?

    I need to disable all EA's in my MT4 when a condition is reached.

    Many thanks.

    Netmastro

  2. #2
    Member
    Join Date
    Jan 2009
    Location
    Austria
    Posts
    325

    Default

    Quote Originally Posted by netmastro View Post
    Hi all,

    is possible to disable all active expert advisor in MT4 (the same of shortcut CTRL-E) from a call by an expert advisor or from a call by a script ?

    I need to disable all EA's in my MT4 when a condition is reached.

    Many thanks.

    Netmastro
    Why would you disable EA's, just set a stoptrading=true parameter included to your if statement (example ordersend function), combined with a SL reached, basket win or loss, starting and ending time and so on.

    example, if you basket loss is hit, ea stops trading (no new orders) leaving the open orders open, if you recover from basket loss with the remaining open orders, stoptrading is now false and new orders can be executed.

    IX

  3. #3
    Junior Member
    Join Date
    Jan 2009
    Posts
    11

    Default

    Hi Ixbone,

    thanks for your quick answer.

    The EA that I want to use to disable all EA's is not the same EA that open positions.

    Infact the first EA works on a matched equity to close all positions, and the others work on all the the graphs opening positions.

    BB

    Netmastro

  4. #4
    Junior Member
    Join Date
    Jan 2010
    Posts
    14

    Lightbulb Yes! You need to activate the window keyboard function.

    To make the EA become SAD Face.
    You need this :


    #include <WinUser32.mqh>


    extern bool DisableAllEAs = TRUE;

    void DisableEA() {
    keybd_event(17, 0, 0, 0);
    keybd_event(69, 0, 0, 0);
    keybd_event(69, 0, 2, 0);
    keybd_event(17, 0, 2, 0);
    }


    int start() {

    if (DisableAllEAs == TRUE) {
    DisableEA();
    return (0);
    }
    .
    .
    .
    .


    }


Similar Threads

  1. Can i earn money form forex just one day in the week?
    By shereali in forum Trading discussion
    Replies: 2
    Last Post: 06-24-2014, 13:39
  2. Enable/Disable Expert advisor Button By Expert advsior
    By Trint in forum Ideas for expert advisors
    Replies: 1
    Last Post: 10-18-2010, 10:41
  3. JMBuyer Script.
    By mike2star in forum MQL programming
    Replies: 7
    Last Post: 12-18-2009, 08:44
  4. Replies: 2
    Last Post: 05-25-2009, 17:59

Tags for this Thread

advisor, ea works, expert, expert advisor, mt4, stop, time

Posting Permissions

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