MQL4 and MetaTrader 4 - page 813

To post a new topic, please log in or register
Please anyone explain me with an examble about the function Account profit() . Thank you!
Hi all, could you please help me to make an Ea with this strategy: Open Position on 15M Candle. If Close[0]>Open[0] then open buy position whit 3% risk. If Close[0]<Open[0] then open Sell position whit 3% risk and Close the last Buy position. and Vice versa... We take 15 Pip as S.L. for avoiding...
Hi, is there any possibility that in the timeline the time of a vertical line isn't shown: ObjectCreate("test",OBJ_VLINE,0,Time[i],0);ObjectSet (name,OBJPROP_COLOR,Gray);   Because I have programmed that every 4 hours in my M15 Chart is a v-Line shown and I want to let the timeline as it is...
I recently added to comments about people not being able to create demo accounts (after January 1st I think). The problem appears several fold Demo accounts are created using (Alpari UK) current build - 409 (Oct 2011) [BUILD #s maybe different with other brokers] Demo accounts are NOT, NOT created...
Hello, how can I set an Text Label in front of an Indicator Buffer. I only know how I can make a fixed position in pixels but I want to fit it on the value of my indicator buffer. ObjectCreate("Kgu_Label",OBJ_LABEL,windowIndex,0,0); ObjectSetText("Kgu_Label","Kgu",12,"Tahoma",Lime); How can I...
New article Universal Regression Model for Market Price Prediction is published at mql5.com: The market price is formed out of a stable balance between demand and supply which, in turn, depend on a variety of economic, political and psychological factors. Differences in nature as well as causes of...
Hi guys, I'm writing an EA that looks for a Stochastic cross as 1st trigger, then looks for a gap between a 10 and 30 EMA as a 2nd trigger. I have this code working ok. finally it qualifies the Schaff indicator and this is where I'm having a few issues. Note: this is for a long trade only The buy...
Hello, how can I go, as a sample in a 1 minute chart back to the 18 december 2010 at 3:25 p.m. without scrolling? Is there a possibility to determine an exact time and go directly to this point. This would help me a lot and save a lot of scrolling time thanks in advance wunderblume
I ran an Optimization a couple of days ago, it had 385 runs, when it had finished I ran the best result on visual mode to see what the trades looked like. The end result was very much different to that given in the Optimization . . so I ran the single run again but this time with Visual mode...
Hi, I would like to get the last trades profit and loss that my expert had, how can I do that? Thanks.
Hi all, I am having trouble with my EA closing single trade positions. If I have more than 1 trade open the EA works just fine and closes trades when a close signal is generated. However, if there is only 1 trade open, the EA does not close the trade no matter how many times the close signal is...
I want to create a moving sum of the sign of the bars: an up bar is +1, a down bar is -1, on a window of adjustable size: how do I work with a window? should be extern int window=10; and then??    for(int i=0; i<limit; i++)   {     if (iClose(0,0,i)>iClose(0,0,i+1)) sign[i]=1;   else sign[i]=-1;...
Greetings all, Is anyone else having trouble with SendMail() and/or the email test tool on Vista? I have my SMTP server set to smtp.mail.yahoo.com.br:25. It had been working fine for months, then stopped sometime around Christmas. I tried switching to mail.gmail.com, but no good. I can send to my...
hello, I'm trying to call a windows form that i compiled inside a DLL. I can successfully open the form and view it, but after i close the form it stops the indicator cold and doesn't proceed in the code and refuses to work again till meta-trader is restarted. i also cant delete the dll till...
  Detect a daychange (11   1 2)
Hey guys, my next step to do is to detect a day change. I think it's very simple to do but i really don't know how to code it. Can you give me some hints? Thanks
  100 % Wins (4)
All Experts Have One Thing In Common Losses, But The Neat Thing I Have Learned Is That After A Loss The Next Is A Win... Or The Next 2 Is A Win, So How Can I Program A Expert To Just Wait Until A Loss Is Shown Not Traded
Hi, I'm a new joiner and testing one of my first strategies I noticed the following issues: 1- Printing date/time at the begging of start() method, I could see that some days in the history were missing, for example in the Daily history of EURUSD day 14, 19 Jan 2011 were not traced. 2- I expected...
Every backtest that I run starts with $10,000 initial capital. For various reasons, I would really like to be able to test with a starting figure that more closely resembles my current account balance. If the backtest was able to actually determine and use my current balance, that would be a...
Hi, I want to program an EA which is writing and reading from a csv-File from drive D:\\ I am using the kernel32.dll and can write on D:\\, but not read at the same time. Everything works with the metatrader-file functions and the "experts/files"-folder? Is there a difference to use the...
  How NOT to Hack MQL4 (12   1 2)
Having been directedto an old post about making MT4 do what you really want, https://www.mql5.com/en/forum/124688 the code below was myfirst effort. Since it is a weekend (with no incoming ticks) I thought I wouldput the code in the EA init function. What is interesting about this code isthat by...
  Trade Management (22   1 2 3)
Hello, I have a very strange thing going on in my Trade Management code. The posted part of the code is running in a loop, including the OrderSelect command. It is running on the tick. The code performs perfectly in the Tester. However running it Live, occationally it produces "Error 1", as it tryes...
hello, I have basically pasted the example in for arraycopyrates and cannot get it to return any bars. What am I doing wrong?? double array1[][6]; error = ArrayCopyRates(array1,"EURUSD", PERIOD_H1); if(error==-1) Print("copying rates failed"); else {...
Hey guys another question, I am trying to figure out the indicator side of programing. Having a few problems. First Trouble is one of the indicator buffers doesn't draw properly. A problem with buffer 3&4 which I basically want to make a Highest and lowest channel out of the first buffer... Here is...
Hi there, I'm a bit puzzled by this one. I've been running MetaTrader 4 for a couple of years now. No problems. However, I've recently purchased a new (Windows 7) machine and installed the MetaTrader software no problem. The email settings (under Options) are giving me trouble, though. I have...
Hello, I am trying to write a code so that i can work off the highs and lows of a specific bar per day.... The specific bar will be defined by time.... E.G. Just say i want to use the range of the 4 hour bar that starts at 4:00 and finishes at 8:00 every day.... obviously i wont be able to trade...
Hi, in attachment you see the source code of custom Moving average. I want to change it so that two Moving averages with several Periods combines together but the output shows only 1 Buffer. For example i have this changes for SMA mode like below: please help me what is here wrong or what should...
Hi I have a technical question about the Mt4: How were the Charts updated? If I have opened f.e. the M15 Chart, do I have, at the same time, the latest data for every other Chart? I´m asking for this, because I would like to know, if I use an EA on the M15 which uses serveral indicators on other...
Please note: I am very novice at MQL! Anyways, basically I am trying to create an indicator that displays text on the current chart based on conditions calculated from a different timeframe, i.e. in my case if previous close on Weekly chart was below 10 SMA then display "Sell" on current chart...
Hi, i would like to know, if there is a way to generate report of history (Statement.htm) to ftp (I already successfuly uploaded a file to my ftp so there is no problem). Is there some way to generate "plaintext" delimitered by ";" or ST else? Thanks for answers
Hello Everybody, My names Dave and I am trying to create a Zigzag oscillator indicator that resembles a MACD - but without the MA line. I have tried changing the code so as the ZZ appears in a separate window, THAT part worked. :) But I cannot seem to make it operate so as when the ZZ is up the...