Results 1 to 2 of 2
 0 Attachment(s)    

Thread: Scripting EA's

  1. #1

    Default Scripting EA's

    Hi Funyoo,

    I hope this is the right section to make this question/request.

    Would it be possible to program a script, to daily schedule the use of 2 EAs in the same MT4 account?
    And also, when EA #1 has opened "x" positions, disable EA #2 - and/or Vice-versa? And, when there is only 1 open position from one of the EA's, enable the other EA again?

    Thank you in advance.

    Regards,

    LV
    Last edited by Lordvader; 12-09-2009 at 09:10.

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

    Default

    Quote Originally Posted by Lordvader View Post
    Hi Funyoo,

    I hope this is the right section to make this question/request.

    Would it be possible to program a script, to daily schedule the use of 2 EAs in the same MT4 account?
    And also, when EA #1 has opened "x" positions, disable EA #2 - and/or Vice-versa? And, when there is only 1 open position from one of the EA's, enable the other EA again?

    Thank you in advance.

    Regards,

    LV
    Hi Lordvader,

    You just need to define a new magic that has to be equal to the other ea'magic number.

    Code:
    extern int magic2=4321;
    extern int x=1;
    Then in the start code before the block where are located the ordersend function, add :

    Code:
    if(count(OP_BUY,magic2)+count(OP_SELL,magic2)>x)return(0);
    After this, further in the code, replace :

    Code:
    int count(int type){
    By :

    Code:
    int count(int type,int magic){
    Finally replace all :

    Code:
    count(OP_BUY)
    By :

    Code:
    count(OP_BUY,magic)
    And

    Code:
    count(OP_SELL)
    By :

    Code:
    count(OP_SELL,magic)

Tags for this Thread

eas, funyoo, magic, magic number, mt4, request

Posting Permissions

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