MQL4 and MetaTrader 4 - page 718

To post a new topic, please log in or register
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...
Hi, Can someone please tell how to put some text vertically or diagnolly starting from the High of each bar on the current chart I tried below code but it it showing somewhere in the middel of chart. ObjectCreate("test",OBJ_LABEL,0,Time[1],Close[1]);ObjectSetText("test",DoubleToStr(AccountBalance()...
  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...
When I write: OrdersTotal()==0 at EA this mean that no orders are open for this symbol or for All symbols? and if it is for all symbols how can i specify it for the symbol which I run the EA on it??
Just had a noob question that I'm sure has been asked a hundred times over. Nevertheless, I am asking it again hoping someone can just answer. I'm using the MarketInfo("USDJPY", MODE_POINT); function, and my broker, IBFX, is a 3/5 decimal broker. I tried to use a Comment(Point); and also:...
I am clueless on why the strategy Tester Bid price should pull the current Live Bid into the Strategy tester. As a work around I can use Close[0] as a fix, but would like to know why Bid, is not useable. It then brings into question backtesting of Bid in EA calculations.
New article The Role of Statistical Distributions in Trader's Work is published at mql5.com: This article is a logical continuation of my article Statistical Probability Distributions in MQL5 which set forth the classes for working with some theoretical statistical distributions. Now that we have a...
  ima and imacd (2)
ı try to mov on macd for signal, how can ı write it on mql4 ? for example MOV(MACD,3,E).
  MB TRADING (7)
I have created an Expert Advisor from this site http://sufx.core.t3-ism.net/ExpertAdvisorBuilder/index.html which only works on MB Trading MBT MetaTrader Strategy Tester but not on the Live Trading Session. Why is this so?
Do time frames always matter? For instance say I have a strategy that enters a bull trade if a doji star appears in an uptrend and a bullish trade if a doji star appears in a downtrend on a 4Hour chart. If you I use a 1minute test in the strategy tester, should I get the same results if I tested it...
I have been spending a lot of time trying to correct a StopLoss and TakeProfit problem.My Broker doesn't accept the StopLoss and TakeProfit in the same line of code as the OpenOrderBuy or OpenOrderSell. I have been very frustrated with this because of 2 reasons. I am not an expert Programmer and I...
Can someone spot what is wrong with my code. I only have one place in my code where any division is being done but I continue to get zero divide errors double CalculateLotSize(double EquityPercent, double StopLoss ){   //Code to Calculate lot size                     // Print("AccountEquity():...
Hi, Im new to MT4 and I want to write an EA, can someone please give me the cod or point me in the direction of a simple EA that triggers a buy or sale order when say the 2 lines of the Stochastic indicator cross above or bellow a level ( i.e 20 % or 80 %). Thank you,