MQL4 and MetaTrader 4 - page 460

extern double lots=0.1;  int ticket=0;  extern int stoploss=300;  extern int takeprofit=500; int aperto=0; //+------------------------------------------------------------------+ int start() {  double mc1 = iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,1); double mc2 = iMACD(NULL,0,12,26,9,PRICE_CLOSE...
Removed! Hi guys, Ive created a historgram indicator that basically prints a colour when price is in an uptrend/downtrend, and out of a set of bands like BB bands. After a couple of bars if i refresh the chart, the histogram changes in colours and is recalculating or redrawing. I have gone through...
Hello all, I'm curious to know why would I get different results in my testing and optimization when I make a few minor tweeks in my code that "technically" should bring the same result... see example below. int total=OrdersTotal();   if(total>0){   for(int pos=0;pos<total;pos++)...
Hi ..Why is it when you would like to check one point of data from one timeframe to the other that you don't see the same point -- But, when you line them up it remembers the last position. I'd like to see it the way I see it when it switches which is to plot the point of somewhere there was focus
hi friends, i'm trying to delete a file on /file every second. I'm familiar with ontick function, but this time i need it to work every second, or even less, so how can i code this? a- its using ontimer function? void OnTimer(){EventSetTimer (); // How to use this to delete file "b" every second? If...
Hi, I wrote an Expert Advisor dealing with multicurrenncy (one pair chart is open, and others-we call it "foreign" pairs- are not open). When referring to any "foreign" pairs to get for example the High of the last closed candle (shift=1) in M15 chart like: double lastHigh = iHigh("GBPUSD", 15, 1);...
[Deleted]
As would be the mathematical expression to construct the indicator fractal?. I would like to create fractal indicator in matlab. To do that would have as it would be?? To calculate fractals should I consider maximum and minimum. If for example I have the first bullish candle, the second has a higher...
Hey guys, I got an EA which is entering orders with a size based on the Equity amount and I would like to have it have it enter order based on the Balance amount instead. The used code to enter orders is  if (AutoLot)   {     double pv = SymbolInfoDouble(Symbol(),...
Hi all, I need to be able to read the "Forex Calendar" everyday to decide if there are major news, and condition the execution of my EA. Is it possible to access the Forex Calendar from an EA ?  How can I only filter the major news ? Thanks in advance. Joao.
  iHigh from other pairs  (11   1 2)
Hi, I am simply using iHigh() and iLow() to get information from other pairs  iHigh(Currency[i], 15, 1)-iLow(Currency[i], 15, 1); where Currency[i] is array of defined currencies and I am accessing them one by one using loop, 15 is the time frame, and 1 is the last closed candle. These pairs are...
Hello! I was looking to request a project in Freelance but had a quick question I was wondering if someone could help me with... It would be much appreciated!!! When a programmer designs a custom indicator... say for instance, that draws an arrow when the FastMA cross the SlowMA, only if RSI > 50......
[Deleted]
Hi, i have a script that can identify price action bars to give probable trade signals. what i wanted to do was once i run this script, i want to close all open charts and then open all charts with specified timeframe that were signaled by my scripts. is there a way to program closing of all open...
bool ris;  bool ris2;  if (OrderType()==OP_BUY &&mc1>mc2&&mc01<mc02 )  ris=OrderClose(ticket,lots,Bid,3,clrAqua);  if(OrderType()==OP_SELL && mc1<mc2 && mc01>mc02)  ris2=OrderClose(ticket,lots,Ask,3,clrBrown); return(0);
How to make a Comment that says how much Lots should i use in order to use only 1 USD? i want to create an automatic Comment text that will tell me how much Lots should i trade with if i want to risk only 1 USD per 1 Pip, in each pair it is calculated differently i want it to be able to calculate it...
[Deleted]
Hi guys, I use a button in my indicator to save a screenshot. This screenshot can only be saved to the MT4 data folder. Now I would like to copy it from there to my desktop by using CopyFile from kernel32.dll. I found the description about CopyFile here: https://msdn.microsoft...
[Deleted]
  The best trend-finding indicator  (66   1 2 3 4 5 6 7)
In your opinion what is the best trend determining indicator among known indicators, i.e. which one captures the trend range as much as possible? In my opinion it is an average based on JJMASeries algorithm ( 'Efficient algorithms of averaging with minimal lag and their use in indicators' ) with
  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
[Deleted]
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.
[Deleted]
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...
[Deleted]
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';...
  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...
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();...
  Mt4 on Android  (1)
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. 
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