Error opening SELL order:130

pepe

Active Trader
Apr 27, 2009
3
0
32
hello chaps,

I was just testing MACD EA scripts, but I'm getting error 130 all the time, is it becuase Im on demo version of LConnection MT4 platform ?

thanks in advance.

pepe
 

pepe

Active Trader
Apr 27, 2009
3
0
32
Thanks Enivid, But whats the nominal value to be used for takeprofit/stoploss if we executing the EA.
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,248
1,507
144
Odesa
www.earnforex.com
Thanks Enivid, But whats the nominal value to be used for takeprofit/stoploss if we executing the EA.
That depends on the EA, broker and the currency pair. I wouldn't recommend setting stop-loss or take-profit lower than 10 pips for EUR/USD. On the other hand if you trade with a broker with 6-digit quotes (like 1.30023 instead of 1.3002) you need to multiply your SL and TP by 10.
 

ethanlim

Trader
Jan 18, 2011
1
0
12
Hi, sorry I also having OrderSend error 130

Hopefully someone can help
Below is my code

void oo(string ord)
{
int error;
int limit = 2500;
int stop = 500;
int lot = 1;
int slip = 5;
string ea_comment = "";


if (ord=="Buy" )
{
ea_comment=ea_name+" Buy Order Number: "+order_count;
error=OrderSend(Symbol(),OP_BUY,lot,Bid,slip,NormalizeDouble(Ask-stop*Point,5),NormalizeDouble(Ask+limit*Point,5),ea_comment,1011);

}
else if (ord=="Sell")
{
ea_comment=ea_name+" Sell Order Number: "+order_count;
error=OrderSend(Symbol(),OP_SELL,lot,Ask,slip,NormalizeDouble(Bid+stop*Point,5),NormalizeDouble(Bid-limit*Point,5),ea_comment,1021);

}

if (error==-1) //operation failed
{
ShowERROR(error,0,0);
}


return;
}