Shadow,
First of all, you should understand the 130 error:
"At placing of a pending order, the open price cannot be too close to the market. The minimal distance of the pending price from the current market one in points can be obtained using the MarketInfo() function with the MODE_STOPLEVEL parameter. In case of false open price of a pending order, the error 130 (ERR_INVALID_STOPS) will be generated." ( https://docs.mql4.com/trading/OrderSend )
Good Luck!
First of all, you should understand the 130 error:
"At placing of a pending order, the open price cannot be too close to the market. The minimal distance of the pending price from the current market one in points can be obtained using the MarketInfo() function with the MODE_STOPLEVEL parameter. In case of false open price of a pending order, the error 130 (ERR_INVALID_STOPS) will be generated." ( https://docs.mql4.com/trading/OrderSend )
Good Luck!
You can not put pending order closer then MarketInfo(Symbol(),MODE_LOTSTEP) points to current price (Ask, Bid).

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
can someone help, nead to change the normal buy order to buystop, but keep on getting a 130 error
if(LastBar == 1)
{
ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, 5, Ask - StopLoss * Point,
Ask + TakeProfit*Point, "BuyStop", 12345, 0, Green); prtAlert("EUR/USD: Buying");
if(ticket > 0)
{
if(OrderSelect(ticket, SELECT_BY_TICKET, MODE_TRADES))
Print("BUYSTOP order opened : ", OrderOpenPrice());
}
else
{
Print("Error opening BUYSTOP order : ", GetLastError());
if (EachTickMode) TickCheck = True;
if (!EachTickMode) BarCount = Bars;
return(0);
}
}