Mql4 Ordersend Error 4051
Contents |
or register 3 tonkament 2011.03.07 01:14 Hey everyone, I
Mql4 Error Codes
am trying to run my first backtest through MT4 mql4 error 4051 on the Alpari (US) system. The problem seems to be that Alpari is
Mql4 Error 130
a 5-digit broker and the EA source material that I am testing from TradingSystemForex seems to have been developed for 4 digit brokers. mql4 error 4109 Could anyone guide me in the right direction for adjusting this EA? Thanks. //+------------------------------------------------------------------+ //|FastSlow MA RSI MACD EA.mq4 | //|Copyright © 2008, TradingSytemForex | //|http://www.tradingsystemforex.com | //+------------------------------------------------------------------+ #property copyright "Copyright © 2008, TradingSytemForex" #property link "http://www.tradingsystemforex.com" #define eaN "FastSlow MA RSI MACD EA" extern mql4 error 4073 string separator1="---------------- Entry Settings"; extern int FastEMA=5; extern int SlowEMA=15; extern int MACDSMA=1; extern int FastMAPeriod=10; extern int FastMAMethod=1; extern int SlowMAPeriod=20; extern int SlowMAMethod=1; extern int RSIPeriod=21; extern int RSIUpLevel=50; extern int RSIDnLevel=50; extern string separator2="---------------- Lot Management"; extern double Lots=0.1; extern bool RiskManagement=false; //money management extern double Risk=10; //risk in percentage extern bool Martingale=false; //martingale extern double Multiplier=1.5; //multiplier extern double MinProfit=0; //minimum profit to apply the martingale extern string separator3="---------------- TP SL TS BE"; bool EnableRealSL=false; int RealSL=5; //stop loss under 15 pîps bool EnableRealTP=false; int RealTP=10; //take profit under 10 pîps extern int StopLoss=0; //stop loss extern int TakeProfit=0; //take profit extern int TrailingStop=0; //trailing stop int TSStep=1; //trailing step extern int BreakEven=0; //breakeven extern string separator4="---------------- Extras"; extern bool Reverse=false; extern bool AddPositions=false; //positions cumulated extern int MaxOr
Page Last Post Printable Version Similar Threads Help With Understanding Error Code(s) in MT4 8 replies Help with EA - Code Error 7 replies Help with "OrderSend error 4051" 12 replies OrderModify - Error code
Mql4 Error Code 5004
1 8 replies Help with error in code on a indicator 8 replies mql4 ordersend error 130 Platform Tech / Reply to Thread Subscribe 1 Attachments: Error code 4051 Exit Attachments Error code 4051 Post #1 Quote
Mql4 Error 129
First Post: Jun 24, 2009 9:17pm Jun 24, 2009 9:17pm einstr | Joined May 2009 | Status: Member | 11 Posts hello, I have downloaded the divergence trader EA from the online MT4 library https://forum.mql4.com/39378 and have been optimizing it and testing it in a demo acct for about three weeks. It appears to be working quite well but now each time I switch to the live account, I get an error: "order 0 failed to close. error: 4051" that occurs in an alert window. I get this alert about every 20 seconds. It actually caused other orders that I had open http://www.forexfactory.com/showthread.php?p=5825157 at the time to close immediately upon the alert. Could you please help me to find out what the issue is? Thanks. Rich Post #2 Quote Jun 30, 2009 7:39pm Jun 30, 2009 7:39pm asgard2 | Joined Jun 2009 | Status: Member | 222 Posts I also get this message and depending which broker as to how often I get it. The error occurs in many ea's and right now alpari is my broker and so far they are the best. My trades also close all at once but not straight away, maybe 30 minutes later or not at all. Additionally if error is not picked up, the failed orders run from profit to debit and I get a margin call as orders open and dont close. Any help would be greatly appreciated. Post #3 Quote Jun 30, 2009 8:01pm Jun 30, 2009 8:01pm sergiu | Joined May 2006 | Status: Least Qualified Poster | 444 Posts It would be difficult to say much without seeing the code but error 4051 is an "invalid function parameter value" error. Stubbornly persistent Post #4 Quote Jun 30, 2009 8:34pm Jun 30, 2009 8:34pm asgard2 | Joined Jun 2009 | Status: Membe
Javascript Disabled Detected You currently have javascript disabled. Several functions may not work. Please re-enable javascript to access full functionality. 4051 Metatrader error invalid lots amount for order send function Started by Brainyforex, Feb 20 2015 06:55 AM http://www.strategyquant.com/forum/topic/2868-4051-metatrader-error-invalid-lots-amount-for-order-send-function/ 4051 metatrader error invalid lots amount order send function Please log in to reply 2 replies to this topic #1 Brainyforex Brainyforex Newbie Members 8 posts LocationAugusta, Western Australia Posted 20 February 2015 - 06:55 AM Hello http://www.forex.es/donde-esta-error-4051-t8370.html Been running strategyquant created ea on live account but notice sometimes get error message on metatrader terminal. (running ea on 2 different brokers live accounts). Both accounts get this message at the same time and on the mql4 error same currency pair : Order failed error : 4051 Invalid lots amount for order send function. The ea is programmed to open a set lot amount of 0.01 lots. Does anyone know why this error message comes up sometimes and does not open position? Regards Fritz Back to top Report #2 Mark Fric Mark Fric Administrator Administrators 2,896 posts Posted 20 February 2015 - 01:21 PM hm, this error means incorrect parameter was used. Can mql4 ordersend error you check in the journal what is the order size it is trying to open? Does it happen only sometimes and other times the orders are opened correctly? I cannot say what could cause this now, without knowing more details. Mark StrategyQuant architect Back to top Report #3 Brainyforex Brainyforex Newbie Members 8 posts LocationAugusta, Western Australia Posted 20 March 2015 - 04:20 AM Hi Mark Yes, it only happens sometimes. Most of the time it's fine. I have the ea programmed to only open orders with the minimum lot size of 0.01 lots for any order. I could not see any details in the journal where it provides any information about the lot size it is trying to open. It seems that when 4 or 5 orders are already opened it does not want to open any more? But I have not programmed this into the ea. I have not included a maximum number of orders allowed but it seems this may be the problem? I also open 2 orders at the same time (using different trailing stops) but I don't think this could be the problem? or maybe it could be?? Regards Fritz Back to top Report Back to Application Support 3 user(s) are reading this topic 0 members, 3 guests, 0 anonymous users Reply to quoted postsCle
Registrarse Identificarse Donde está el error? (4051) Espacio para todo lo relacionado con Metatrader: indicadores, EAs, scripts, programación, etc. Publicar una respuesta 9 mensajes • Página 1 de 2 • 1, 2 Responder citando Donde está el error? (4051) por trader201 » 19 Jun 2014, 17:03 Saludos. Aprendiendo mql4 de nuevo, al darle testear a este código me sale en el diario "error 4051". Busqué el error 4051: Invalid function parameter value (Valor del parámetro de función no válido), mas cuando comienzo a escribir el indicador, aparece un cuadro con el orden de los valores que debo colocar. Aparentemente el error está aquí:TEND1= iADX(NULL,14,PERIOD_CURRENT,PRICE_CLOSE, MODE_PLUSDI,1);TEND2= iADX(NULL,14,PERIOD_CURRENT,PRICE_CLOSE, MODE_PLUSDI,2);(Mas abajo de esto, los valores que debo colocar en el iATR). Aparentemente donde estoy colocando "14", debo colocar este valor como parte de una constante en el lenguaje mql4. ¿Alguien sabe cómo colocarlo?double iADX( string symbol, // symbol int timeframe, // timeframe int period, // averaging period int applied_price, // applied price int mode, // line index int shift // shift );Aquí el código por sia:void OnTick() { double TEND1, TEND2; TEND1= iADX(NULL,14,PERIOD_CURRENT,PRICE_CLOSE, MODE_PLUSDI,1); TEND2= iADX(NULL,14,PERIOD_CURRENT,PRICE_CLOSE, MODE_PLUSDI,2); //--- if (OrdersTotal()==0 && TEND1>TEND2) { int ticket=OrderSend(Symbol(),OP_BUY,0.01, Ask, 10, Ask-500*Point, Ask+500*Point, NULL, 0, 0, clrNONE); } Print("error", GetLastError()); }//+------------------------------------------------------------------+ trader201 Mensajes: 281Registrado: 13 Feb 2010, 21:05 Karma: 0 Arriba Responder citando Re: Donde está el error? (4051) por trader201 » 19 Jun 2014, 20:01 Listo La forma correcta es esta:TEND1= iADX(NULL,PERIOD_M15,14,PRICE_CLOSE, MODE_PLUSDI,1);El problema estaba en el lotaje que estaba colocando (0.01), aunque no se por que no me permite colocar este monto pues mi broker permite operarlo. A menos sea que no así para EAs?... (Alpari uk). ¿Alguien sabe si esto es así? trader201 Mensajes: 281Registrado: 13 Feb 2010, 21:05 Karma: 0 Arriba Responder citando Re: Donde está el error? (4051) por FXWizard » 20 Jun 2014, 11:53 Hola trader201, ¿qué tipo de cuenta operas? Quizás la demo sea de una cuenta Pro, en cuyo caso el mínimo son 0.10 si no recuerdo mal.Saludos,FXWizard FXWizard Mensajes: 7528Registrado: 12 Feb 2008, 15:17 Karma: 29 Arriba Responder citando Re: Donde está el error? (4051) por trader201 » 20 Jun 2014, 21:20