Download MetaTrader 5

MQL4 and MetaTrader 4 - page 1143

To post a new topic, please log in or register
A common problem: Find all open pending orders for an EA and delete them. I am wondering if the following code, which loops backwards, solves the problem of OrderDelete which causes "holes" and/or changes the list size? //Loop backwards, finding each order for this EA for (int i =...
Hi everyone, I need a script that changes all the open charts in the current profile from one timeframe to another when executed. Is this possible using WindowHandle? If not, I would be grateful of any suggestions as to how I might be able to do this. Many thanks in advance of your responses.
Is there a way to find out if a user has specifically set the expert settings preference to only trade long or shorts? Thanks Neil
Hello, I'm looking for a expert advisor code based on MACD lines and not on histogram which is given bydefault with MetaTrader software. Buy when the MACD crosses up through the signal line, and sell when it crosses down through the signal line Anyone has that code. Thanks GK
On the website of the Automated Trading Championship 2008,an Interview with Ilia Gontmakher has been published.Ilia Gontmakher known in many traders’ forums under the nickname Igonter is a moderator of one of such forums. Ilia actively develops mechanical trading systems. The very beginners can’t...
I would like to have a Macd indicator with the Macd as a line, the signal as a line,and the difference or histogram as a bar graph. How do I find this indicator? Iam new to this forum and am not a programmer. I have attached a simple of the chart. THanks, Tom
Hey Guys! Would someone give me the exact code to get alerted when price closes above the 5 period hourly EMA and/or below the 5 period hourly EMA? Thanks alot! Arie
Hi again, First of all I appologize for flooding the forum with so much help requests, but I am almost done.....so please help one more time. I have coded a simple crossing EA, unfortunatly it is missing about 35% of the crossing signals....I tried to be simple while coding it but looks like I may...
I get the following error '\end_of_program' - unbalanced left parenthesis C:\Program Files\MetaTrader - North Finance\experts\Rappeler.mq4 (78, 1) I haven't been in the saddle for a while and I can't find where I'm off. Can I not do a loop within a loop? Thanks for your time. Rollerbob...
Does anyone know a ECN company trading USD/BRL? Thank you, Fred
Just wondered if this kind of performance was enough to place in the top 100? I guess the full report won't upload(:
Is there any possibility of returning whole set of optimized parameters without naming each of them. I would like to optimize different strategies and log results to database. Unfotunately I cannot record automatically what settings were used in particular case.
  Wrong code (5)
Hi guys, This is my simple code:    int num[];   int i=0;   for(i=0;i<10;i++)       {       num[i]=i;      Print(num[i]);      } All prints are 0. Why? Why not 0, 1, 2, 3, 4 ... etc?
Hello community! I have a problem i don't know how to resolve. I'm writing an indicator to display a price chart over an other price chart. So far this was easy i do it this way: for(int i=0; i<Bars; i++)      {      PairB = iClose("BRN",PERIOD_H4,i);         ExtMapBuffer1[i]=PairB;    } This is how...
Can someone look at this code, Its not calculating the pip difference between the first order place and the new one place. Ex. first orders place EURUSD B S say later..... B -50 S +52 if kantor Green led then I have the EA close the SELL order to profit and place another BUy order, but I need the EA...
Sometimes when I compile a new indicator, MT4 decides to compile mostof my indicators but not all of them. Some of my indicators do NOTappear in the Navigator window when this happens so I can't drag themonto a chart. Do you have any idea why this may happen? I have to move some indicators into a...
Hi guys! I'd like to use the moving average of the last 20 ticks (for example the last 20 bidprice of a pair) . How can I count it? Can you help me by a little code? Thank you!
If you look at the "Combined Use of Programs" page, located here: https://book.mql4.com/samples/shared, there is a block of code that doesn't make sense to me. In block (11-12), the fourth line of code is: if (Parametr>Min_Dist). I believe it should be if (Parametr<Min_Dist). Since I am a newbie, I...
Would someone show me please how I can insert an instruction in an EA so that a line of text will appear on the chart. The object of the exercise is to display the name of the EA that is running. Thank you, KeithN.
I made an indicator derived from the MACD custom indicator that comes with metatrader, the code is attached. It basically just takes the MACD data and marks a buy or sell point with color coded arrows where the signal line reverses. Here's my problem. When I start the indicator, this is what comes...
Hi How can I remove a single line from my data-file? The data looks like this 01;10;2007;13;00 01;10;2007;13;00 01;10;2007;13;00 01;10;2007;13;00 01;10;2007;13;00 01;10;2007;13;00 01;10;2007;13;00 01;10;2007;13;00 I need only the top line of the file. After I read the first line I want to delete it....
Hi gurus! I'd like to write into a file Moving Averages datas. This is my wrong code (it makes an empty file): #property indicator_chart_window#property indicator_buffers 1#property indicator_color1 Red//---- indicator parametersextern int MA_Period=13;//---- indicator buffersdouble...
Hi all I can run my EA in demo account for strategy tester, but it can not work in real live account. The expert message shows: ERR_INVALID_STOPS (#130). Is anyone can help me to check my EA have anything wrong as below? if (sma_b_1>sma_b_2&&Low[1]>Low[2]&&Low[2]>Low[3]) {...
Hello Experts ! I’m new in MQL4 and try to build up my one little EA. Please, any one can help me on closing an open position 15mnafter opening if the value turns negative (like 50% of the case) I already start a simple pilot but I need to close thenegative trade after a short period. Thanks for...
The minimum trade size is 0.1 lot, the maximum one is 5 lots with the step of 0.1 lot for each order. What it means? we can not use normal money management with 1 lot step? Pls answer. Thx.
Hello, I am a Computer Engineer, I have 7 years of experience in developping applications. I recently got interested in Forex, and specially in automated strategies. I am ready to code any Strategy, of course FOR FREE, under one condition: the strategy should be efficient. It is a win win situation...
  bool variable (2)
Hi, I need to create a bool variable that is true if an order that was previously opened now is closed. How can I proceed? Thank you!
Hello MQL4 comunity, i need help and maybe some one might help me please. I wan´t to draw an indicator which draws a value only at a given time. For exapmple only between 08:00 and 20:00h. But i gues not how to realize this. I tried to do this with the Hour() function, but this function returns...
The code int myTicket = OrderSend(..., ...) provides the ticket number for the order. Assume that the ticket number is then stored locally (in an array, or a global variable, or whatever). Then suppose the following code OrderDelete(myTicket). Is it possible for the OrderDelete to fail?...
Hi, I'm a newby to MLQ4 and have not programmed in decades. I have an EA that can be quite profitable that does not use stops. As such it can sit for a while in minus profit trades. I would like an EA that selects those trades with a minus profit of selectable level, and if this trade is not...