Error 4051 Mt4
Contents |
or register 3 tonkament 2011.03.07 01:14 Hey everyone, I am trying mql4 error 4108 to run my first backtest through MT4 on the mql4 error 4109 Alpari (US) system. The problem seems to be that Alpari is a 5-digit broker error 4107 mql4 and the EA source material that I am testing from TradingSystemForex seems to have been developed for 4 digit brokers. Could anyone guide me
Mql4 Error Codes
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 string separator1="---------------- Entry Settings"; extern int mql4 error 130 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 MaxOrders=100; //maximum number of orders extern bool MAFilter=false; //moving average filter extern int
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 1 8 replies Help with error in code on a indicator 8 replies Platform Tech / Reply to Thread mql4 error 4073 Subscribe 1 Attachments: Error code 4051 Exit Attachments Error code 4051 Post #1 Quote First Post: Jun 24,
Mql4 Error Code 5004
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
Mql4 Ordersend Error 130
the online MT4 library 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 https://forum.mql4.com/39378 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 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 http://www.forexfactory.com/showthread.php?p=5825157 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: Member | 222 Posts Well I am no programmer and I am new to this but I will try to find spot with the relevant code. Otherwise since mine is a commercial ea (oh I emailed them a week ago and no answer), I can pm it to you and if you could take a look I would be estatic. right now I just can't use it. 1 tick and I will post what I think is the relevant code Post #5 Quote Jun 30, 2009 8:56pm Jun 30, 2009 8:56pm sergiu | Joined May 2006 | Status: Least Qualified Poster | 444 Posts If i understand corectly the error is the result of one of the fun
and Ordermodify function error 4051 and 4018. Can anybody help me to solve this ? here https://www.forex-tsd.com/forum/debates-discussions/12518-ordermodify-error is the code : //Buy if (Order == SIGNAL_BUY && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) { if(!IsTrade) { //Check free margin if (AccountFreeMargin() http://okozukai.mgilab.com/blog/index.php?UID=1219117623 < (1000 * Lots)) { Print("We have no money. Free Margin = ", AccountFreeMargin()); return(0); } Ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, 0, 0, 0, "Buy(#" mql4 error + MagicNumber + ")", MagicNumber, 0, DodgerBlue); OrderSelect(Ticket, SELECT_BY_TICKET,MODE_TRADES); OrderModify(OrderTicket(),OrderOpenPrice(), Bid - (SL*Point),Bid +(TP*Point),0,Red); if(Ticket > 0) { if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) { Print("BUY order opened : ", OrderOpenPrice()); if (SignalMail) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(Ask, Digits) + " Open Buy"); } else { Print("Error opening BUY mql4 error code order : ", GetLastError()); } } if (EachTickMode) TickCheck = True; if (!EachTickMode) BarCount = Bars; return(0); } } //Sell if (Order == SIGNAL_SELL && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) { if(!IsTrade) { //Check free margin if (AccountFreeMargin() < (1000 * Lots)) { Print("We have no money. Free Margin = ", AccountFreeMargin()); return(0); } Ticket = OrderSend(Symbol(), OP_SELL, Lots, Bid, Slippage, StopLossLevel, TakeProfitLevel, "Sell(#" + MagicNumber + ")", MagicNumber, 0, DeepPink); OrderSelect(Ticket, SELECT_BY_TICKET,MODE_TRADES); OrderModify(OrderTicket(),OrderOpenPrice(),Ask +(SL*Point), Ask -(TP*Point),0,Green); if(Ticket > 0) { if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) { Print("SELL order opened : ", OrderOpenPrice()); if (SignalMail) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(Bid, Digits) + " Open Sell"); } else { Print("Error opening SELL order : ", GetLastError()); } } if (EachTickMode) TickCheck = True; if (!EachTickMode) BarCount = Bars; return(0); } } if (!EachTickMode) BarCount = Bars; return(0); } Bongo Join date: 2005.10.28 Private message 2010.06.30 #2 I'm using th