Mql4 Order Modify Error 130
Contents |
and Rules for Making Trades Opening and Placing Orders Closing and Deleting Orders Modification of Orders Upgrade to MetaTrader 5 Book in One File Download it ordermodify error 1 - 2 Mb Modification of Orders MQL4 allows you to modify mql4 ordersend error 130 market and pending orders. Orders are modified according to the rules described in Order Characteristics and in Appendix mql4 error codes 3. Function OrderModify() Trade requests for modifying of market and pending orders are formed using the function OrderModify(). bool OrderModify(int ticket, double price, double stoploss, double takeprofit, datetime
Error 130 Mql4
expiration, color arrow_color=CLR_NONE) The function modifies the parameters of market and pending orders. The function returns TRUE, if the trade is made successfully. Otherwise, it returns FALSE. Parameters: ticket - the unique number of the order. price - the newly requested price of a pending order or the new open price for a market order. stoploss - the ordersend error 4107 new value of StopLoss. takeprofit - the new value of TakeProfit. expiration - the expiration time of a pending order. arrow_color - the color of arrows for modifying of StopLoss and/or TakeProfit in the chart. If this parameter is unavailable or its value is equal to that of CLR_NONE, the arrows will not be displayed in the chart. Note: You can change open price and expiration only for pending orders. If you pass unchanged values as the function parameters, the terminal will generate error 1 (ERR_NO_RESULT). There can be a limitation set for application of expiration time to pending orders on some trade servers. In this case, if you try to create a non-zero value in the parameters of expiration, error 147 (ERR_TRADE_EXPIRATION_DENIED) will be generated. Modification of Market Orders A standard market order contains two stop orders - StopLoss and TakeProfit. They instruct to close the order at the requested prices in order to stop losses and fix profits. Modification of market orders may be useful for changing of the
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more mode_stoplevel about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users
Ordersend Error 131
Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping
Ordersend Error 138
each other. Join them; it only takes a minute: Sign up Modifying order returns error 130 up vote 1 down vote favorite I'm trying to modify an order, but I keep Error modifying order!, error#130. I'm using an ECN https://book.mql4.com/trading/ordermodify broker, so I need to modify the order to set a stoploss/takeprofit. What I am doing wrong? int digits = MarketInfo( Symbol(), MODE_DIGITS ); if ( digits == 2 || digits == 3 ) pipdigits = 0.01; else if ( digits == 4 || digits == 5 ) pipdigits = 0.0001; selltakeprofit = Ask + ( takeprofit * pipdigits ); sellstoploss = Ask - ( stoploss * pipdigits ); ticket = OrderSend( Symbol(), OP_SELL, lotsize, Ask, 100, http://stackoverflow.com/questions/27240934/modifying-order-returns-error-130 0, 0, 0, 0, 0, CLR_NONE ); if ( ticket < 0 ) { Print( "venda Order send failed with error #", GetLastError() ); Print( "stop loss = ", sellstoploss ); } else { Print( "Order send sucesso!!" ); Print( "Balance = ", AccountBalance() ); Print( "Equity = ", AccountEquity() ); bool res = OrderModify( ticket, 0, sellstoploss, selltakeprofit, 0 ); if ( res == false ) { Print( "Error modifying order!, error#", GetLastError() ); Print( "sellstoploss ", sellstoploss ); Print( "selltakeprofit ", selltakeprofit ); Print( "StopLevel ", StopLevel ); Print( "Ask ", Ask ); } else { Print( "Order modified successfully" ); } } mql mql4 share|improve this question edited Dec 13 '14 at 18:39 user3666197 7,85721330 asked Dec 2 '14 at 2:33 Filipe Ferminiano 1,14722046 add a comment| 2 Answers 2 active oldest votes up vote 1 down vote accepted Error #130 is ERR_INVALID_STOPS. The most likely problem is that a) the stoploss level you are inputting is too close to the order open price. This is dictated by MarketInfo( Symbol(), MODE_STOPLEVEL ) // returns a min allowed distance [pts] else b) because you have not normalized the stoploss level with NormalizeDouble(). See below for a buy order example. In your example, i.e. for a sell order, note that you should be opening the order at the Bid price, not Ask as you have. Note also that
log in or register Use MQL5 Cloud Network. Test robots at a super speed! 114347 Forex Trader 2007.09.08 02:11 I am repeatedly receiving "OrderModify Error https://www.mql5.com/en/forum/46843 130" in the Strategy Tester journal and cannot resolve it. I believe it has something to do with the trailing stops that are being placed in the code below: if(OrderType()==OP_BUY) // long position is opened { // check for trailing stop if(TrailingStop>0) { if(Bid-OrderOpenPrice()>Point*TrailingStop) { if(OrderStopLoss()