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
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!
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 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
  Good Indis =)  (21   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
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
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
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
Good day or night to my fellow coders, I would the clear help of someone to check these codes I think i have a few errors in them and can't find them myself. So I would like the clear Assistance, I do thank you all for your time and pleas DM me, if you're willing to help me on them
  double order  (12   1 2)
While testing my EA on a demo account, I noticed that I got an order executed twice in the same second. Although I have a check before using OrderSend to make sure that I do not currently have an order open. What would you suggest I do to prevent this?    total=OrdersTotal();      if(total<1)...
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
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
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
Greetings, I am new to metatrader and I am wondering if its possible to place manual test orders in strategy tester? This feature have to exist but I can not find it =(
Good evening everyone, I'm looking for an indicator that shows me all open positions + Long/Short + Magic No. in MT4. Similar to the attached image (unfortunately the indicator shown doesn't work for me). Does anyone know something like that? Would be grateful for any help ;) Thank you very much
Hello There I I am new to coding ! I`ve been developing my EA But I`m geting this error 'Ask' - function not defined ! The code is This if(OrderSelect(s,SELECT_BY_POS,MODE_TRADES)) if(OrderMagicNumber()== MagicNumber) if(OrderType()==OP_SELL) if(OrderOpenPrice()-Ask> MoveToBreakeven*pips)
  Coding help  (7898   1 2 3 4 5 ... 789 790)
Hi, Mr. Guru could you please help me to constantly refresh an ea after each tick movement. I have tried everything, But I just can't make it refresh constantly. What lines of code must I insert to keep an ea and indicator refresh after every tick ? Tnx
HH = iHigh ( Symbol (), TimeFrame, iHighest ( NULL , 0 , MODE_HIGH ,NoOfBars,StartingBar)); LL = iLow ( Symbol (), TimeFrame, iLowest ( NULL , 0 , MODE_LOW ,NoOfBars,StartingBar)); Please, is it possible to use a formula to find out which bar had highest high and lowest low or the time when it
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
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
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 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
Hello, Anyone knows the location of MT4's data folder for build 1417 released on 1 May 2024 ? For a M1 MacBook Thanks
Hello, I've got a problem. I created an EA which trades the data of a range bar EA. Everything is working fine when I have both of the EAs operating on my computer MT4 terminal. I basically open up a M1 chart and place the range bar EA on it. After that I open up the offline chart which was created...
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.
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 ]) {