Download MetaTrader 5

Expert Advisors and Automated Trading

To post a new topic, please log in or register
I really like MT4/MT5 software, and mql4/mql5 languages. All in all they are great platforms and very interesting programming languages to work with. As a professional coder I enjoy them, and some years ago I decided to build my business and earn a living around the platforms and this site....
Hi, starting a few days ago, I can't use the Cloud anymore to run by optimization tests. My terminal refuses to connect to any of the 3 Clouds available in my region (MQL5 Cloud Europe 1, MQL5 Cloud Europe 2, MQL5 Cloud USA).I sent a message to the service desk with my log file, to no avail. Have...
One of my EA Indicators: Custom McGinley Moving Average Built Into This EA Indicator: NonRepaint Slope NeutralZone SignalOnlyOnColorChange TradeExitOnlyOnColorChange and more...
Hello Everyone, I am developing my EA in Metatrader 5 and have an error in strategy tester in the line: iMACD_Handle=iMACD("USDJPY",PERIOD_H1,20,60,6,PRICE_CLOSE); The strateg tester show the error: cannot load indicator 'MACD' [4805] Error= 4805 Error applying an indicator to chart...
I am aware that there is a script to stop all trades and close out all positions in MQL4. But I am not aware of such code's existence in MQL5. I couldn't find such script in there - where should I find such script which will stop all trades and close out all positions, or will the code from MQL4...
Hello, I'm currently programming an EA and want to implement a trailing-StopLoss. If an order is open the SL is calculated for the current bar and plotted on the chart. The SL is to be recalculated for the following bars. If the price is exceeded or undershot, the order should be closed. How is this...
Good Day everybody... Hello, I've been searching on the forum but I cant find what i'm looking for. The strategy is .. Let say I'm open a BUY position with 0.01 lot ..(  eg. I place a BUY at a price 0.74854 ) At the same time I want to place SELL STOP with 0.02 lot ( eg. I place a SELL STOP at a...
  Requests & Ideas (MQL5 only!) (59   1 2 3 4 5 6)
Terms and Conditions: You describe (you provide) the idea.I place an open MQL5 code in this branch.I place this code in a CodeBase.  I specify the author of the idea and the author of a MQL5 code in a code.The coding services are provided "as is" and you use them at your own risk.
Hi everyone, I got used to call macd indicator in MT4 in a very simple way and now I've got to switch in MT5 and things look deeply differents So experts, I kindly request your help : in MT4  calling macd and signal was quite easy for current or past period just by setting the right buffer and the...
I want to close buy and sell at a price with tp / sl. Can you do that?
Hello, a simple problem here, if you are an expert you will find this problem within seconds....my indicator always gets error "Array out of range" when trying to test it. I just dont know why... #property indicator_separate_window#property indicator_buffers 3#property indicator_plots   3#property...
I know it may be a silly question but I want to know if there's anyway to set values to the Boolean function rather than True or False  for example I want it to be up or down in the external parameters 
Hello ,  I ask about the difference between those 2 function  if we use them for the same target like fetching spread for example : MarketInfo(Symbol(),MODE_SPREAD  ,,,,  SymbolInfoInteger(Symbol(),SYMBOL_SPREAD) Thanks
  Bars in EA (1)
Hi All, Could you please explain me what is the impact when i used 4 hours bars in the EA and the EA is executed on 1 hour bar Thanks in advance.
Is possible to use pointers to basic data types like int, long, double, etc.? There are many excellent libraries of C functions and it is very frustrating and disappointing to get a default C code and try to convert it to MQL, in addition to being very tiring. Examples of pointers in standard C:...
Im trying to update my Published EA but it says the error. I already tried to compile it with the metatraderbeta.ide with no errors on code on it but still the same error on uploading can anyone know how to troubleshoot this problem?
A year ago I download a free program EA which works great on my PC. EA I copied to the laptop but not working. New EA is now for rent. How to copy EA on a laptop? I have just EX4 file.
Hi, I have updated the MT5 to 1595 version and now I have pb with backtesting (in demo no, it's ok). The problem is in OnTradeTransaction when I call the HistorySelect. This leads to a block of execution That is a code sample void  OnTradeTransaction(    const MqlTradeTransaction&    trans...
Hi everyone, could i use the boolean operation OR (||) into a While cycle?, i.e:  ------------------------Example------------------------- bool BooleanFlag=False; int n; int start() { Alert("Program Start"); while(n<6 || BooleanFlag==False) { Alert("BooleanFlag  =",BooleanFlag); Alert("n   =", n);...
Hi together, have some questions. -------- Can we direct copy Trades from one MT4/5 to other MT accounts? ------ As example i am trading and want my signals automatic to family accounts copied. Regards Mike
Hey Guys I have a 1hr/4hr GBPUSD chart on profile with an EA attached. I then change profiles, the new profile is 1hr/ 4hr EURUSD with the same EA attached. Will the EA still be functional on my 1st profile as in my second? Cheers John
Hello, According to documentation of MQL5 (https://www.mql5.com/en/docs/basis/types/typedef) is possible to create new types of variables, as well as the standard definitions of C. So, if I use something like: typedef uchar   uint8;typedef short   int16;typedef int     int32;typedef...
I'm trying to understand if I can use multiple cores on this EA: I read an array of trades from disk:  Buy ENQ on March 1  Buy ENQ on March 10  Buy ENQ on March 17  .....  Etc. ... and then loop throughthem, calling OrderSend() for each With one core active thetrades are executed in order, but when...
I have an EA that uses OnTimer() to read a file from disk, trade on the basis of its contents, and close it. Things go fine when I backtest the EA 4 times with static input values of 50 and 100 for two input variables (4 different runs). But when I try to use the optimizer with input values Start =...
Why is it that when I do a back test, I get proftis and losses that are different from mt SL and TP.  I am testing a very simple MA cross EA with no trailing stop or anything like that.  I have it set at a stick SLand TP and my results don't reflect that....
Hi In order to properly find out if my pending order is executed i try to exactly understand how it works: So i find out I can place a pending order (trade_action_pending) then i get result.deal=0 result.order=12345678 order.result ist the order ticketnumber right? now here comes the first question:...
[MT5] How to display the arrow only at the chart that open positions - close position (Show realtime history of deals on chart), other charts will not allow display the arrow. i open multiple charts of the same currency pair (using different time frames or same time frame) and run a robot on each of...
Martingale: The gambler doubles his bet after every loss... There are a few complicated Martingale math papers floating around and even those are mostly about roulette but I thought of a way to make a really simple math based presentation. First of all I am assuming the goal is to make as much...
I have a MQL4 code: for(int i = 0;i < 3;i++) {    kline[i] = iStochastic(NULL, Period(), 8, 3, 3, MODE_SMA, 0, MODE_MAIN, i);    dline[i] = iStochastic(NULL, Period(), 8, 3, 3, MODE_SMA, 0, MODE_SIGNAL, i);  } But MQL5 dones't have MODE_MAIN and MODE_SIGNAL. How should I get this result at MQL5? The...
How to add an indicator for a certain time frrame just to see the trend. Whereas I want to trade in another time frame. How to create srciptnya mt4 for expert advisor. Thank
12345678...148