Buy above curent price??

 
 
 

also u may wanna put the debug code in

if(ticket<0)

{

Print("OrderSend failed with error #",GetLastError());

return(0);

}

u may could work something like this into the code i believe

pricevar=Ask;

if (Ask>=pricevar+30Point)

but stoporder may be more efficient

 

If I use OP_BUYSTOP the Expert do nothing.

 
martin80:
If I use OP_BUYSTOP the Expert do nothing.

Your trade expiration time is wrong. It is set at 18 seconds after Jan1, 1970. You will have to make adjustments to that.

 

OK.

I changed the expiration time=0

that means no expiration, but the EA do nothing.

 

I think you may have other problems with your EA. Did youcheck the logs and the journals to see if there are any comments that MT4 is generating?