Download MetaTrader 5

MQL4 and MetaTrader 4 - page 201

To post a new topic, please log in or register
Please find the below code and here's the problem: datetime fromDT ="00:00",            toDT ="07:00"; int      fromBar = iBarShift(NULL, 60, fromDT),            toBar = iBarShift(NULL, 60,   toDT),           length = fromBar - toBar + 1,            HHbar = iHighest(NULL,60, MODE_HIGH, length,...
I try to test my EA and problem is I don't know how to create testing scenario logic is - if indicator A got value N and indicator B got value M - open position in real life i need to wait hours to get this match and ops error in code, fix and wait again  is there any way to simulate market for...
We haven't seen any changes since the 950 build on 22nd December 2015. Does anyone have any idea of when the next platform build might be released ? I'm asking this because I have a pending enhancement for querying the Windows Scaling that was implemented a few weeks ago.
I am trying to code an EA, that will check for certain criteria across multiple currencies, and if they are satisfied open a trade. To try and get the code to work the only criteria I am currently using is open a new bar (I'll add more when I can get this bit to work). I'm also limiting it to 3...
Hi can anybody suggest why the envelopes are not showing when I drop this on a chart? I believe I have coded it correctly ?? Thanks 
Hi,  Can anyone suggest a fix for this compiling error on the || or statement:  if(PriceHighBack>=BolUpper && PriceMedian<BolUpper || PriceHighBack>=BolUpper && PriceMedian<PriceMedianBack) I get this compiling error: check operator precedence for possible error; use parentheses to clarify...
  Client API (1)
Hi,  this is directed to MQL4. Is it possible to get a free API for some currency pairs and gold prices in various currencies?   thank you   Jack 
Hi, everybody. Had this ea but i want to opposite of that ea. When it buy i want SELL and when it sell i want BUY. And i don't know what should i change. :(   Help me please!!!      //+------------------------------------------------------------------+//| Script program start...
hi. i run my ea successfully on several broker platform (4 or 5 digit ) , but when i run it on windsor platform i have this error. for windsor the symbol is named as " EURUSD@" as below picture , and the error code is:     and the error code refer to : ================================== and if...
Hello to all, I have a problem with iMA function for calculating the moving average. The function almost always returns the correct value but in some cases of some currencies returns to ZERO. I am making a simple calculation of the moving average of 200 periods eg. SMA200 = iMA (Symbol iTFMinute,...
  Text Label Position (13   1 2)
Hi, Please help me with the Text Label Position ( I want to move it to the left side As it is showing in the attached photo) I'm try my best but i couldn't find the solution . int start()  {//---                           double priceH=iHigh(Symbol(),PERIOD_D1,1);...
Hello, my problem: Two classes, one inherits. But, the inherited class has to be constructed with a parameter... And I can't make it... FatherClass: class clsGauss01      clsGauss01(int Index); SonClass: class clsGaussTS01 : public clsGauss01(0) But the Message: '0' - declaration without type...
Hi all, Is there any parameter or workaround to make the compiler rename the ex4? As far as i understand the compiler will generate an ex4 with the same name of the originating mq4 file, but i'd like to be able to change the name based on code.  For example, if i have an EA called MyEA.mq4 i could...
Hi, I'm making a GUI for my EA.  I'm using this code https://docs.mql4.com/constants/objectconstants/enum_object/obj_button What I want to do is link a function to a button, so that when I press it, the function gets called. My ugly workaround as of now is:  void OnTick(){        if...
Which do you use for backtesting     MQL4 MQL4 Birts MQL5   This questions is primarily for those who use MQL4 for algotrading, I have in the past converted my EA into mql5 for purposes of backtesting accuracy and I am considering doing so again.   Regards   MNt
Hi, I want to draw multiple letters above the chart. The problem is that the letters I am currently drawing are relative to window, not to chart. How can I change that? This is my code :     for(int i=0; i < limit; i++) {           ...        string name = "symbol" + i;       ObjectCreate(name,...
Section 1: (input data for script, indicator, EA) input color clr=clrNONE;  // or extern color clr=clrNONE; declaration by user OnStart()       // or OnInit() Alert(clr);     // return 255,255,255 or Section 2: OnStart() {   color clr=clrNONE;  // declaraion inside   Alert(clr);  // return clrNONE }...
Hi, please, it is possible... launch an Indicator without the confirmation-window (that appears before running the program)? I see that for Script it is possible set the presence of this confirmation dialog (#property script_show_confirm), but it seem that doesn't exists nothing of similar about...
I have written an mt4 EA. I want it to display my contact information in order comment. What exactly should i write in source code if i want my EA to display my email id that is, "sammiawan@gmail.com" in the order comments and charts.Thank in advance.
  Help Please on iHighest (12   1 2)
i am new to MQL scripting and looking for some help.   Can someone please help me here to understand this piece of code? Is MaxH/MinL looking into the future by period bar to find the highest High and Lowest Low in "period"?   The i as Start parameter in iHighest means High is calculated from the...
Hello everyone. I would like to modify this code so that the alert, instead of appearing at the opening of the candle, detects the conditions after a few seconds. Thanks for everything, Massimo. int start(){if (BarStart !=Time[0]) {  BarStart = Time[0];   //Indicator Buffer 1            if (...
Sometimes the function OrderOpenPrice return number with more digits than it should be and that's make problem because when i use that number inside of if statement like "Ask==OrderOpenPrice+50*pips" it doesn't make true the condition to execute the code at the brackets of if statement.I try the...
Hi I was sending questions to programmers in https://www.mql5.com and after that i can't go in. Anyone knows what this is? Server Error 403 - Forbidden: Access is denied. You do not have permission to view this directory or page using the credentials that you supplied. Best ola
New article Fuzzy logic to create manual trading strategies has been published at mql5.com: This article suggests the ways of improving manual trading strategy by applying fuzzy set theory. As an example we have provided a step-by-step description of the strategy search and the selection of its...
Hello Support or Developer Team! I have two ideas which would facilitate the analysis... How can I write this?   
  loop very big (9)
Heey gus! I'm trying to make a Trailling Stop Bad, is very large. Is there something I'm missing?   Example: OrdenOpenPrice() is 1.00000   OrdenOpenPrice() is 1.20  (STOPLOSS()) OrderOpenPrice() is 1.50 (STOPLOSS()) thank you for help.  AutoStop=20;AutoStop2=30;int cnt, total=OrdersTotal();...
  Expert Advisor problem (17   1 2)
Hi, I have this problem with my new EA, with it i`m going for the squeeze strategy with BB, i have set some code and after checking up everything and using the tester it doesn`t trade,why that happens to me so often :D .  double BBmain[];double BBlow[];double BBhigh[];double...
Hi there, It is possible disable the object description label? (it appears when mouse-over on the object) If I set a void string through ObjectSetText() function, the onmouseover-label doesn't hide itself, but anyhow display (a) the name of the object and (b) the price value of the mouse-pointer...
I want to code a linear regression of the 5 last Bars and i need the summation of the closes of the last 5 bars so i wrote this. int i;double sum_y = 0;int sum_x = 0;   for(i=1; i<=5; i++)   {   sum_y += Close[i];   sum_x += i;   } So for example now sum_x should be always 5 but already after a few...
Hi  I have an indicator which reads from a csv file. Now after fetching the data it stored in Description which is a string data type. On Description data are stored in following manners:  "Apple Fruit" "Potato Vegetables"  Using stringfind I want to fetch only Fruit. I am doing this: int comp =...