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
The MetaTrader 4 update will be released on Friday, May 24, 2024. This version provides important security improvements, error fixes, and platform stability enhancements. The update will be available through the Live Update system
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
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
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
How to Draw a circle ? ObjectCreat() not good since it always draw ELLIPSE, I want to draw a circle witha line linke two points. but in MT, it draw ELLIPSE since different X/Y scale(Y is price, X is time, they are never same scale, but I want draw circle wheneveraxes change). I want use one 2...
  MT4 download  (18   1 2)
I want an MT4 download link, I do not want to use MT5... Most people want MT4 so why push users towards MT5? Why should I go through a broker? Stop annoying a lot of people and provide an option!!!
hello all getting crazy with a function not working. I have a report showing open PnL and closed positions. I'd like to show a column with maxDD registered and save it into a file for checking when reload the indicator. so when OpenPNL < last recorderd DDMAX, then "update DDMAX". the code below
[Deleted]
Hello, plz help me,How I use Heiken ashi indicator for android mobile I m using android 2.3 gingerbred os mobile and for trading MT4 App....
Heloo I Can't publish my product ex4 , (Strategy tester report not found) even when try upload previous product (that already pass in past) please fix it
[Deleted]
  Sleep function in backtest  (11   1 2)
hello mql community, i'm lucky to be a part of this community. mql is the first programming language that makes sense. :-) but i've a problem: it seems so that the sleep function doesn't work in backtest. is that right? is there a solution for that? best regards, derox
The error message is that The request body contains invalid JSON.", "code":50109. I don't know how to correct the problem. Can anyone help me? Thanks! bool SendDiscordMessage( string webhookUrl, string message) { string headers = "Content-Type: application/json\r\n" ; string jsonPayload =
Hi, After updating to Windows 11 24H2, mt4 terminals shut down on their own, whether idling or running task such as back-testing. Has anyone experienced the same issue? Kindly raise a flag if so. Thank you
Windows Server 2019 Windows Server 2016 What is better ws 2016 or ws 2019 for run mt4? Thank you
Is it possible to calculate the maximum drawdown reached in an account? How? How can the development of equity be built
Hi, MT4 build 1421 compiler build 2408 the expression: if (state != EMPTY) { Print ( "false != EMPTY" ); } triggers this message in the compiler: expression is always true But it is not valid. In the MT4 Tester everything works as it should. For example I have something like: void func( bool
[Deleted]
Hi everyone, I'm starting to learn more about GUI panels using the appdialog box to add a panel to an indicator I'm writing. I have a basic understanding of how to create a panel and various buttons and labels. I just had one question about saving the location of the panel. If I move the panel on
Hello everyone, I recently experienced an issue with my broker regarding an abnormal spread spike on the EURUSD pair, and I need advice or insights from the community. Here are the details of the situation: 1 . My broker 's typical spread for EURUSD is around **2.7 pips**. 2 . On the MT4 platform
[Deleted]
  Range not behaving as expected  (22   1 2 3)
Goodmorning all.  I'm trying to create a "dynamic" range using ArrayMax/Min - aseach new bar comes in (and assuming some other criteria are met) the range extends in length - to achieve this I have elected to create a variable, the value of which changes upon each new candle (and some other...
Hello guys. Is it possible to change the values ​​of an array after it is defined at the beginning of the program? for example I have declared an array with default values ​​as follows: string NewsSymbol[ 7 ] = { "USDJPY" , "EURUSD" , "USDCHF" , "NZDUSD" , "AUDUSD" , "USDCAD" , "USDJPY" }; I tried
Hello. Please I would appreciate any help I can get. I am trying to tile windows vertically in mql4 using only code. I know this is achievable with user32.dll but it’s been a struggle even finding a basic article that can teach a beginner how to work with dlls in MQL. I have a code that can tile
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
When I read the log file I could recognize that  the Custom Indicator is loaded and then removed.  Again he is loaded and removed. Then he is loaded. Enclosed you see a screen shot. What does that mean ? 
  MT4 VPS change  (2)
Dear everyone, I am running a MT4 EA on a VPS. The EA will modify the SL/TP constantly. Suppose if I want to change to use another VPS, when I re-open the MT4, the EA will no longer be running. If I re-attach the EA on the chart, will it keep modify my previous opened order in the last VPS? If no
I am running the MT4 app build 1425 on my Iphone and receiving a plethora of messages under Profile. All are apparently informing me that my VPSs are connecting to MQL5.com: "New MQL%.com authorization from 'xx.xxx.xxx.xxx', U.S. New York (MT5 terminal) - previous 'xx.xxx.xxx.xx', NL. How can I turn
Hello, The indicator picture below, is a simple indicator that places a dot above each candle high ( green dot ) and low ( red dot ). The indicator is working with real time data only, meaning as the indicator is forming, the high and low of that candle is used in placing an dot arrow above and
Hi, is there any way to scroll the chart via MQL4 ? I'd like to scroll it to data, when the price touches my Support and Resistance Lines, so I don't have to do it by hand. Thanks
Hello, I would like to ask if has anyone encounter this problem and been able to fix this? I am trying to read signals from a custom indicator , however, it caused out of memory, I believe that there are bugs in my code but I still do not know how to fix this. The custom indicator I am using here is
[Deleted]
Hi all, I would like to be able to automatically tile all chart windows in the MT4 terminal. The keyboard command is <ALT> + R, and this can be automated using keyboard events e.g. https://www.forex-tsd.com/metatrader-programming/3805-key-event-within-mq4-programs.html. However, this solution...
I am having an exorbitant amount of trouble incorporating my custom Indicator into an EA. The Indicator calculates 3 values and no matter how I try to get the EA to retrieve the indicator values at the conclusion of a bar, the EA always gets data that differs from the indicators calculations . Can