Download MetaTrader 5

MQL4 and MetaTrader 4 - page 278

To post a new topic, please log in or register
//+----------------------------------------------------------------------+//| Delete Order function - If price closes above or below applicable MA |//+----------------------------------------------------------------------+void DeleteOrder()  {   for(int i=OrdersTotal()-1; i>=0; i--)      {      if(...
I have a situation with a broker's terminal where the broker will adjust the leverage on their end but it will not update visibly on the mt4 terminal.  So my indicators and ea will continue to show the old leverage.  I ended up re-logging in and then suddenly the indicators updated instantly with...
My sincere warning.  Or just  IMHO. Avoid. Siehe attached. H1 (does not matter, any interval as claimed),  signals lag, in opposite direction, missing, irrelevant. 
Hi everybody !   Got an "array out of range" issue, and i don't understand what's wrong. If someone could help it would just be perfect !   A big big thaaaaaaaaaaaaanks !    double MemTop2[];double MemTop3[];double MemTop4[];double MemTop5[];double BarMemTop1[];double BarMemTop2[];double...
Hey all, Having some troubles implementing a lots management strategy. I'm basically just wanting to implement a risk per trade. I have a simple RSI EA that I'm trying to add it to. Found a code that looked simple enough, but I'm getting Error 4051 - invalid lots amount for OrderSend function. Any...
Dear community, A EA that I have playing with uses the iADX function. When I debug I have: iADX (NULL, ADXTime, ADXPeriod, ADXPrice, MODE_PLUSDI, 0) i.e. value of current +DX always returns a value. iADX (NULL, ADXTime, ADXPeriod, ADXPrice, MODE_PLUSDI, 1) i.e. value of previous +DX always returns a...
I have an indicator that increases CPU usage over time. At first less than 5%, some hours later 10%, and one day later it's at 50%. Any idea of what is causing it?
EA: when I change inputs EA doesn't start 2014.09.16 09:57:47.235    ExpChannel EURUSD,M15: uninit reason 5 Someone else is experiencing the same issue?
Добрый день. Хотелось бы узнать есть ли ограничение по колличеству знаков в комментарии ордера. Программа считывает новый ордер и если надо к нему открыть серию следующих  то в   комментарий к этим ордерам записывается комментарий ордера плюс номер ордера к которому открывается серия. До...
Hi, having long time problem understanding why I cannot find order in loop when looking for OrderOpenPrice. I have temporarly solved the problem by adding open price to comment but this is not solid solution. Please suggest how to solve this. (In below code OrderComment() is commented out) void...
doesn't return open price for all position, it is only give me the price for first position, what can i do for make it give me open price for all position which Ticket (1) I hope it's clear if(OrderSelect(1,SELECT_BY_TICKET)==true)_OOP_1 = OrderOpenPrice();
Hi, having problem with loop, when part of main order is closed, loop misses to find existing order information and by believing there is no order code shoots to open new order. Code should find highest Buy order and remove part of the profit. Overall is there a better/safer way to code loops. I am...
  I need help (2)
Is it possible to earn with this? I am not sure this is spam or legit? If someone has some info about this he could reply. <link removed by moderator>
I can select last opened order using <decompiled code removed>. But I can't select first Ticket. I have tried more time but failed to do. Give me any suggestion please.
I know a bit of programming. Now,mql4 & mql5 use  same programming. So,I think I need learn about the OOP Programm.  But I can't find on the OOP documentation.I found MT4's own include file.     I think that these files are very useful. But can't the Document about these file. However,I have a...
Hey guys, Ive got a little problem with my mql4 script. I wanted to detect the market for special candlestick patterns. So I wrote a code with a specific condition(1). To keep it easy and short, Ive declared period[x] with all the different timeframes and witha specific chart symbol(2). To check...
What's wrong with this?,total = CountTrades(); if (total == 0) flag = TRUE; for (cnt = OrdersTotal() - 1; cnt >= 0; cnt--) { OrderSelect(0, SELECT_BY_POS); if (OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber) continue; if (OrderSymbol() == Symbol() &&...
I want to use time for stop entry order this is my code: int d =TimeDay(TimeCurrent()); int h=TimeHour(TimeCurrent()); if(OrdersHistoryTotal()>0){ for(int i=OrdersHistoryTotal(),i>0,i--)   {OrderSelect(Symbol(),h,MODE_HISTORY);       intD=TimeDay(OrderCloseTime());...
Hi, I recently realized that the clock of my vps is delayed by ~30 seconds per hour. After some searching I found the reason. Acc. to Einsteins's fomula ;) delay² = 1 / (1 - x²/c²); // c = speed of light, x = speed of the server-farm   ... // as one can see easilyx² = c² * ( 1-1/delay² )x  =...
1. It seems that, in automatic settings, an Expert Advisor is run tick by tick. In stock or futures applications, a tick typically means a trading order. However, the historical data are all based on Open-High-Low-Close prices (plus Volume) of a one-minute bar.  Does it mean that the minute bar...
I want to make changes to the attached indicator, but I have zero coding skills .... so, basically I always do such things with an trial-error approach ... I tried hard the last days, but all I managed to do, is to break the code ... so I am really stuck now ... What I want to have: #1 most...
I have a problem with the wrong sl and tp tester everything is working properly int OrdSend(string _symbol, int _cmd, double _volume, double _price, int _slippage, double _stoploss, double _takeprofit, string _comment="", int _magic=0, datetime _expiration=0, color _arrow_color=CLR_NONE) {//Send...
how to make new order in MT4 working again?
Hello I'm Trademenot, I  been studying & Training  on writing E.A.'s  Since Last December 2013. I back tested , now I'm Forward testing my E.A.'s Live  and I have 2 Demo Account's. If I log out of "Demo Account 1" by signing into "Demo Account 2"  & Each "Demo Account" is running a Different EA...
Hi fellow traders, One of my current projects has reached a state where i don't know how to progress. I simply don't know how to categorize an anti-grid like system. The system uses no indicator, and is based on the assumption that the market will not be sideways forever. The overall target is...
Hi all I would like to sort 8 global variables that are constantly updated. I have read ArraySort() fuction... but I can't figure it out. //////////////// GLOBAL VAR //////////////////////// int GV_TOTAL_ASSET_AUD = GlobalVariableGet("GV_TOTAL_ASSET_AUD"); int GV_TOTAL_ASSET_CAD =...
I'm having this dilemma of actually quantifying a strategy as accurately as possible. Speaking more precisely; if I back-test 12 different pairs and I wanted to build a simulated model of all those trades in chronological order to see what the equity curve over that time looked like; how would I go...
Hello, I need your help. I want that the ea open an order in the direction which the ea has give his signal but it doesent worked for any reason. Can someone help me?    The EA onTick void OnTick()  {if(check == false){   double Equity = AccountEquity();   Verlust = -Equity*RiskPercent*0.01;...
Hi everybody !   As u can see in the title, i need some help to convert a PRT code into MQL4 (indicator). It would be amazing if someone could help me !   The question is : Does this code is correct ? And secondly, why i couldn't display MemTop1[] variable ? I tried a lot of thing.... Thank you very...
Hi All: I have two questions:  1. When I apply an EA to a chart to run in real time, is it possible to extract the historical test trading result on the first run please?  For example, I want to have a logic that detect the previous trading winning percent, if the winning rate is lower than 30%, I...