Download MetaTrader 5

MQL4 and MetaTrader 4 - page 24

To post a new topic, please log in or register
I have an EA that may open and close several trades during a Trading session. If the Equity increases by $150, then I want to close any open orders and stop/exit the EA from any further Trading. Thank you.
  Equity EA Anyone? (86   1 2 3 4 5 ... 8 9)
Hi, I am looking for an Equity EA. Similar to the e-Trailing EA where you can attach it to a chart to manage existing positions, I would like to find an equity ea that I can attach to a chart or charts to monitor the account equity and close the positions when the desired equity is reached. This...
Alright, so! I have an RSI and Bollinger band in the same indicator window, but the bands keep exceeding the indicator window. How can I prevent this? It is terribly annoying. Thanks in advance.
Hi, I want to simplify my code. What do I want? I want to get 2 variables for the MA20 for each timeframe: e.g.: MATrendUp_1, MATrendUp_5 .... MATrendUp_43200 (and the same for MATrendDown) I could copy the same code for each Timframe and Iam done. But what I think of using arrays instead. From the...
Hello all, this code does not come back in the last line with ArrayBsearch in MT4  (see comments). You have to manually stop the debugger to get out of it. Code hangs in an endless loop in the ArrayBsearch function. I searched the Forum and the Web for any answer but didnt find any. Seems there is...
Artie2983741
Using this simplest of EAs: #property strict input bool NewBarOnly = true; int OnInit() {     Print(__FUNCTION__+";NewBarOnly "+(NewBarOnly ? "True" : "False"));     return(INIT_SUCCEEDED); } void OnDeinit(const int reason) {} void OnTick() {     static datetime T1 = D'1970.01.01 00:00:00';...
  MT4 UI Text Size (17   1 2)
Hi fellow MT4 users, I bought a Surface Pro 3 and installed MT4 on it. Works fine however the text is too small to read and strains my eyes making it almost unusable. I have tried changing text size to larger in Windows and playing with the DPI settings but nothing has made the text larger in MT4....
  Windows Range (5)
Hello everyone, I'm trying to make an indicator that can be drawn in the same window with other indicator and I've seen that each indicator has a different range to draw. What do I mean by that? The A indicator and my indicator (let's call it, B) have the same value. So, should both indicators...
  Simple Ichimoku Scalping (52   1 2 3 4 5 6)
Simple Ichimoku Scalping. It is some variation of the settings of the Simple Ichimoku System. This Ichimoku template was improved onto Simple Ichimoku Scalping. On this thread you can find this Simple Ichimoku Scalping for Metatrader 4 and Metatrader 5. Installation for Metatrader 5. - download...
In this article, https://www.mql5.com/en/articles/1492, the author present the following method of computing Z-Score. Z=(N*(R-0.5)-P)/((P*(P-N))/(N-1))^(1/2) where: N - total amount of trades in a series; R - total amount of series of profitable and losing trades; P = 2*W*L; W - total amount of...
Does the horizontal Tab work? If yes, how? I've tried \t but it does nothing anywhere.  I've been checking and I can't find a way to make a Horizontal Tab.  It doesnt work in Alerts, Print or Comment functions. So, is there any way to make Horizontal Tab? You can see it exists in the MQL4 Reference;...
DEAR SIR,PLZ INSERT EXPAIRE DATE TIME FOR SAMPLE
I'm trying to calculate the account balance percentage but this code does not help. Any advice? I want to use account profit to close all orders when profit  of all open orders exceeds 30 percent. All close code is correct but does seem to work is the code below right?   double ACQ= AccountEquity();...
I have some issues in using mt4 on mobile.  Using Ichimoku cloud indicator, but can't get it's full view,  i.e. the senkou span is not showing of complete 26 period. The same can be viewed in mt5, how can that be resolved. 
Expert removes on restart how to solve this in MT4 ?
Please i need someone to please tell me how to merge 2 indicators so that they can come out as one.The indicators that i want to merge are CCI and MACD. i read something that i want to try out but the writer did not include how to merge indicators. Thanks all.
Hi Everyone! Hope all's well with all! Which is the appropriate return statement to use(return(0) or just return;,,,,,and is there a difference) just to exit the "if" loop without exiting the entire program? All feedback highly appreciated. Thanks yo'all.
Hi,  In MT4, sell order limit or buy order limit set in server side or client? I mean that if I place sell (or buy) order limit and I disconnect from internet then price touch that order limit, what happened? order placed or when i disconnect that order removed? thanks
  ex4 to mq4 (5)
Hello I have several .ex4 indicators that I need to convert to.mq4 so I can use my expert builder with them. How do I do this. Thank You
Hi, I have monthly historical data for GBPUSD as from the 1900. When I import the historical data file, MT4 does not show before the 1970. I changed the max bars in history and chart to 250000, but the same issue. Sorry for my english. Help me please.
Hi there, I added some logging code to my EA and due to an ill thought through change, the logging got caught in a tight loop and now, the Experts Tab is spewing out comments. If I shut down MT4 and MT Editor and go back, it keeps on outputting the comments. I've tried deleting log files but nothing...
Hey guys,  I wanted to build a really simple EA based on MT4's built-in Pivot Points indicator that would sell if prices reach resistance levels and buy if they reach support levels. I have not used the iCustom function a lot and so that might be why it does not work although I am not sure since the...
Hello,  I use the MT4 app to monitor the chart and trade from often. The MACD app is not showing the correct MACD indicator.  It's missing the MACD line and representing the difference of 12 and 26 ema with the histogram. This histogram is suppose to be difference of MACD line and trigger 9 SMA line...
Hello I am blocked on a simple thing... I am using the strategy tester with PERIOD H1. And I want to calcultate height of M1 candles. So I have entered if (nbBuy>=1) {   double height=iHigh(Symbol(),1,1)-iLow(Symbol(),1,1)   Print(DoubleToStr(height,2));   } But the calcul return 0.00. If I want to...
Before I start, I know this isn't neccesarily the way people usually do things. But I am trying to write a small piece of code that will calculate a lot size that will enter a trade using a given percentage of the available balance (including leverage) in my account. I can obvously do this during...
Hi there, I'm new to MT4/MQ4 and have, with some help from this forum, just created a processing class that effectively produces a collection of values for plotting highs/lows on a chart subject to methodology rules.  When I first started programming MT4, I was just using the Indicator/EA template...
  Close and Reverse orders (33   1 2 3 4)
Sometimes there is a need to reverse the trade that u open. The attached script will close all open orders that already running and will open a new orders with equal lots size. The scrip will close and reverse only the orders that the symbol() is equal to the one that the script is attached to.
Hi guys I have experienced quite often in MT4 that when an EA sends an order to close orders , a new order gets opened with lot 0.01 and a comment from #somenumber  where somenumber is the number of a trade that was closed. I understand this is something of partial/multiple closing . The existence...
Hi Guys,  First time posting here, with just a quick question about how to approach coding the following into an EA I'm working on. The psuedocode is something like this: EntrySignal is true -> Open 3 positions each with their own TP & SL If position 1 hits TP1, then positions 2 and 3 modify their...
hey guys i need this ea pls make for me when time opening order , hedge all open orders (hedge on +20pips for profit ) and (hedge on -20pips for stop losing) all symbols opened and similar lotage Example : we have now one EUR/USD order , now ea waiting for -20 pip or +20pip for making hedge , and...