Mt4 Order Send Problem on EA

thread: Mt4 Order Send Problem on EA

  1. #1

    Mt4 Order Send Problem on EA

    Hi Guys, ive tried many thing but I cant solve this....

    That I Have a Lot of pairs being analysed and when a state its true I want to send a order...

    Example:

    if(Sell_GBPCAD)

    ticket1=OrderSend(GBPCAD,OP_SELL,FixedLotSize,Bid, 3,0,Bid - 0.00050,SG_PipKiller,MAGICMA,0,Red);
    CountB_GBPCAD=False;

    if(ticket1gt;0)

    if(OrderSelect(ticket1,SELECT_BY_TICKET,MODE_TRADE S))
    Print(SELL GBPCAD order started:,OrderOpenPrice());

    else
    Print(Error opening SELL GBPCAD order:,GetLastError());

    Now since im loading the EA on EURUSD Chart, its constantly placing the order on EURUSD and this case its to GBPCAD...

    Someone can help me:--RRB-

    Thank you

  2. #2
    If you want to open an order for a pair aside from the one the EA is put on, you need to specify the ideal price from the OrderSend(). Bid refers only to the current chart price. You must replace Bid by MarketInfo(XXXYYY,MODE_BID)... Of course XXXYYY being the pair you're launching an order. And you must do this to every part refering to the current chart worth.
    Thank you ill try:-)

  3. #3
    quote Thanks ill try:--RRB-
    BTW, note that this kind of EA can't be backtested because MT4 backtester doesn't permit multi pairs.

  4. #4
    quote BTW, notice that this type of EA can not be backtested as MT4 backtester doesn't allow multi pairs.
    Yes I understand:--LRB-. . Should be tested running a demo account....

    Thank you for the help

  5. #5
    quote Yes I know:--LRB-. . Should be tested running a demo account.... Thanks to this help

  6. #6
    quote
    Problem Solved , Thanks

  7. #7
    quote Problem Solved, Thanks
    Great!

  8. #8
    If you would like to start an order for a pair aside from the one the EA is put on, you must specify the right price in the OrderSend().

    Bid refers solely to the current chart price.

    You must replace Bid from MarketInfo(XXXYYY,MODE_BID)... Of course XXXYYY being the pair you are launching an order.

    And you must do this to every part refering to the current chart worth.

  •