Download MetaTrader 5

MQL4 and MetaTrader 4 - page 90

To post a new topic, please log in or register
Hello guys and gals,   i have this very inconvenient problem. I want to place pendings orders exactly at 8:59:59 and i dont know how to do it with timer to repeat it every day. In code below every day will be x minutes away from 8:59:59 where x is 9:00 minus time you put EA in chart   int OnInit() {...
Hi Freinds,    I am new to MT4, and have just setup an indicator with Buy and Sell arrows. This indicator is pre-coded and has all the functions of alerts (like Mail, push, sound alerts), but I am confused as to how should I enable these settings in both Indicator and MT4 standard notification...
Hi,  How can I know which part of the code is causing this Abnormal termination/timeout message?   3       07:01:15.111    EA EURUSD.lmx,M1: shutdown by timeout 1       07:01:23.244    EA EURUSD.lmx,M1: Abnormal termination 0       07:01:23.244    EA EURUSD.lmx,M1: uninit reason 9 It seems a task...
Hello, How to add a day at a datetime variable ? My code : datetime dtDateTest = D'2004.01.01 00:00'; datetime dtDateTestPlusOne;  dtDateTestPlusOne = dtDateTest + ??????? ; Thanks, Tintin92
Hi, I think this a limitation of the MQL sandbox but I thought I'd ask here just to double check. I have an indicator the needs to create an arbitrary number of "indicator buffers" based on the input parameters e.g. If the user wants to show 5 results then I need 5 buffers, if they chose 3 then I...
Hi there,   I need some help. How can i put a value on a variable, and chage it when a new signal shows? Let me explain a little bit more:  I have this code...       if(iEnvelopes(NULL,0,14,MODE_SMA,0,PRICE_CLOSE,Deviation,MODE_LOWER,1)>Close[1]  ){       Flag = 1;      }           and i want that...
I use MT4 build 988 on Win10. The terminal was installed after OS received Anniversary Update from MS a few days ago. After successful installation I tried to attach my EA's to charts in this new environment. But it is impossible now. They can't be attached to charts anymore, neither dropped nor...
Pablo Rego
Is the function TesterWithdrawal() from MQL5 available also for MQL4?  In mql4 code, it compiles, but it seems to do nothing.
[Help] What is the Real Formula of Exponential Moving Average? Please explain it to me. I searched in internet, I found many EMA Formula. I want to know the right way to calculate EMA. I need the real formula of EMA.
No matter what I do, the tester still shows the same template, which is not related to the Ea being tested. I have tried different EA, different pairs, different profiles, different initial templates and always get the same template, which in some cases has  none of the appropriate indicators...
Hello. I am having difficulty making my EA do what I want it to do. I've read the book, I've tried experimenting with the sample programs, but my own EA is producing undesired results. My strategy is simple. I'm watching XAU in various currencies on M15 charts with a 144 period Bollinger Band. When...
Hi everyone, I'm trying to get the EA to record when a bar closes outside the bollingerbands, then initiate a trade if this happened in the previous bar and the ema's cross or something. My code so far looks like this: int bar, sll; if( Close[0] > bollingerband ){ bar = Bars;} if( bar+1 == Bars){...
Hi, I can use 'GetParent()' within 'user32.dll' to get the handle of the current chart.  I can then manipulate that chart.   How do I get the handle of a Panel that I've created within that chart?  So   int Onit(void) { ExtDialog = new CPanelDialog; ExtDialog.Create(...  etc } How do I get the...
hello everyone, I have a problem with the app. in Search Server can not find the server that my broker gave me, that Joshua development and renco development. the broker said that to him the app these server recognizes them, so much so that he sent a photo with these servers running me. what's the...
Hi all, anybody knows how to get the distance between the last time bar touches an indicator to current indicator ? so lets say i have a simple moving average, and i need to find how many bars have gone since last time the bar touches the simple moving average until current bar. Thank you in...
I'm fairly new to automated trading and trying to create an EA that will trade a strategy that I use with Bollinger Bands and RSI. So far I have the coded the EA to trade off of bollinger bands. The program works fine the first round through when I tested it. One trade is opened and on the next new...
Hi, I am trying start me EA but it's drop error Array out of range in the below rows on some pairs: for(int j=2; j<barsQuantity; j++)      {       if((High[j]==highBar || Low[j]==highBar) && TrendSHORT)  barsQuantity set as 3000 as extern variable: p.s. if I set barsQuantity as 2000 - the problem...
Why prev_calculated jump between 0 and Bars ? prev_calculated means last calculated bars, but now only is 0 or Bars int OnCalculate(const int rates_total, const int prev_calculated, const datetime&amp; time[], const double&amp; open[],...
Hello, last time I learned how to avoid that when I write to a CSV it overwrite the same file (  FileSeek(filehandle,0,SEEK_END); )   Now my problem is that after writing,even without closing the file, it change row every time it write.  I also tried with txt file, and it write row after row.   I...
Hello Coders, I am in need of your help to code an scalper EA for period M1 for the below entry and exit criterias ( template attached for MACD/Ichimoku & williams % settings to be used) Entry conditions are as below for buy and sell . For exit criteria if a buy order is open and sell entry occurs...
  ifractals (9)
Hello to everyone, I am trying  to do a function to "intercept" the candle where it "appears" the "fractals" of "the function “ifractals" this is the code: for(int j=0; j<Bars; j++)     {     if(iClose(NULL,0,j)>=iFractals(NULL,0,MODE_UPPER,j) && iFractals(NULL,0,MODE_UPPER,j)!=0)          {...
I am developing a EA. I am new in MQL, i just want to organism my EA's input. Like below image. How i create a blank input and how i create input with space . Please some one help me coding example how can i create blank input
if the next lower bar is 100,000 bars back, is there a faster way than this to get the bar number?   //--- starting with last closed bar, find next lower low int next_lower_low()  {   for(int i=2;i<Bars;i++)    {      if(Low[i]<Low[1])         return(i);      }     return(0);     }  
Hello all. I was hoping somebody could help me with a new issue ive encountered. I can no longer run strategy tests for longer than 2 month. Heres my setup. I have a dedicated mt4 terminal that has never been connected to any server. On intstallation all of the preloaded history data was deleted...
Hi, on the attatched code can someone help me see why when i change timeframe it messes around with the objects. So i always have to take indicator off the chart then place back on again to get the objects drawn as their meant to. 
Inspired by the code in the documents, so I can go back to the current time: string var1=TimeToStr(TimeCurrent(),TIME_DATE|TIME_SECONDS); how can I subtract 3 minutes to the current time? I tried to write the code so it does not work double var2= var1 - 3;
I think I have messed up something very badly since my ea that I coded yesterday traded 36 trades GBPUSD trades in less than 1 min which would have resulted in huge losses in a real account. I've also tried it with AUDUSD where I got a pretty sweet result. After that it didn't trade at all. The time...
I want to check stopout level before place the stop loss for pending order?
As written in the title I try some ideas, to write an EA that gives me the take profit with a red or green candle without taking into cosider the pips. For example PUT signal: sent over the order with my condition and if the candle closes RED are GAIN, and I reached the Take Profit, otherwise I...
Hi Guys, I am trying to add some code to my EA so that it only has one trade open per currency pair at a time. I found this code online and tried it but I'm now getting the following errors:   Could anyone possibly give me advice on how to resolve this issue? void OnTick()               {      int...