Hi,
You need to validate "STOPLEVEL" for the current symbol, "STOPLEVEL" is minimal stop level (in points) for orders.
// Print("Stop level in points=",MarketInfo(Symbol(),MODE_STOPLEVEL)); //PS: Please, use the code button (Alt+S) when sharing code in forum
- Please edit your (original) post and use the CODE
button (Alt-S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Messages Editor - Check your return codes for errors, and report them including GLE/LE. Don't look at it unless you have an error. Don't just silence the
compiler, it is trying to help you.
What are Function return values ? How do I use them ? - MQL4 programming forum
Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articlesint buyticket=OrderSend("EURUSD",OP_BUY,0.01,Ask,10,0,0,"my 1st order!"); if(OrderSelect(buyticket,SELECT_BY_TICKET))
You try to print GLE but you've already lost it when you do the select. Check immediately. - You calculate your stops but if there is any slippage, they are bogus. Either compute them using OrderOpenPrice()
and modify, or just include them with the
OrderSend. There is no need to open an order and then set the stops. Simplify your code - do it in one step. TP/SL on OrderSend
has been fine for years.
Build 500 № 9 2013.05.09
Need help me mql4 guru add take profit to this EA - Take Profit - MQL4 programming forum 2017.09.27 - In any case, 10 point stops may be the problem. You can't move stops (or pending prices) closer to the market than the minimum: MODE_STOPLEVEL *
_Point or SymbolInfoInteger(SYMBOL_TRADE_STOPS_LEVEL).
Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial
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
Hello
when I execute the EA, the buy order is created but the error 130 message(invalid stop loss) is displayed for the function ordermodify ()?
I used ordermodify() function beceause in my broker I can't created makret or pending order with stop loss and takeprofit levels.
/+------------------------------------------------------------------+