Download MetaTrader 5

MQL4 and MetaTrader 4 - page 517

To post a new topic, please log in or register
Hi, it can be done?.  Running a script every n seconds. Regards,  
I am trying to create a code which works on ask and bid together. However, I'm new and I don't know how to write it. Can you help me to write this code The code I want is Buy .05 lot if the bid is up 3 pips , trailing stop =15 pips Sell .05 lot if the ask is down 3 pips, trailing stop =15 pips PS:...
Hi, I am trying to create a triple MA indicator. It is supposed to plot the average High prices, average Low prices, and average Closing prices on the chart. The average High prices is plotted correctly, but the other two are plotted way below the actual price movement. What is wrong with my code ?...
I can click mouse right button and refresh data on Chart. How to AutoRefresh Data on HST File 's Chart?offline thank you so much! 
#define ERR_NO_ORDER_SELECTED 4105 bool OrderIsSelected() {        GetLastError();        OrderTicket();        return (GetLastError()!=ERR_NO_ORDER_SELECTED );} after some trial and error, this seems to work. if you want to write a function for example called OrderCloseIfProfitable(), you need to...
skf
Hello all, I have been coding MQL4 for quite a while and really like the language. I do have one problem I cannot seem to conquer ..... The problem has to do with using Multiple Timeframes. For example, I am on H1 chart and I have an indicator that uses arraycopyrates, or other multiple...
  Parabolic SAR code! (15   1 2)
Hi, i need to make a code with the Parabolic SAR function (iSAR). This code haveto make an action when the dots of the Parabolic change of direction. Something like this: //---- if Parabolic dot change direction do something like buy or sell //---- Thanks! Bye!
This one caused me a lot of trouble, as it happens randomly... I had missed quite some trades because of this bug, but thanks to some logs I have found it in the end. The time in yellow is the time of the computer, while the time in red is the time of the last candle. There is also a third time...
Confused NuB: Series of ‘if’statements & ‘return’ I’m having troubles knowingwhat a couple of basic things do FOR SURE!. Without having these straight, I have no hopeof being able to program MQL4. I'm not sure if one of a seriesof ‘if’ statements is ‘false’ will the ‘action’ after them in the same...
hi there, question ... i have a lot, really a lot of meta trader platforms running with different EAs. every weekend i go into each platform and export the statements. as the number of platforms is increasing fast, it is taking me big time to export all every weekend and analyze them. i am looking...
friends, I am facing a problem with for statement in mq4 file. In my mq4 file under the start function, there are four numbers of FOR statements. When I put another FOR statement for picking maximum and minimum prices by counting 36 bars or any number of bars as count (say k =36) from 00hrs to 9 hrs...
I 've written an indicator with mql4 code. this indicator work properly in current chart but when i change symbol string from Null to "AUDJPY" for example , the indicator does not work ,  can anybody help me ? 
Dear all,   I have write a simplified version of MACD to show the rise and fall of the MACD historgram(the difference of the MACD line and the macd signal line). I use the following code to show a 1 to indicate the historgram is rising , a -1 to indicate the historgram value is falling.the...
thank you very much before. I need help, I need help from everyone to made simple EA for me. im just a trader, im not understand EA programming. is there anything that will help me for making a simple EA? parameter that i will made ??EA are: 1. no use indicator parameters, just TP, SL, and lots...
Working on trailing stop..   This doesn't compile for some reason! Been trying to figure it out for way too long and really would love this piece of code!       The only thing that I was weary about was the use of parenthesis:...
I would like to know when at some broker's server digits for the forex/currencies are changed (i.e. different) from 4 to 5 and 2 to 3 , i.e. 1 digit +more shown in MarketInfo(Symbol(), MODE_DIGITS), Question : Will that apply also for the other symbols from CFD and Futures and others or There is no...
Hi, sorry if this trivial question have been already answer somewhere in the forum, but I've been unable to find it. Does anyone know how to sort the Market Watch table by Symbol name column?   Thank you very much, Best regards Stefano 
Hi I need to create a renko chart of 14 currency pairs. Is this possible? 
  EA question (15   1 2)
I would like to know if there is a code for not opening another long position on a price that already has a long one open. And if it is possible for tick chart also. *edit: For ex: Moment 1: Price 1.3200  // I will go long                      M2: Price 1.3190 // I am waiting                      M3...
Hi All, How do I print a source code file and have the different colors for "Key words", "functions", etc print as is on screen. When I do  "print preview" it is all the one color.  I also tried to copy to Microsoft word but it copies as one color. I have not any problem printing or copying source...
extern double Lots=0.1;extern datetime StartDateTime= D'08.10.2012 10:47:33';//+------------------------------------------------------------------+//| expert initialization function                                   |//+------------------------------------------------------------------+int...
I have a library file, that implements a deinit() method. The deinit() is correctly executed within the event of unload, right after the deinit() of the master script. But, (unlike the deinit() of the master script) the file handles are already closed in the deinit() of the library file. I do not...
Hello and sorry by my bad english. I am looking for a script that close all open positions and delete pending orders when the total proffits of open orders be positive. I am trying to find this type of script but i can´t find it. Is possible somebody help me? Thank you.
Hi all, I have one issue with an ea regarding open orders. I'm looking to open opposite orders apart of an opposite distance from an existing one. Some times it opens at right distance, others at a distance above and others even a distance below. While I can understand that sometimes it could open...
cam anyone help me to create a script to close 15 orders one time thank you
does anyone have any idea how to show price chart using the ask price?.by accessing the propoerty diaolog box one can show the 'ask line' but i want to display the price chart using just ask price.i.e. OHLC ,all in ask price.is there also a way to program in mql4 ?
Hi all, I would be very gratefull if someone could help me by advising how to implement a snippet of code in order to let my ea have an interval of a certain period between opening positions. So I want it to never open more tahn one position at a given time. Let's say 20 seconds So now it operates...
Hi, I've just started learning to code mql4 over the last couple weeks and have gotten stuck with the first stage of the custom indicator & EA that I'm trying to code. The first thing that I'm trying to get this to do is to create 2 vertical lines for each week, one on Monday 6.00, and one Friday 21...
Hi all, Anyone knows of a script to plot historical trades (data stored in excel) including lot sizes onto my MT4 terminal? If possible, I would be willing to pay for a script like that. Thank you.
anyone know what causes this?