EA interfering with other charts
1 2

thread: EA interfering with other charts

  1. #1
    Junior Member Efi91's Avatar
    27

    EA interfering with other charts

    Hello,
    please could someone tell me why the following code alters prices on additional charts which the EA is not attached to? It basically uses a moving average as a SL,
    I thought that the line if (OrderSymbol() == Symbol()) made it chart specific?

    thanks.

    Int totalorders = OpenOrders;

    for(int I=OrdersTotal()-1;igt;=0;I--)


    OrderSelect(I, SELECT_BY_POS,MODE_TRADES);
    if (OrderSymbol() == Symbol())


    if (OrderType() == OP_BUY)

    sl=movavg;
    OrderModify(OrderTicket(),OrderOpenPrice(),sl,Orde rTakeProfit(),0,Green);

    if (OrderType() == OP_SELL)

    sl=movavg (Spread*10)*Point;
    OrderModify(OrderTicket(),OrderOpenPrice(),sl,Orde rTakeProfit(),0,Green);



    //--
    }

  2. #2
    Junior Member najat_ls18's Avatar
    28
    You have to use yet another condition to define a trade by magicnumber.

    If(OrderMagicNumber() == MAGIC)

    Many EAs do not add magicnumber into the ticket when they send open order.
    (If they do not, magicnumber become 0 that's the same as manual transactions.)

    In this scenario, you can solve it by adding magic number.

    // specify Magic Number first like this
    int MAGIC = 1234567;

    // insert Magic Number to order section similar to this
    OrderSend(Symbol(), ...,MAGIC, ...);

  3. #3
    Junior Member Efi91's Avatar
    27
    You need to use yet another condition to specify a transaction by magicnumber.

    If(OrderMagicNumber() == MAGIC)

    Many EAs don't add magicnumber to the ticket whenever they send open order.
    (If they don't, magicnumber become 0 that's the same as manual transactions.)

    In this scenario, you can solve it by adding magic number.

    // define Magic Number first in this way
    int MAGIC = 1234567;

    // insert Magic Number to order section similar to this
    OrderSend(Symbol(), ...,MAGIC, ...);
    Thank you yet this EA manages trades just , it doesn't open them, so that I can't really use magic no.s

  4. #4
    Junior Member najat_ls18's Avatar
    28
    Arnold49,

    Okay, if so, OrderSymbol() == Symbol() does not manage trades just on the chart the EA is attached.

    If you attach it upon EURUSD chart and you're opening 5 additional EURUSD charts, it will manage trades which is opened on all other 5 charts also.

  5. #5
    Junior Member Efi91's Avatar
    27
    I had it on GBP/JPY it adjusted the market that has been there and, at precisely the exact same time time it adjusted a GBP/USD chart place, incidently it set them in precisely the exact same price,

    are you stating (OrderSymbol() == Symbol()) will not make it chart specific?

    thanks,
    Steve.

  6. #6
    Junior Member najat_ls18's Avatar
    28
    I can't say anything certain with only a piece of code above and without understanding what preferences the direction EA have, however,

    are you stating (OrderSymbol() == Symbol()) will not allow it to chart specific?
    Yes, It is not at least chart specific but merely symbol specific.

    I don't think that it will handle GBP/USD trades whenever you are attaching it to only GBP/JPY chart (if the code above is the only order modify section, of course).

    Isn't there a chance that other EA have modified it casually?

  7. #7
    Junior Member Efi91's Avatar
    27
    no, I only removed all other EA and tried again , still the same, I will post the entire EA, the idea is , you start a trade then this handles the close by tracking a moving average

    ps, only found some redundant code so I've removed it re-posted
    https://www.cliqforex.com/attachment...1871267950.mq4

  8. #8
    Junior Member najat_ls18's Avatar
    28
    Arnold49,

    since I view, your EA won't ever manage transactions on other emblem charts.

    When it actually happend without any other EAs,
    the only possibility left is you used built in monitoring stop by MT4 terminal.

    When negative, I have no idea about this, sorry.

  9. #9
    Junior Member Efi91's Avatar
    27
    Okay, I don't understand it, but thanks for looking.

  10. #10
    Junior Member Efi91's Avatar
    27
    This is weird, I've done some more testing

    I have 3 charts available in presentation, GBP/JPY, GBP/USD, EUR/USD

    have sell places open

    if I place the EA on GBP/JPY it corrects all 3 charts

    When I put it on GBP/USD it corrects itself EUR/USD

    When I put it on EUR/USD It merely corrects itself

    NO additional EA or charts are available

    Anybody?

  •