Problem with same EA running in different windows

thread: Problem with same EA running in different windows

  1. #1
    Junior Member Jorgefer_10's Avatar
    28

    Problem with same EA running in different windows

    I am test running the 2008 championship EA on a demo account. It has an area where it is possible to set parameters for up to 4 different currency pairs within the MT4 code. The EA then monitors the currency pair in the chart window (e.g. GBPUSD) that it is running in, if it matches one of the four pairs within the code then it will trade that pair at the correct signal, manage it etc..

    The difficulty I have is when I try to run the identical EA in another window that matches the other three currency pairs; EURGBP GBPJPY EURUSD.

    These will only trade if there is no GBPUSD commerce going. If I close the GBPUSD then one of the other 3 pairs will immediately trade.

    I need for the EA to trade the currency pair it is attached to and each EA to manage its own currency pair.

    So my question is what will block the EA from trading? Could it be something like having the exact same magic number? That may be the one thing I could figure that could be common between the two EA's running in separate windows - i.e. if there is an open order with the exact same magic number it will not trade. It seems at the available orders and sets a flag if there is an open order.

    Any hints what I need to be seeking?

    Thanking you in advance.

  2. #2
    Junior Member Jorgefer_10's Avatar
    28
    At the time I composed this response this thread had 21 views....but no replies!

    Can anybody please help?

    Thanks.

  3. #3
    Member
    70
    My initial guess is magical number.

    Do you have the source code? Perhaps we can get a look and discover the trade management logic.

  4. #4
    Junior Member Jorgefer_10's Avatar
    28
    1 Attachment(s) Ronald,

    Attacking you. Attached is the source code. I expanded the matrix for 16 currency pairs as a learning project for myself. My intention was to pop every EA to a currency pair window and start tweeking those parameters. There's but one pair of parameters for every pair (defined as a thread).

    The modifiions I made were in //A System: Parameters 1

    This isn't my code, therefore I wish not to offend anyone (the first author), it is a learning project to construct an EA, therefore I thank you for your aid.

    Additionally, I wish to make the modifiions myself so could you just point me in the right direction?

    Thank you,

    Stooper
    https://www.cliqforex.com/general-fo...a-raschke.html

  5. #5
    Junior Member Jorgefer_10's Avatar
    28
    The problem was in function 16.

    It calls the sub routine afr.System.AttemptToTrade (I)

    The I then becomes aai.OrderID.

    By altering it to:

    afr.System.AttemptToTrade (ac.Symbols *10 ac.Threads)

    I am able to open one position per symbol per thread.

    Ronald - I sent you a PM please dismiss. And

    Stooper

  •