MQL4 and MetaTrader 4

If you have questions about MQL4, MT4, MetaTrader 4, please post in this thread. Especially when your questions are related to trading functions
In this thread I want to begin to help those who really want to understand and learn programming in the new MQL4 and want to easily switch to MQL5 - the languages are very similar. This blog will be a good place to discuss tasks, algorithms of their solution and any other questions concerning MT
The MetaTrader 4 platform update will be released on Friday , March 1, 2024. This version provides error fixes and platform stability improvements. The update will be available through the Live Update system
The MetaTrader 4 platform update will be released on Friday, February 23, 2024. This version provides error fixes and platform stability improvements. The update will be available through the Live Update system
This topic will discuss undocumented ways of working with the mql4 language , examples of solving certain problems. It would be desirable that this branch would be closer in content to the FAQ, than to the discussion. I suggest that all experienced programmers share their solutions and programming
Hi, I'm trying to build my own EA using EMA. When the program starts it will buy/sell according to the relative position of slow and fast EMA. Then the program should close the trade at the next EMA crossover. My first obstacle was to find a way to calculate EMA at the closing of candlestick, so I
Been working on an EA based on the 5-13-62 trading system. need help trying to get the EA completed and working. Would appreciate any assistance in helping to get this EA completed. I've attached file that I have developed thus far.
Hi coders, hope you can help a non-programmer myself ... I have 2 strategies written in 2 EAs. Currently, I load the 2 EAs into 2 different charts but with different coded conditions (same magic), in other words, at any point of time, only one EA is trading and the other EA is in dormant state (both
I am writing an EA that uses crossing moving averages . I tell the crossing of moving averages in the following way: // if shift5MA > shift0MA if (shift5MAArray[ 1 ] > shift0MAArray[ 1 ]) { //if shift5MA < shift0MA VALID SELL if (shift5MAArray[ 2 ] < shift0MAArray[ 2 ]) {
  there are no trading operations  (66   1 2 3 4 5 6 7)
I test me EA on my own broker it works okay. But when I send in for validation I get the following : test on EURUSD,H1 there are no trading operations test on NZDUSD,H1 there are no trading operations test on GBPUSDcheck,M30 there are no trading operations test on XAUUSDcheck,Daily there are no...
  Good Indis =)  (15   1 2)
Hi, some good indis found in the internet (4shared) in this topic! First, a smoothed non-repaint version of macd indicator coded by igorad and mladen. Cheer´s
Hi, I would like to have the following structure: template < typename T> class RingBuffer { public : class AccessResult { public : bool valid; T item; }; AccessResult getAt(idx i) const; }; With this, I can declare a RingBuffer like this: RingBuffer<SomeFancyElement> elems; and
Hi all, I'm new to MT5/trading in general, still using a demo account. I was entering a trade into my trading log and looking at the the history tab it reads "Price: 153.837" on the left, then further along it states "Price: 154.475", now I went short on this trade so I understand it moved against
Hi all, i have developed a forex trading strategy that works on a daily pattern of events as well as signals, yes it is true!!, the problem is is that windows 10 does not like offline charts in a simulator and simply freezes when advancing backtesting speed. Windows 7 on the other hand will run the
Hello, Anyone knows the location of MT4's data folder for build 1417 released on 1 May 2024 ? For a M1 MacBook Thanks
Hello community, unfortunately, I'm too stupid to find out whether, and if so, how, I can achieve the following: Suppose I have a basket of positions: - USDCAD, Sell, 0.05 lots @1.36300 - USDCAD, Sell, 0.08 lots @1.36600 - USDCAD, Buy, 0.05 lots @1.36900 Is there a way to calculate at what price
Hi everyone, I'm Matteo, I have a question about backtesting on MT4. I need to backtest an EA on different cross at the same time... ...for example an EA on EURUSD and the same EA on USDCHF starting from 01.01.2024 to 01.02.2024 with the same capital. Is it possible? Or, maybe, is possible make two
I'm got a C# DLL that calculates my trades for MT4. It is compiled as x86 and uses RGiesecke.DllExport for unmanaged code. So far so good, but I'm not able to call any other class libraries from it. As soon as I instantiate a class in an external dll file (which I manually copy into the Libraries...
Goor afternoon guys, I am currently coding an Expert Advisor to automagically trade for me. I already got the indicators, their respective buffers, the names and all of them are on the correct folder. I am using the iCustom() function to read out the buffer values and perform calculations. So far so
Hi, I am trying to write code which determines which chart is currently on top, in MT4. For example, if an EA or indicator is running on a particular chart, how to determine whether the EA/indicator's chart is currently on top? I know that you can bring chart to top: ChartSetInteger(chartID,...
I am using MT4 and I have used mql5 marketplace from it. It was working well three months ago. Today when I am trying login I am getting the following message "MQL5.community authorization failed". The MT4 version I am using is download from "Octafx" broker website. Please help me solve this
Dear friends I wrote an expert advisor in mql4, when I run in live account the expert put pending positions at wrong prices. I want to put two limit pending with 100pip distances to each other. in live account most of a time its work fine but some times it put both of them in same price. when I run
  MySIMPLE trading system  (670   1 2 3 4 5 ... 66 67)
********************************** New IDEA in MySiMPLE trading system : Scalp with RSI on Major Pairs :: indicator : +JoGET_MultiPairs+ :: ********************************** Hi, this is MySIMPLE Trading System, thanks to administrator and all master, I used your great indicators. --------HOW TO USE...
  Elite indicators :)  (15188   1 2 3 4 5 ... 1518 1519)
Hello, Does anyone know where I can find an indicator that takes in price values, which when reached or surpassed will cause the indicator to send a sound alert
  Leaked memory  (6)
Hello, when running the code below MT4 prints: 2020.07.28 11:42:00.097 Class EURUSD,M1: 16 bytes of leaked memory 2020.07.28 11:42:00.097 Class EURUSD,M1: 1 object of type test left 2020.07.28 11:42:00.097 Class EURUSD,M1: 1 undeleted objects left #property strict void OnStart (){ test t =
Hello, I have a custom EA that works fine in the live market, but when doing a back test in the strategy tester , it does not open sell orders. There are no errors or warnings; it just doesn't open sell orders. I've checked every possible reason that might be the reason why it does not open sell
Using a Mac First post and I am sorry if this is in the wrong place. My Navigator window and Market Watch have become undocked.....sure it was my fault. Now, I can't get either back docked?? Does anyone know how to fit this? It is a really silly problem to have without any way to get it back
For a long-term investment purposes and with a profit factor of 2. in M1, with 120 operations during one year. EURUSD only. Time from 2am to 9pm (Helsinki time). Yes or no? Thanks a lot
I am developing a kind of grid system on MT4. The lot sizes will be distributed in one area, increasing the lots for every new position. Requirements: 1) The system knows that can open at maximum x positions. ( x = 5 in the example below) 2) The system shall use a multiplier Z to increase the lot
Wondering if anyone has successfully made an EA that runs on the ByBit MT4 platform. I'm having issues using strategy tester with crypto pairs, getting the following errors: Tester: exchange rate cannot be calculated Tester: margin exchange rate cannot be calculated I'm guessing the issue has to do