MQL4 and MetaTrader 4

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
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
If you have questions about MQL4, MT4, MetaTrader 4, please post in this thread. Especially when your questions are related to trading functions
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
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
// Define input parameters input int ADX_Period = 14 ; input int RSI_Period = 14 ; input int RSI_Overbought = 70 ; input int RSI_Oversold = 30 ; input double Risk_Percent = 2.0 ; // Risk percentage per trade input double Max_Lot = 0.1 ; // Maximum lot size per trade input double Slippage = 3 ; //
How can I get the value of the position, which is marked in the picture, in the EA code
When I set “Long Only” or “Short Only” in the advisor settings, the terminal sees error 4110 or 4111, how can I write a check for position allowing in the code before completing the OrderSend function
hi everyone I have indicators code in MQL4 and I want to use it in Mql5 How I can change codes into Mql5 I don't know any thing about Mql5 codes below are my indicator's code I really need it as soon as possible Best Regards Neda
  MT4 End Of Life  (66   1 2 3 4 5 6 7)
Hi all I have heard reports that MT4 is soon to become 'End of Life' with no active support or updates. Can anyone explain what the future holds for MT4 and the vast array of millions of ex4 Indicators, Scripts and EA's? Any plans to provide a port or emulator for these to help transition over to
Greetings everybody! I have been working on a meta trader 4 trading bot for a while. When tuned all the algorithms and parameters I get a impressive results as shown below in the screen capture. This is for the time period Jan 1st 2024 to Today (14 Mar 2024). It gives similar results for any time
Any body know the code for this strategy When I Click The EA the following steps i want its possible? Step 1 : Buy Order TP-20 pips SL-24 Pips Step 2 : Sell Order TP-20 pips SL-24 Pips Step 3 : Pending Order Sell Stop Price (First Step Buy Order SL) with TP-30 Pips SL-24 Pips Step...
hi, I have used this great article for mt5 to connect to a wss api. which is working fine. but the same code in mt4 does not work at the very first line long http_open_result = WinHttpOpen("mt4",WINHTTP_ACCESS_TYPE_DEFAULT_PROXY,NULL,NULL,/*reserved parameter*/0); I think sending that string is
how to write a check in the code of the mql4 advisor "Only Short" and "Only Long" so as not to get errors 4110 or 4111
  OrderSend: Error code 131  (31   1 2 3 4)
I get this error on validation my product but it is running well on backtests.
I try to create a code which will work on all instrument to calculate the right lotsize based on 1 percent risk, but my current code show me only a right lotsize for forex currencys, when i put the indicator on bitcoin chart i get to big lotsize, can you help to make a working code which will
Is there any code, function or something which is able to return Account Balance of an specific time? For example at the beginning of the day.
OrderProfit() - This will return only Pips value or Final Profit/Loss after calculating swap and commission also. Default Code : double CalculateTradeFloating( int A_magic_0) { double CalculatePL= 0 ; for ( int pos_12 = 0 ; pos_12 < OrdersTotal (); pos_12++) { OrderSelect (pos_12
Hello all, I'm new to coding and I'm really not finding a way to get what I'm looking for. Maybe one cool/savior programmer out there can help. I'm trying to find out the high/low for a certain period. The period is fixed. Let me explain a bit better. I'm trying to find out the highest high and the...
  CumulativeDelta  (2)
Hello! Any idea how to calculate cumulative delta in mql4? There are some indicators saying that they are delta indicators , but as per definition , delta calculation involves volume_ask and volum_bid which is not available in mt4
Hi guys, I have an indicator that duplicates horizontal lines across multiple charts on different timeframes. The code to place and move the lines works fine but the code that deletes the lines does not work. #property strict #property indicator_chart_window #include <stdlib.mqh> #include
In the following function the ibandsonarray always returns 0. I have verified the array is filled with the correct values, but I always get 0 for the upper and lower bands. I searched this forum, google, and youtube for several hours, and found some people who had this problem, but they either
I just bought an EA for the MT4 platform. But when I click "Install" it doesn't work. I can't install my EA. Can you please help me
<Deleted> //----------------------------------- // Open Order pending by other pending orders //----------------------------------- int start () { ngày giờ tĩnh t; if (t == Thời gian [ 0 ]) return ( 0 ); double MyPoint = Point ; if ( Digits == 3 || Digits == 5 ) MyPoint = Point *
Hello, I am using an EA attached to 4 currency pairs in one MT4 client. I frequently encounter an error " Trade context busy ." My question is, is this error due to my computer hardware resource issue (RAM/CPU), Metatrader 4 application-related issue, or Forex broker server-side issue? If this is a
[Deleted]
Hello my entry prices are different in live trading from EA backtesting results, what might be the reason and how can I fix it? The spread used is the same as the time traded, but I get different results in entry hence affecting the results, how can I fix this. The EA is supposed to be opening
Hello there, I'm converting the working MT5 version of my EA to MT4, but I get an array out of range error not matter what I try. It's my first time working in MQL4 and I have tried many things but I can't solve the issue so hopefully someone can spot it and advice because I'm running out of idea
Hello,   I managed to change the default templates so every new chart I open I have the right colors, but when I'm testing my EA and custom indicators I still get the old default template.   How can I change that?   thanks, Giulio 
Hello, even though it worked fine yesterday, today I'm experiencing a "connect failed [No connection]" error and I cannot search for any other brokers at all. I don't understand what's happening?????? I've been using this server for 10 months now. It has always been normal. I run 30 terminals