MQL4 and MetaTrader 4

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
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
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 have built two basic indicators today for my own use but I cannot finish them due to 4/5 red lines that I have tried many scenarios with no avail what do I need to put in the following boxes Copyright Link Version Atrict indicator chart window It may seem obivious to some I know but nothing
Hi I just started in debug mode in a script just this: long    Ch01 = ChartFirst(),        ChMe = ChartID();long    ChNx = ChartNext(ChMe); and get: Ch01:130395223288765087 longChMe:130370193351027474 longChNx:-1 long I expect s.th. like 0, 3, -1 it is the last Chart?? What is meant with ID of...
Hello All. I want to hide the color and Viisulization TAB in the custom Indicator as its not being used. it it possible to do in MT4? Thanks
  Previous Bar Trailing Stop  (43   1 2 3 4 5)
Hi, has anyone a trailing stop EA which moves the stop to the previous bar's low/high? Thank you!!
Hello, I recently realized that my code for detecting moving average crossovers was not perfect. Instead, it is the classic code that is generally used by EAs. Here is an example for US30 (backtested in visual mode in order to see the values ​​of the moving averages at each bar opening): - At point
Hello friends, I am trying to run function at the time I need, but function ignoring the given time. bool IsBelowMA() { double Time_S = Hour() + Minute() / 100.0 ; // Ensure the function executes only after Time_Start if (Time_S >= Time_Start) { for ( int i = 0 ; i <
Hello, I am interested to rent the MetaTrader VPS mainly to get Push Notifications from an indicator I developed. I tested it and I get push notifications on my mobile from the MT4 I run on my computer. I would like to now if the push notifications system works over the MetaTrader VPS before renting
Hello, I want to know can MT4 send WebRequest to a server or website directly like MT5 or I need to build a .dll file to do that
I’ve opened and closed traders that I have seen drawdown 5% or so. Why is this not showing when I download the detailed statement of the account
Hi guys im doing this EA but using date, time and timezone confuses me. Can you help me make a function that will return true if its New York Session or return true if its the first 3hours of New York Session? Thank you so much :)
Hello, I'm tryng to show png image on the chart when i do run the EA, below the related script: int init() { ShowImage( "image.png" , 0 , 0 ); return INIT_SUCCEEDED ; } void OnDeinit ( const int reason) { ObjectDelete ( "ChartImage" ); } void ShowImage( string imageName, int xOffset
As mentioned in subject: I've already created two Demo Accounts using Forex.com's "Create a MetaTrader 4 Account". Each time, I receive an email with the following info: ***************************** Username: xxxxxxxx Password: XXxxxxxxxx ***************************** and the following info
You may have already noticed that the most interesting things now happen mainly on the MQL5.community. MQL4.com is about to be switched to the data archive mode. Only Book and Documentation sections will remain on MQL4.com by November. Besides, the entire MQL4.com Forum content is to be transferred...
I have about four MT4s opened on a dedicated PC with Win 10 OS (no any other programs opened/running on the PC). For some inexplicable reason, the MT4s keep closing after a while without my intervention (I also do not have any EA that is coded to close the MT4 running on the MT4s), and I have to
hi am using a code to draw a horizontal trend line from t1, p1 to t2,p1 (which will draw it horizontally and to the right) . some time i tried to draw the trend line for example : over 90 bars but because of the holidays the trend line will not cover 90 bars.. how to solve this
Hi, since today my mt4 version doesn't work anymore with a EA i purchased from this site. Friday all was working normally, now I'm getting the message : 2023.03.19 22:34:38.360 CAP Strategy Builder EA XAUUSD,M1: array out of range in 'Calendar.mqh' (617,11) It doesn't matter, if I try it on my local
When I select orders with OrderSelect(), the manual says, "Sorting of the resulting list of orders cannot be guaranteed." OK. But can I at least rely on their opening times or ticket numbers? Is it guaranteed that newer ones will always have larger OrderOpenTime() and OrderTicket() values
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
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
I am hoping you can help fix my code. I am trying to code a MT4 indicator to indicate a powerful downward bar. No matter what I do, I still get :1 errors, 1 warnings OnCalculate function declared with wrong type or/and parameters line 42 column 6 OnCalculate function not found in custom indicator
  Good Indis =)  (23   1 2 3)
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
  News Trader EA  (1269   1 2 3 4 5 ... 126 127)
This is News Trader EA created by Igorad. Besides, we may use this EA to draw the lines with text on the chart when the news coming. Explanation of the settings and how to use this EA you may find in the next posts. ---------------------------------------------- Version 2. - Please find attached the
Hello, the shortcut for commenting (blocks of) code in MetaEditor is "Ctrl + ' " (both on PC and Mac) However, the PC-shortcut for uncommenting is "Ctrl + ; ", but that doesn't work on my Mac. Does anybody know the shortcut for uncommenting (blocks of) code on Mac? Many thanks!
Hi There, I am using for the first time Zomro as VPS for forex trading pupose. I have installed well MT4 plateform and my trading account is live HOWEVER, i can not dowload my EA purchased in MQL market and the journal says the following " Cannot load'C\User\xxxx whereas I am able to use it in my
Just recently around February 25, 2024 I began getting the above message and now I no longer have access to my EAs; as they won't work without being logged into my MQL5 Community account (they won't load up on the chart) . I have no problem going to my Browser and being able to Login to my MQL5