Mql4 Error 130 Ordermodify
Contents |
15:15 hello. I've just upgraded from MT4 build201 to MT4 build207. an EA of mine that ordermodify error 1 used to work just fine with build201 has begun to ordermodify error 130 give me repeated error messages: ordermodify error 130. I didn't do any modification to the EA,
Mql4 Ordersend Error 130
and the same EA when switched back to build201 worked with no error message. below is the related function that has been causing the error message. (the
Mql4 Error Codes
newSL variable is normalized). this code is very simple and straightforward. I checked again and again but just couldn't figure out what's causing the error messages. could someone please shed some light on this? int ModifySL(double newSL) { //---- int i,total,tries; //---- total = OrdersTotal(); //---- for(i=total;i>=0;i--){ if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES)){ if(OrderType()==OP_BUY && OrderSymbol()==Symbol() error 130 mql4 && OrderMagicNumber()==magic_base){ if(newSL>0.0 && (OrderStopLoss()<=0. 0 || OrderStopLoss()
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
Ordersend Error 4107
the company Business Learn more about hiring developers or posting ads with us Stack Overflow mode_stoplevel Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of ordersend error 131 6.2 million programmers, just like you, helping 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 https://forum.mql4.com/7573 I keep Error modifying order!, error#130. I'm using an ECN 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 http://stackoverflow.com/questions/27240934/modifying-order-returns-error-130 - ( stoploss * pipdigits ); ticket = OrderSend( Symbol(), OP_SELL, lotsize, Ask, 100, 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 exam
Page Last Post Printable Version Similar Threads EA error message (0) no error 6 replies Fixing CCI histogram in my EA 6 replies Need help fixing this indicator 1 reply http://www.forexfactory.com/showthread.php?t=411201 MT4 EA error- when placing trade getting error 0 rate on ask 3 replies ATR indicator needs fixing 2 replies Platform Tech / Reply to Thread Subscribe Fixing Error 130 - http://www.expert-advisor.com/forum/metatrader-4/programmierung-mql4/1555-ordermodify-error-130-orderclose-error-138-a.html MT4 Post #1 Quote First Post: Feb 19, 2013 11:47am Feb 19, 2013 11:47am trumpjr | Joined Feb 2010 | Status: Member | 15 Posts I am receiving error 130 when error 1 I run my EA. Below is the code for buying: Inserted Code ticket=OrderSend(Symbol(),OP_BUYSTOP,Lots,HighBar1+BuySellBuffer*PointFive,3,0,0,"My EA",12345,0,Green); if(ticket>0) { if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice()); OrderModify(OrderTicket(),OrderOpenPrice(),HighBar1-HighMinusLow-(StopBuffer*PointFive),HighBar1+TakeProfit2,0,Green); } else Print("Error opening SELL order : ",GetLastError()); return(0); The reason I am getting error 130 is that this places a buy stop two pips above the previous bar. When a candle closes near the high is when I ordermodify error 1 get this error and sometimes the order never fills. Any ideas on how I could make this work when this happens? Post #2 Quote Feb 19, 2013 12:34pm Feb 19, 2013 12:34pm fxtr51 Joined Jan 2010 | Status: Member | 1,163 Posts If you insert "error 130 mt4" into google, you will get more than 60.000 hits. I picked 2 : http://thetrademachine.com/blog/2010...d-stops-error/ http://www.earnforex.com/blog/2008/1...30-what-to-do/ Post #3 Quote Feb 19, 2013 12:39pm Feb 19, 2013 12:39pm trumpjr | Joined Feb 2010 | Status: Member | 15 Posts These are not solutions to the problem. I understand what the problem is, I don't know how to code it to resolve it. I get error 130 because of the fact that my open price on my buy stop is to close to my current price. If the price continues to go up will never get filled. What I'm wondering is there a way to increase the open price by X amount when this happens until it gets filled? Post #4 Quote Edited at 3:08pm Feb 19, 2013 2:17pm | Edited at 3:08pm fxtr51 Joined Jan 2010 | Stat
Community Kalender Heutige Beiträge Suchen Programmierung MQL4 Hier gehts rund ums Programmieren in MQL4. Community Links Benutzerliste Foren durchsuchen Zeige Themen Zeige Beiträge Stichwortsuche Erweiterte Suche Gehe zu... Navigation Startseite Forum Linkverzeichnis Portalsuche Seiten Linkverzeichnis Forum [ Erweiterte Suche ] Forenübersicht Allgemeines zum Forum• Vorstellung Mitglieder• Verbesserungsvorschläge• Aktuelle Hinweise Metatrader 4• Allgemeine Fragen• Indikatoren• Expert-Advisors• Skripte• Tools• Programmierung MQL4 Metatrader 5• Allgemeine Fragen• Indikatoren• Expert-Advisors• Skripte• Tools• Programmierung MQL5 Sonstiges• Broker• Signaldienste• Managed Accounts• Technik• Kleinanzeigen• Offtopic Forex• Allgemeines• Grundlagen• Strategien• Daytrading• Swingtrading EA Entwicklung• Expert-Advisor 1 Werbung Login Benutzername: Kennwort: Angemeldet bleiben? Statistik Themen: 3275 Beiträge: 33385 Benutzer: 5.285 Aktive Benutzer: 620 Links: 79 Wir begrüßen unseren neuesten Benutzer: FroOoP Mit 483 Benutzern waren die meisten Benutzer gleichzeitig online (21.04.16 um 17:12). Neue Benutzer: vor 7 Stunden - FroOoPvor 8 Stunden - chupamelavor 12 Stunden - wako58vor 22 Stunden - Korayvor einem Tag - Lappi115 Onlineuser Benutzer: 6 Gäste: 55 Gesamt: 61 Team: 0 Team: Benutzer: fxnoob, hex, marquez, ralfbenker, traderdoc, Tylex1 Freunde anzeigen Empfehlungen Werbung Themen-Optionen Thema durchsuchen Ansicht #1 (permalink) 27.08.11 Sandreal Neues Mitglied Registriert seit: Aug 2011 Beiträge: 25 OrderModify Error 130, OrderClose Error 138 Hallo allerseits, ich bin gerade dabei meinen ersten ganz einfachen EA zu programmieren und werde mit OrderModify Errors 130 und OrderClose Errors 138 zugespamt.^^ Verbringe heute schon den ganzen Tag damit, heraus zu finden, wo die Probleme sind, komme aber einfach nicht drauf. Kann mir jemand weiterhelfen? Grüße Sandreal Angehängte Dateien SMA Cross Trailing Stop.mq4 (5,4 KB, 19x aufgerufen) #2 (permalink) 28.08.11 Racki Mitglied Registriert seit: Apr 2011 Ort: Osnabrück Beiträge: 103 Wenn ich das recht im Hinterkopf habe, bedeutet 130 das der SL & TP nicht weit genug auseinander sind. 138 müsste aufkommen, wenn du zu den falschen Preisen kaufen willst. OP_BUY wird zu Ask geöffnet und zu Bid geschlossen. Deinen Quelltext habe ich mir nun aber nicht angesehen s.l. Racki #3 (p