EA between computers

 

 The following code works just fine on one of my computers.  However, I have another computer that will only place the order in the blue code.

I have an Open order failed Err # 129. I added RefreshRates() before the 'If' statement.  Why would it work on one computer but not on the other?

I am on an Alpari platform on both computers.  5 digit prices on both computers.

 

 //==========Chk for Sells
    if (BuySell=="S")
     {
    
      intTicket=OrderSend(Symbol1,OP_SELL,Lots,Bid,MaxSpread,0,0,0,0,0);
      if (intTicket<0)
      {
        Print("Order Open failed." + Symbol1 + " order number: ", OrderTicket(), " Error: ", GetLastError() );  
          return;
     
      }
      intTicket=OrderSend(Symbol2,OP_SELL,Lots,Bid,MaxSpread,0,0,0,0,0);
       if (intTicket<0)
      {
        Print("Order Open failed." + Symbol2 + " order number: ", OrderTicket(), " Error: ", GetLastError() );  
        return;
     
      }
           
    } //  if (BuySell=="S")

 
You can't use Bid/Ask if Symbol2 is not the chart symbol.
 

WHRoeder:
You can't use Bid/Ask if Symbol2 is not the chart symbol.

 

 

 

Reply:

Only one chart window is up at a time on either computer. I load the EA on the USDCHF on one computer and a sell or buy is open for the USDCHF and EURUSD (Symbol1 and Symbol2). If I do this on the other computer... only Symbol1 is opened. I get an er 129 on Symbol2. This does not make sense to me. Advice?? 

 

dukeb:

Reply:

Only one chart window is up at a time on either computer. I load the EA on the USDCHF on one computer and a sell or buy is open for the USDCHF and EURUSD (Symbol1 and Symbol2). If I do this on the other computer... only Symbol1 is opened. I get an er 129 on Symbol2. This does not make sense to me. Advice?? 


Your code is trying to place a OP_SELL on Symbol1 and and then on Symbol2,  thats 2 Sells.  Bid is the bid price for the symbol that the EA is on.  So if the EA is running on EURUSD and you try to place a Sell on USDCHF then the Bid price will be wrong for USDCHF.
 

RaptorUK:
Your code is trying to place a OP_SELL on Symbol1 and and then on Symbol2,  thats 2 Sells.  Bid is the bid price for the symbol that the EA is on.  So if the EA is running on EURUSD and you try to place a Sell on USDCHF then the Bid price will be wrong for USDCHF.

Reply: 

I went to the offending computer.  I opened the EURUSD chart.  I then started the EA.  Nothing happened.  The msg was a 129 on the USDCHF (Symbol1).  Apparently the error resulted in skipping the open of the EURUSD (Symbol2). That would indicate that you are correct.  I then went to the other computer.  I opened the EURUSD chart.  I then started the EA. Both pairs were opened.   Everything went fine.  I am confused. Are you??  BTW I really appreciate your help.

 

dukeb:

I went to the offending computer.  I opened the EURUSD chart.  I then started the EA.  Nothing happened.  The msg was a 129 on the USDCHF (Symbol1).  Apparently the error resulted in skipping the open of the EURUSD (Symbol2). That would indicate that you are correct.  I then went to the other computer.  I opened the EURUSD chart.  I then started the EA. Both pairs were opened.   Everything went fine.  I am confused. Are you??  BTW I really appreciate your help. 



Perhaps on the computer that worked you has Symbol1 and symbol2 set to the same symbol ?
 

RaptorUK:

Perhaps on the computer that worked you has Symbol1 and symbol2 set to the same symbol ?

 

 

 

Reply:

No the correct symbols come up with the correct pricing.  Here is a copy of the EA, if that will help. 

Files:
 
dukeb:

 Reply:

No the correct symbols come up with the correct pricing.  Here is a copy of the EA, if that will help. 


It's not possible.  Perhaps you had an existing order open on the other symbol.

If you want to know if it happened or not look through the log file and find the entry that shows where the EURUSD and USDCHF orders were placed,  post it here and I will eat a virtual hat and apologise. 

 
RaptorUK:


It's not possible.  Perhaps you had an existing order open on the other symbol.

If you want to know if it happened or not look through the log file and find the entry that shows where the EURUSD and USDCHF orders were placed,  post it here and I will eat a virtual hat and apologise. 

 

 

 

reply:

2013.03.15 09:08:45 '909479': order was opened : #1959104 sell 1.00 EURUSD at 1.30570 sl: 0.00000 tp: 0.00000
2013.03.15 09:08:45 '909479': request in process
2013.03.15 09:08:45 '909479': request was accepted by server
2013.03.15 09:08:44 '909479': order sell market 1.00 EURUSD sl: 0.00000 tp: 0.00000
2013.03.15 09:08:44 '909479': order was opened : #1959103 sell 1.00 USDCHF at 0.93978 sl: 0.00000 tp: 0.00000
2013.03.15 09:08:44 '909479': request in process
2013.03.15 09:08:44 '909479': request was accepted by server
2013.03.15 09:08:44 '909479': order sell market 1.00 USDCHF sl: 0.00000 tp: 0.00000


I currently have two sell orders open. EURUSD and USDCHF.

There has got to be an explanation for this.  On this entire planet, somebody must have experienced this other than me.

I would sure like to get this solved.  Any help would be very much appreciated.  

 
dukeb:

I currently have two sell orders open. EURUSD and USDCHF.

There has got to be an explanation for this.  On this entire planet, somebody must have experienced this other than me.

I would sure like to get this solved.  Any help would be very much appreciated.   

Can you show the extract from the experts log,  not the journal,  where the orders were placed.
 

RaptorUK:
Can you show the extract from the experts log,  not the journal,  where the orders were placed.

 

reply:

I closed the previous trade.  At your request I have opened two new trades. Is this what you need? 

 

From Journal

2013.03.15 09:24:27 '909479': order was opened : #1959135 sell 1.00 EURUSD at 1.30647 sl: 0.00000 tp: 0.00000
2013.03.15 09:24:27 '909479': request in process
2013.03.15 09:24:27 '909479': request was accepted by server
2013.03.15 09:24:27 '909479': order sell market 1.00 EURUSD sl: 0.00000 tp: 0.00000
2013.03.15 09:24:27 '909479': order was opened : #1959134 sell 1.00 USDCHF at 0.93941 sl: 0.00000 tp: 0.00000
2013.03.15 09:24:27 '909479': request in process
2013.03.15 09:24:27 '909479': request was accepted by server
2013.03.15 09:24:26 '909479': order sell market 1.00 USDCHF sl: 0.00000 tp: 0.00000

From experts:

2013.03.15 09:24:27 CloseOnNetProfitEA EURUSD,H1: open #1959135 sell 1.00 EURUSD at 1.30647 ok
2013.03.15 09:24:27 CloseOnNetProfitEA EURUSD,H1: open #1959134 sell 1.00 USDCHF at 0.93941 ok
 

 

 

 

Reason: