EURUSD EA won't make any trades.

 
 
For some reason 2 New EA' S I have completed won't make any trades.All of the other currency pairs execute ok.Also I am unable to open up the MQL4 editor to modify.This is an older Laptop computer with Windows XP.It has been doing a good job of running the Robots. Anyone have any ideas on this? I can't send the codes right now because I am sending this via a cell phone. Thanks, Jimtrader1
 
Add the souce or no one can help you.
 
x11115:
Add the souce or no one can help you.



Here is one of the files that doesn't work with the EURUSD  Am having trouble trying to enter both files here at one time using the SRC. I am new to this way or the right way.
	          
Files:
 
jimtrader1:

Here is one of the files that doesn't work with the EURUSD Am having trouble trying to enter both files here at one time using the SRC. I am new to this way or the right way.

I think I have got it right.
Files:
 

the result from int openbuy/opensell is a no. not true or false so, u have to check

if (openbuy or opensell > -1)
   {
   ......
   }
else
   {
   Print( "Error opening order ", GetLastError());
   }

in my opinion the error is gonna be 130

search for 4/5 digit broker / ECN broker & of course error 130

 
jimtrader1:

Here is one of the files that doesn't work with the EURUSD Am having trouble trying to enter both files here at one time using the SRC. I am new to this way or the right way.

This is for the scalpOSC EA.

 if ((adx>adxx) && (ma>maa) && (sto<20 && rsi<30)) //Signal Buy
 {

   if(OrderSelect(0,SELECT_BY_POS,MODE_TRADES))

Here you are signalling a buy but may not have any orders on. Hence you fail the first test and hit the error message. Add an

if( OrdersTotal()>0 )

test before the OrderSelect() to rid yourself of the first error message.

For the second problem, I notice the default

extern int StopLoss   =0;     // SL for an opened order
extern int TakeProfit =0;     // ?? for an opened order

will fail in the OrderSend() because the StopLoss and TakeProfit levels are too close to the market value (equal to it).

 
dabbler:

For the second problem, I notice the default

extern int StopLoss   =0;     // SL for an opened order
extern int TakeProfit =0;     // ?? for an opened order

will fail in the OrderSend() because the StopLoss and TakeProfit levels are too close to the market value (equal to it).

there is no problem at all to send an order with SL & TP 0 with some brokers (called ECM) you must send with ST & TP 0
 
qjol:

the result from int openbuy/opensell is a no. not true or false so, u have to check

in my opinion the error is gonna be 130

search for 4/5 digit broker / ECN broker & of course error 130


Thanks for the help. I use MBTrading an ECN Broker. I am doing Ok with the code but still having the most trouble with the Orders part of the code.

Looks like I need to look at more examples on this.

 
qjol:
there is no problem at all to send an order with SL & TP 0 with some brokers (called ECM) you must send with ST & TP 0


Thanks for the help. I use MBTrading an ECN Broker. Is there really an ECM Broker? Maybe I need to talk to MBTrading but then

again they do nothing or do not support the code themselves. You are on your own. I need to get this Order code mess straighted out.

I am able to write halfway decent EA'S because of my experience Trading. Just need to get this down clear. I know you will always get

some errors now and then.

 
jimtrader1:

Here is one of the files that doesn't work with the EURUSD Am having trouble trying to enter both files here at one time using the SRC. I am new to this way or the right way.
Change:
int openbuy=OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, Ask-StopLoss*Point, Ask-StopLoss*Point); //Opening Buy
to:
int openbuy=OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, 0, 0); //Opening Buy
if (openbuy > 0 ) { // Succeeded, got back a ticket number
if ( !(OrderModify(openBuy, OrderOpen(), Slippage, Ask+StopLoss*Point, Ask-StopLoss*Point, 0, CLR_NONE)) ) {
// Process orderModify Errors(use GetLastError())
}
} else {
// Process OrderSend errors, no ticket was received back (use GetLastError())
}

This works with all brokers that I know of - While it used to be limited to ECN brokers, there is a growing number of all types who require you to establish an order with no stop loss or take profit and then add the TP and SL to the already existing order (and make sure the values added and subtracted from Ask are large enough to not run afoul of 'stoplevel').

Reason: