Hi!
I'm starting with MQL4 programming and I've come across a problem. To reduce the problem, I've made a simple EA, with only 1 lines in the start() function:
OrderSend (Symbol(), OP_SELL, 0.1, Bid, 3, Bid+(Point*50), Bid-(Point*50));
It should place a market order every time there is a new tick, right?
Well, it doesn't; I keep getting error 130, Invalid stops all the time.
Another sentence:
OrderSend(Symbol(),OP_BUY,0.1,Ask,3,Bid-(Point*100),Bid+(Point*100));
is always giving error 130. Stops are not tight at all, as it's 100 pips (I've tried 50, and other values, with the same result).
I've even pasted an OrderSend sentence from one of the example EA's of MetaTrader, and it gets the 130 as well !!
What can be the problem? I don't know what else I can do!
I see two problem if your broker is using 5 digits. Your want 100 pips and slippage of 3 pips.
double pips2dbl = Point, pips2points=1;
if (Digits == 3 || Digits == 5) {pips2dbl *= 10.0; pips2points*=10;}
OrderSend(Symbol(),OP_BUY,0.1,Ask,3*pips2points,Bid-(pips2dbl*100),Bid+(pips2dbl*100));
completando con Zeros, lo solucione!
I think the slip is too small!
change 3 to 30,and try.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi!
I'm starting with MQL4 programming and I've come across a problem. To reduce the problem, I've made a simple EA, with only 1 lines in the start() function:
OrderSend (Symbol(), OP_SELL, 0.1, Bid, 3, Bid+(Point*50), Bid-(Point*50));
It should place a market order every time there is a new tick, right?
Well, it doesn't; I keep getting error 130, Invalid stops all the time.
Another sentence:
OrderSend(Symbol(),OP_BUY,0.1,Ask,3,Bid-(Point*100),Bid+(Point*100));
is always giving error 130. Stops are not tight at all, as it's 100 pips (I've tried 50, and other values, with the same result).
I've even pasted an OrderSend sentence from one of the example EA's of MetaTrader, and it gets the 130 as well !!
What can be the problem? I don't know what else I can do!