Hi,
This error is for invalid stop error,
Check your StopLosses are not fit for stop pending orders.
Hi,
This error is for invalid stop error,
Check your StopLosses are not fit for stop pending orders.
Not getting could you please explain?
Trade Open Criteria:
- Buy Trade will be open immediately on start of current candle IF last candle's closing price was above EMA(EXPONENTIAL MOVING AVERAGE) (i.e: Close[1] > EMA).
- Sell Trade will be open immediately on start of current candle IF last candle's closing price was below EMA(EXPONENTIAL MOVING AVERAGE) (i.e: Close[1] < EMA).
Open Trade Price:
- Pending Buy Trade price will be 3 pips above of last candle's High (i.e: TradePriceOpen = High[1] + 3 pips).
- Pending Sell Trade price will be 3 pips below of last candle's Low (i.e: TradePriceOpen = Low[1] + 3 pips).
Stop Loss:
- SL will be 3 pips below of 2nd last candle's Low in Sell Stop Pending Order (i.e: SL = Low[2] - 3 pips).
- SL will be 3 pips above of 2nd last candle's High in Buy Stop Pending Order (i.e: SL = High[2] + 3 pips).
Take Profit:
- TP will be 10 pips below of the price where trade was opened in Sell Stop Pending Order (i.e: TP = TradePriceOpen - 10 pips).
- TP will be 10 pips above of the price where trade was opened in Buy Stop Pending Order (i.e: TP = TradePriceOpen + 10 pips).
Not getting could you please explain?
Open Trade Price:
- Pending Buy Trade will be open when last candle's closing price will be above EMA(EXPONENTIAL MOVING AVERAGE). Open trade price will be 3 pips above of last candle's High.
- Pending Sell Trade will be open when last candle's closing price will be below EMA. Open trade price will be 3 pips below of last candle's Low.
Stop Loss:
- SL will be 3 pips below of 2nd last candle's low in Sell Stop Pending Order
- SL will be 3 pips above of 2nd last candle's High in Buy Stop Pending Order
Take Profit:
- TP will be 10 pips below of the price where trade was opened in Sell Stop Pending Order
- TP will be 10 pips above of the price where trade was opened in Buy Stop Pending Order
It is possible that you are trying to place a pending order too close to the current price. Either you set the SL or TP values incorrectly. To check, using the Print() function before sending a trade order, output the value of the current price and the order setting price, as well as the price of SL and TP, to the log.
Set TakeProfit and StopLoss need within a minimum level SYMBOL_TRADE_STOPS_LEVEL.
BuyLimit и BuyStop | SellLimit и SellStop |
---|---|
TakeProfit - Order open price >= SYMBOL_TRADE_STOPS_LEVEL Order open price - StopLoss >= SYMBOL_TRADE_STOPS_LEVEL | Order open price - TakeProfit >= SYMBOL_TRADE_STOPS_LEVEL StopLoss - Order open price >= SYMBOL_TRADE_STOPS_LEVEL |
It is possible that you are trying to place a pending order too close to the current price. Either you set the SL or TP values incorrectly. To check, using the Print() function before sending a trade order, output the value of the current price and the order setting price, as well as the price of SL and TP, to the log.
What is the minimum requirement of SL and TP? I mean how far from market price I'll be able to place a pending order?
What is the minimum requirement of SL and TP? I mean how many pips far i could place a pending order?
SYMBOL_TRADE_STOPS_LEVEL | Minimal indention in points from the current close price to place Stop orders | int |
https://www.mql5.com/en/docs/constants/environment_state/marketinfoconstants
If this value is zero and the error persists then I usually use a minimum average spread size multiplied by two.
- www.mql5.com
It is possible that you are trying to place a pending order too close to the current price. Either you set the SL or TP values incorrectly. To check, using the Print() function before sending a trade order, output the value of the current price and the order setting price, as well as the price of SL and TP, to the log.
Set TakeProfit and StopLoss need within a minimum level SYMBOL_TRADE_STOPS_LEVEL.
BuyLimit и BuyStop | SellLimit и SellStop |
---|---|
TakeProfit - Order open price >= SYMBOL_TRADE_STOPS_LEVEL Order open price - StopLoss >= SYMBOL_TRADE_STOPS_LEVEL | Order open price - TakeProfit >= SYMBOL_TRADE_STOPS_LEVEL StopLoss - Order open price >= SYMBOL_TRADE_STOPS_LEVEL |
Still not getting you could you show me a code with dummy market values to understand it better. Also guide me when I am debugging my EA I am not able to see my logs where could I see my logs while debuging?
SYMBOL_TRADE_STOPS_LEVEL | Minimal indention in points from the current close price to place Stop orders | int |
https://www.mql5.com/en/docs/constants/environment_state/marketinfoconstants
If this value is zero and the error persists then I usually use a minimum average spread size multiplied by two.
Currently Market info:
Bid = 1.1368
Ask = 1.1369800000000001
Ticket1 = OrderSend(Symbol(),OP_SELLSTOP,1,1.1364099999999999,3,1.13731,1.13541,"Pending Sell Order 1",16384,0,clrGreen);
long ex = SymbolInfoInteger(Symbol(), SYMBOL_TRADE_STOPS_LEVEL);
ex is 8
Could you explain now where is problem?
Currently Market info:
Bid = 1.1368
Ask = 1.1369800000000001
Ticket1 = OrderSend(Symbol(),OP_SELLSTOP,1,1.1364099999999999,3,1.13731,1.13541,"Pending Sell Order 1",16384,0,clrGreen);
long ex = SymbolInfoInteger(Symbol(), SYMBOL_TRADE_STOPS_LEVEL);
ex is 8
Could you explain now where is problem?
You need to normalize the order opening price, as well as SL and TP. To do this, use the function NormalizeDouble(Price,Digits()); where is Price, the price you want to normalize.
You need to normalize the order opening price, as well as SL and TP. To do this, use the function NormalizeDouble(Price,Digits()); where is Price, the price you want to normalize.
StopLossSell = NormalizeDouble(1.13761 - ((3 * 10) * Point), 5); Price = NormalizeDouble(1.1367100000000001 - ((3 * 10) * Point), 5); TpOrderOne = NormalizeDouble(1.13561 - ((10 * 10) * Point), 5); long ex = SymbolInfoInteger(Symbol(), SYMBOL_TRADE_STOPS_LEVEL); // Getting 8 Ticket1 = OrderSend(Symbol(), OP_SELLSTOP, 1,1.13561, 3, 1.13731, 1.13541, "Pending Sell Order 1", 16384, 0, clrGreen);
Already doing normalize all values
Already doing normalize all values
If the error persists, check that the SL and TP are not closer than SYMBOL_TRADE_STOPS_LEVEL.
Also, the order opening price should not be closer than MarketInfo (Symbol(), MODE_STOPLEVEL) to сurrent price.
If MarketInfo (Symbol (), MODE_STOPLEVEL) is equal to zero, then this value is floating and it is necessary to use an offset from the current price of at least two spreads.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
I am getting Error:
EURUSD,H4: OrderSend failed with error #130
Experts Please guide where I am making mistake?