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
  RSI EA  (7)
Hey, i just started learning mql4 recently, and i am automating known indicators like MACD, SMA, EMA, Bollinger Bands, RSI... Not to make profit just to learn the language. I was messing around with the RSI EA and it had amazing results in the backtest (strategy tester) over the past 12 months with
  Forgot password  (1)
I forgot my password can anyone help me
Hello, I'm trying to create a function that would check for a previous / developing crossover pattern using the stochastic oscillator . Attached is an image to better explain what I'm trying to achieve. Essentially I'd like to know when a multi part crossover occurs, the criteria is a first cross
  Coding help  (7909   1 2 3 4 5 ... 790 791)
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
I added an edit box to adxvma indicator, allowing change adxvmaperiod on the fly, and it tested ok, but then I failed to redraw the chart. I've successfully fixed this kind of problem with a most simple ma indicator, and it has a oncalculate() structure. But with this one, I admit it's too
Hello everyone, I'm looking for a solution to the following MQL4 issue. I wrote an indicator that draws histograms in the chart window. I noticed that when the chart reaches the specified candle count limit, it still draws an additional 128 candles and then deletes the oldest 128 candles to return
I have a volume indicator I would like to share here which displays No Supply and No Demand indications when confirmed, however I would like for it to show the indications before confirmation/instead of waiting for confirmation if possible? I tried to do it myself but to be honest I am not sure how
hello to all Honestly, I don't understand the difference between OrderTakeProfit() and OrderProfit() functions. For example, if in buy positions on EURUSD and USDJPY if the entry and current prices are like this, what are the values ​​of these two functions? lotsize = 0.2 EURUSD ٍEntry = 1.0640
  Resolve warnings  (5)
How do I resolve the warning on this code line return NormalizeDouble (basePrice + ( double )steps * stepPips * multiplier, MarketInfo( Symbol (), MODE_DIGITS)); Compilation warning possible loss of data due to type conversion Meta EA.mq4 47 79 your help will be appreciated Improperly formatted code
I have coded an EA and whenever I try to remove the EA from the chart Mt4 gets frozen for some time and then I receive the message "EA shutdown by time out" in the experts log. and sometimes when I try to remove the EA it just closes down the Mt4 as soon as I click the Remove option. the way I am
Hi to All, i need to call the same custom indicator (superTrend) more time in my EA, for current bar, and for historical bars. After backtest, in the chart, there are to much superTrend indicators, it seems one indicator for one iCustom calls and noticed a slow performance by MT4. There is a best
Hello MQL5 Community, I’m working on a function to calculate and display the profit summary for specific periods (weekly or monthly) based on trades with a particular magic number. However, I’m encountering an issue where the profit summary shows individual profits for each month but does not
When i extract a value from a textbox using: Value = DoubleToString ( ObjectGetString ( 0 , OBJPROP_TOOLTIP , 0 )) It works fine when you convert it to a double and print it. However, when i try to add 0.5 to the value, i get incorrect results. For example, the result of Value + 0.5 is 50.05 instead
Hi everybody, I used to basket close all the open trades on Friday 23:30 automatically by setting TimeDayOfWeek(TimeCurrent())==5 in my EA. The problem now is what if today is Thursday and tomorrow Friday is a holiday (off-trading day), is there a command to detect automatically whether a broker's
//+------------------------------------------------------------------+ //| test.mq4 | //| Copyright 2024, MetaQuotes Ltd. | //| https://www.mql5.com |
IMO, there appears to be no Complete EA within the mql4.com's Code-base or Articles for that matter of fact. There always seem to be something missing. I'm going to use the definition straight from the source allot of people recommend for learning to program mql4; the Book . In addition to that
  Blessing Ea  (9)
Anyone tried out Blessing EA? What about Forex Magic Stick?
//+------------------------------------------------------------------+ //| HighLow.mq4 | //| Copyright 2024, MetaQuotes Software Corp | //| https://www.mql5.com |
HI all, need help to check why my EA is not making any trade on MT4 VPS. I migrated it and no errors appear, but then it is not making any trade. Did you see anything weird/incorrect I should correct
  Usefull links/threads/tools  (57   1 2 3 4 5 6)
The thread about threads: what's going around the forum everywhere ============ MT5, mql5, mql5.com suggestions for improvement thread ============ Requests & Ideas The beginning Requests & Ideas, the beginning - the thread Suggestions for Trading System thread After Requests & Ideas (MQL5
In MQL4 is it possible to create a two-dimensional array whose first dimension is a number and the second is a string? If the answer is yes, is there a way to sort it? Like this : Array[ 4 ][ 4 ] = {{ "USD" , 1 },{ "EUR" , 4 },{ "NZD" , 3 },{ "CAD" , 2 }}; and after sort : Array[ 4 ][ 4 ] = {{ "USD"
I started this thread to post all news/signals indicators and EAs we have now and will have in the future.
hello I downloaded tick data from Dukascopy in csv and need now to convert in fxt to handle in mt4; in fact the import from csv handle only m1 as a minimum). Can someone tell me how to do? The script " csv_to_hst.ex4" do not work anymore in new builds. (I understood that fxt is needed and not hst
I trade in the US where the FIFO rule applies. However this rule does not apply if your trades use a different lot size. I contacted my broker (forex.com) to ask why MT4 platform always rejects a closing order if it was not the first trade in a series. I was told that the forex.com's web trader
Hello everyone. Indicator handles do not exist in metatrader4. So how do you make sure if indicator is available and iCustom is returning a valid number