Download MetaTrader 5

MQL4 and MetaTrader 4 - page 201

To post a new topic, please log in or register
I have a broker that uses symbols like GBPUSD. and EURUSD. How do I get MarketInfo on them?
  Rollover Time (2)
Hi, I would like to know the rollover-time in the timezone of the server I'm connected to. Is there a function to call which will return the rollover-time? What I'm trying to do is to close any open position x minutes before the rollover.   Thanks in advance for replying (I'm pretty new to mql4!)...
Hi all:   I write a simple code to catch the new created object on the chart.   void OnChartEvent(const int id,                  const long &lparam,                  const double &dparam,                  const string &sparam){      Print("id = ",id );//--- the object has been deleted...
Hello everyone I'm new to this forum, I don't know if this is the right place to ask for help. The objects, indicators, etc, that I draw or insert in one time frame don't show on the other time frame charts (of the same pairs of course) so I have to do it manually which consumes too much time, it's...
Hi, I have added a scroll (CScrollV, Controls\Scrolls.mqh) control to the basic active control panel example in the mql4 includes library. I have been playing around with active panels for several weeks now and have even programmed a very detailed panel, but I cannot get the scroll control to work....
I thought I'd delete the EA and reinstall it because it was timing out on the Strategy Tester. It's still in the EA folder, and I refresh where it says Expert Advosors... nothing. I even re-installed MT4. Nothing. Need helpe please. Thanksl
Hi friends, I'm writing an expert advisor, Can anyone help me what is the easiest way to prevent OnTick Function from placing orders repeatedly.  I have some ideas in my mind but I think there would be easier ways to stop expert advisor from placing an order repeatedly in OnTick function and instead...
You can customize with ATR MA? ATR (14) 0.0023-->MA (14)0.0019...
  Comment field (1)
One can enter a comment when the order is created. Is there a way to modify the OrderComment() field in the order ? I would like to store a trailing stoploss in that field. That way my stoploss goes under the radar.
Hi, please help me, I am confused: I try to make a custom indicator based on MACD. If the MACD gives a long signal, my custom indicator gets green histogram, at short signal get red color. Everything is working except the color changing. I tried this code to change indicator color: if (macd_line[i]...
  Multitrader (1)
hi, please can tell me who comes mt4 multitrader?
Hello, when i include a dll in EA and the Code in dll need special values and data from mt4 how it works? For example: dll need High[5364] or iHigh(NULL,var,var) or iATR(NULL,var, var,var) how it works? thank you!
Hi, Sorry i was not able to find the answer, compiling my EA on a chart reverts external variables to default, what allows the EA on a chart after compiling to keep the settings user had input? Thanks alot.
  Binary EA buy on new candle (21   1 2 3)
hi guys, im new to mql4 coding. i started by a simple binary ea with 60s trades, bollinger and rsi, everything works, but it doesnt wait to buy/sell for the new candle, i want to open a trade on the next candle if the conditions are true. i looked already in the forum and found nice help for new...
  StrToInteger (2)
Hi friends,  When I want to use StrToInteger or StringToInteger functions it results to -1 . does anyone know about the problem ? how can I fix this issue ? thank you all 
Hi,  I would like someone to explain me the following:   I am testing a certin strategy in MT4 in a demo account. At some point, I have placed a SELL order, the pirce goes below the price of my sell order, however my profit is still in negative. Why is that? Here you can see an example image.    
How sending a signal to two or more Metatraders 4? Two brokers need two metatraders. I want to send a copy of my click to the second machine. Thanx in advance.
Hi guys, I want to create a graphical object with every mouse click. For that I use the CHARTEVENT_CLICK function. But I always just draw e.g one H-Line and when I press the mouse again, it is deleted and another is drawn. But I want to prevent that and draw one line after the other without deleting...
New article MQL5 Cookbook: Implementing Your Own Depth of Market has been published on mql5.com: This article demonstrates how to utilize Depth of Market (DOM) programmatically and describes the operation principle of CMarketBook class, that can expand the Standard Library of MQL5 classes and offer...
How do i get the value of on of the lines in a fibo fan related to the time (or candle index)?
New article How to Secure Your Expert Advisor While Trading on the Moscow Exchange has been published on mql5.com: The article delves into the trading methods ensuring the security of trading operations at the stock and low-liquidity markets through the example of Moscow Exchange's Derivatives...
Hi, my MT4 update to the new version released at 25 Sept 2015 and starting from this update, all my EA (who works fine before) return me the error ordersed 131. Why ? is it changed something ? let me know please i'm desperate!! 
Selecting the indicators to use is one of the most important and difficult aspects of building a successful strategy. Not only are there thousands of different indicators, but most indicators have numerous settings which amounts to virtually limitless indicator combinations....
Dear all, I am working on an index (see code below) which should draw arrows for trading signals which are based on calculations on the enty timeframe (e.g. H4) and on higher timeframes (e.g. D1 and W1). Under the bottom line it should draw certain arrows for different typs of entry signals and if...
Hello! I have a problem with Metatrader 4, I don't know what to do about, I was wondering if someone could help me? the problem is that I get this order send error every time I try to backtest, even on Metatraders own sample experts, I assume there is no errors on those experts so I hope we at least...
Hi guys, I am trying to do some calculations with datetimes, and one of them is to detect the difference in hours between the Computer time [ TimeLocal() ] and the Broker Time on Metatrader [ TimeCurrent() ]: datetime ComputerTime = TimeLocal();datetime BrokerTime = TimeCurrent();int TimeOffset =...
int sellOrdersCount(){   int SellOrdersCounting = 0;   for (int iSELL = OrdersTotal()-1; iSELL >=0; iSELL--){      if( OrderSelect(iSELL, SELECT_BY_POS, MODE_TRADES) && OrderSymbol()== EURUSD && OrderMagicNumber()== 1234 && OrderType() == OP_SELL ){         SellOrdersCounting++;      }   }   return(...
Hello, I am wanting to write an Expert Advisor, but I do not know if the commands I require are even possible with mql4... Is it possible to write an EA with the following stipulations: 1) Based completely on how price moves relative to itself, determining thresholds based solely on the range of...
I have this template that is based on 3 indicators 1- first one is used only 1 (slope direction) 2- second one is MACD Alert is used 3 times as shown (from 2 to 4) 3- third one is pipsfxgainer is used 3 times as shown (last 3 ones)   All I need to do is to read the graphs of each, I need at each...