Download MetaTrader 5

MQL4 and MetaTrader 4 - page 724

To post a new topic, please log in or register
Can anyone help with this code im trying to make it enter a trade when the 2 LWMAs cross and #3 ema confirms trend but for some reason the LWMA crosses dont work, can someone look at the code and tell me where i went wroung?...
hey im new to this forum i see alot of good systems on here with good results, can anyone point me in the right direction of ea building, as in which strategy is best used for long term consistent profits e.g. indicators, price action or hedging. as of right now i built a simple ea that crosses 3...
//+------------------------------------------------------------------+//|                                                   Prodi5MAs.mq4 |//|                                    Copyright © 2011, PRODI GROUP...
So... the other day I whipped up a little genetic algorithm to find systems and then I remembered that the Strategy Tester has a genetic algorithm checkbox. So... would it make the most sense to write an EA that took inputs for Indicator1Type, Indicator1Mode, Indicator1Period, Indicator1Type,...
I have been experimenting with adding an additional index array to a modified iAO(). The new index is not intended to draw anything. Instead, I want that index to return a 1 if the "up" buffer has received the MACD value, and -1 if the "down" buffer has received the MACD. My thought was that,...
  #define vs global (11   1 2)
Is there any advantage to using #define instead of a global variable? My gut tells me that a global variable can be changes but a #defined variable can't. Is there any other thing to consider?
I know what is "SELECT_BY_TICKET" in OrderSelect(), but how about "SELECT_BY_POS "??? thanks for your help
I read http://geosoft.no/development/cppstyle.html#Naming%20Conventions so that my code can look like others. Now I can't figure out how to name something to coincide with Conventional naming. I know that I can do it any way I want, but I would like my scripts to look like the experts, so that...
Hi Noob here, From lesson 13 of the forex.tsd site I toyed with this just to learn to code and make it do different things for practice Also changed if from EMA cross to MACD cross Here is what I have simple macd cross and attempting to make a 5min with 4hr MACD agreement EA just to learn how. http...
Is there a way to check for this error before a trade is actually attempted?
Hello coders, I am still relatively new to coding and I am writing an EA that does pretty much what i want it to. It opens trades when I want it to, it closes them when I want it to, etc. However, I have run into a wall. I want the EA to have a maximum of 2 open orders at any given time. If there...
Is there away to tell metatrader to "Stop Trading when not enough money" in the account? ...and to wait for ACCOUNT BALANCE to increase. Currently I get multiple warnings as I forward test "M-NOT enough money to trade". margin is insufficient to trade a lot size of 1.6". After a while my account is...
  Adding Color to an indicator (33   1 2 3 4)
I would like to print a red square (small) on the chart when the next higher time frame is going down. And a white square if it is going up. How do I do that? Once I get that figured out, I can then add other time frames and different bars. my code so far is: // 30 min current double open.30...
Hi I wonder if anyone can help? I've tried to download Meta Trader 4 demo a/c but when I get to filling in personal details I find that it will not allow me to fill in account type or currency boxes which are blank and of course I can get no further! I have un and reinstalled the programme and...
Forex EA (Expert Adviser)Forex Robot Programmer Developer Hi,By Profession Im Software Engineer. But fromlast 7 years Im in Forex Trading. I 've developed many more Forex Robots EAExpert Advisers, and distributed to client as per given criteria. There are somany satisfied clients. If any one wants...
  EA Fault (20   1 2)
I am using an EA on alpari with 402 build that works ok,i have installed the same EA on fxpro same 402 build but it will not work,Where should i look to find this problem,i have no coding knowledge. Thank you
I have some code that are supposed to do two things as soon as the first Buy or Sell order closes at a profit: 1. Reset a list of variables back to zero 2. Delete any outstanding/exisiting buy or sell stop orders I just cannot get it to do these two functions and i need some help since i cannot...
I'm new to MT4. I have 2 include files (file_1.mqh & file_2.mqh). They are both general purpose functions, but for organizational purposes I would like to keep them in 2 files. Each file uses a function in the other, so I always get an error saying "some_function() doesn't exist" when I try to...
Hi, I would appreciate some help on the two issues described below. If a user drags and drops an EA to the chart, is there any way for this EA to find out the exact time/price where the user has dropped/released the EA on the chart? Another question: can an EA make some kind of call to the user...
Hello I create trading ideas in Excel and then write an EA based on these rules. I am stuck however with Average Deviation. This yields different results than Standard Deviation but I do not know how to write it. Here is an example of the Excel code and I would be very grateful if someone can...
I know this is a weird question, but I'm trying to figures out what kind of things are possible in MT4, so I'm experimenting. If an include file has errors saying that a variable is not defined, but it is defined in the mq4 file that #includes it, will the script or indicator still operate properly?...
I use the #include statement in an MQ4 file to #include an mqh file. When I compile it, there is no error. I then go the the mqh file and put in an obvious error, but don't compile it. I then go back to the MQ4 file and compile it again and there is no error. That tells me that the compiler...
I am working on a strategy the places trades on multiple pairs. I use MarketInfo("GBPUSD", quantitative variable),MarketInfo("GBPJPY", quantitative variable),MarketInfo("EURJPY", quantitative variable) etc... to retrieve info for all pairs and I send all the required info with the respective...
Can I use price overlays on the charts?
So i am just starting to learn MQL4 and i have read couple of tutorials. So can someone give me general directions how to code Parabolic SAR and set that MT opens position whenever SAR shows trend change. And second thing is that MT opens position 10 times my balance. Thank you
I need to run MT4 in Linux OS, I know this can be done through a software called WINE which allows to emulate windows' software. However, I also need to know if MT4 can be run in some sort of "batch mode", I mean, like a command line (e.g. terminal.exe -optimize) and execute optimizations from...
Hi all, recently I've developed a EA in MT5 and would like to transfer the transactions done in MT5 to MT4 through a set of programs offered in https://www.mql5.com/en/articles/189. It composes of 2 programs, one each in MT5 and MT4. The bug that I have found was in the program in MT4 so I would...
When I compile my code I get an error that says "ErrorDescription": function is not defined. I used it in my code to place buy and sell orders and I forgot to put the preprocessor #include<stdlib.mqh> which is the library that has the defined ErrorDescription() function. But for some reason when I...
Hello, I am currently developing an EA, but I have a little problem. I would select the last trade in the history (closed) Type Buy or Sell and recover its profit and its type. I made a small image to more clearly explain my goal. I could do some research, I try to make a loop with...
Pls help me write a string of code to calculate the MA of an indicator. This is what I have tried so far: for (int a=0; a< MA_Period; a++) double CCI = iCCI(NULL, 0, CCI_Period, PRICE_CLOSE, Current + a); double MA_of_CCI=iMAOnArray(array[CCI], 0, MA_Period, 0, Ma_Method, 0) ;...