MQL4 and MetaTrader 4 - page 426

To post a new topic, please log in or register
Hi, I am not a coder but have been trying to learn over time, so please bear with me (and be gentle, lol). I have an EA that trades off the highest high and lowest low over a period of Monday H1 bars. I want to test this EA on open prices only (not every tick), but am having trouble modifying the...
example function to initialize buffers So I might want to pass ENUM_INDEXBUFFER_TYPE as INDICATOR_DATA, or as INDICATOR_CALCULATIONS but I cant use it like a variable data type, is there another way of doing this or do I need to learn something in mql5 ? void initbuffer(double &array[],...
Please note that there is a bug in the new MT4 build 610. Whenever an indicator uses DLL function calls and is attached to a chart, it is reset to default settings and reinitialized if you compile any other indicator, expert or script in MT4. Here is how you can recreate the bug: 1) Attach the...
I tried to debug EA on 1 minute chart but MT4 starts automatically 1H chart and it is not possible to switch the time frame afterwards. Is there any method to overcome this ?? My EA uses Time commands which on hourly chart return hours not minutes as wanted. I tried to save new default.tpl as 1 min...
Hi MT4 I have tested OnChartEvent() function with simple code found on help first operation I have set this: bool idCreate = ChartSetInteger( 0, CHART_EVENT_OBJECT_CREATE, 1 );bool idDelete = ChartSetInteger( 0, CHART_EVENT_OBJECT_DELETE, 1 ); then...
int start(){   if ((100+TakeProfitPct)*AccountBalance()/100<=AccountEquity())   {      bClose= true;   }      if (bClose)   {      CloseAll();      bClose= false;   }}void CloseAll(){   for(int i = OrdersTotal() - 1; i >= 0; i--)      if (OrderSelect(i, SELECT_BY_POS))         if (OrderMagicNumber()...
Hello people hope you can help, To install Renko live charts expert advisor v3.0 or v3.2 with build 610 of MT4, does anyone know if this is possible because it doesn't seem to work. I use a 1 min chart and get the smiley face with v3.2, I then create a 2 min offline chart and get a blank screen...
Can someone help why I am getting the Access violation write to 0x33000004 in my program tthis is the code inside the OnTimer event. //create the signal pointerCSignalData *signal = new CSignalData();//read and populate the valuessignalSource.Read(Symbol(), signal);//read values from signal and use...
There is   long handle=ChartOpen("EURUSD",PERIOD_H1);   if(handle!=0)     {      ChartSetInteger(handle,CHART_AUTOSCROLL,false);      ChartSetInteger(handle,CHART_SHIFT,true);      ResetLastError();      bool res=ChartNavigate(handle,CHART_BEGIN,0);      if(!res) Print("Navigate failed. Error = "...
hello my friends i need other function win API about file exist or no Kernel32 or other i do not want FileIsExist mq4 5 function please help me
Hi, the new tester in the build >600 seems to have a bug. Possibly the tick-Generation is not precise enough. Here 2 screenshots: Old build 509 is working correct, the stop has released when backtesting the FDAX, the spike on last Thursday. Here the tester of build 604, the same EA / same strategy...
Does anyone has had problems to run 2 MT4 at the same place VPS ? I can't anymore test in paralelle 2 MT4 on the same VPS. The second MT4 doesn't take any trade. The 2 MT4 apparently works well but in fact only one runs. The other makes anything. Olivier
Hi, I need help on the attached custom indicator. Every time I attach to a chart in hangs up the MetaTrader and I'm forced to close it. What is wrong with the codes??? The indicator is to determine the Maximum and Minimum price at a given number of bars.#property indicator_separate_window    //...
Here is my little problem I want to make it clear that I am NOT versed in programming. I am way too old for such things. I am an active trader using EA's and all I've done is written instructions. That I can do, so much learning was easy. The Problem: All of my EA's execute ONE trade per candle....
Hello, Are there a difference between MQL4 and MQL5 today? And if so which one? Regards,
There are more ways to do things now. e.g. charts.mqh Is it possible to automate the DAT and HST builds? i.e. if you backtest 1 min data, then 5 min data then 15 min data etc ........ you create levels of data that allow for consistency. Thus you are likely to avoid "missing data" errors when...
  [index] (3)
hi again, had a doubt on how the prices are stored. correct me if i am wrong. open[0] would give the open price of the bar currently in progress and open[1] would give the open price of the last bar. What about close[0] does keep on dynamically update the current tick price? and would close[1] give...
Hi all, I am tracking the correlation between the FTSE 100 and S&P 500 on a daily basis, I am only playing with demo cash at the moment but it looks really good :) so my question is where is the punch line, at what point does it all go pear shaped? I wait until there is a deviation > 1 (normally 1...
I've an old but good smartphone with Windows Mobile 6.1 I remember I was able to use MetaTrader with it, but after I reformatted the smartphone, I don't know how to re-install it. The best I could reach, was a file that gave me an error message ("impossible to find part of the program"). Can someone...
Hi, I realized something odd that I hope it'll disappear soon! I have on mt4-b610+ one chart (EURUSD) and one indicator. If I kill the mt4 and launch it again ou of its editor (F4, both in /portable - I checked Mt4-> Files-> Open data Folder) the indicator does not show any of its lines or values...
Hi, I have problem with ChartID() function. I thought it must be unique for every chart but if I call this function on chart which uses template with a particular id value <chart> id=123456789 comment=... </chart> then ChartID() gives back this value (123456789). So if I use the same template...
what is the formula that meta trader use to calculate the balance? thank's
Hi guys, if a trade was closed i want my EA wait for opening a next trade till 5 bars were finished. How can i do this? How do i get the time of the close of the last trade and how can i compare it with the bars? Thanks guys
Hello. Until now I have been using MT4 on my windows xp desktop machine. For traveling purposes I bought a notebook with windows 8 and installed MT4 in it. When I decided to copy my scripts from the windows xp machine and past them into the notebook, I noticed that I couldn't do it because I could...
I have tryed to install a robot who has two files one ex4 file that i droped in experts and one dll fil I have in libery but when I open tradeplatform they are not there.To test I have dowload four normal indicators but cant see them when I start metatrader4. Do you guys know if maybe some settings...
Hi everyone, I have an EA which opens 2 trades simultaneously for a pair. i have also ensured that when a pair is trading, no new trades on the same pair is opened but trades for other pairs are allowed. simply put i want a maximum of 4 pairs (8 in total) to be traded simultaneously. 1. To avoid...
hello please help me i want to find method for close my trades from my indicator by Win API or find method for call script or EA by indicator thank you
Ok i have a question regarding the timer function, when a timer elapses the OnTimer function is called, suppose i have a timeout of 3seconds and the timer is triggered and my EA takes more than 3seconds to run, is the timer function going to trigger even if the other function is not yet finished, it...
I tried to search for a similar problem, but couldn't find it. I use a snippet to read an URL from MetaTrader, found here: https://forum.mql4.com/60608/page2 This works when I put the code in the OnTimer (or OnInit) function, but not when I put it in a own function which I call from the OnTimer...
Hi guys, Can anybody help me out? I used to have an EA that make use of kernel32.dll's CreateFileA & WriteFile function to output a textfile to my desktop. It was perfectly working before build 600. After the patch, the EA could not output the textfile anymore. I understand that FileWrite()...