MQL4 and MetaTrader 4 - page 1041

To post a new topic, please log in or register
Hello, I have created an EA which I have done in C++. This produces the trades in a file, information stored is currency pair, buy or sell, stop loss and profit target. Is there an easy way for an EA in MQ4 to continuely read in from this file and when a trade is inserted into this file for the...
sigvardsen
  Array problem (4)
Hi I am a developer who comes from a Java-background. Therefore I have a hard time understanding Array handling in MQL. Lets say I want to make an Indicator, in the calculation of the "current value", I need to know lets say the squareroot of some "earlier values", therefore I want an array with...
Hi Programmers! I have an EA and I'm working on the optimization. Sometimes, I choose more input parameters which cause big number of optimization variation. I run the optimization. Then, the tester of the MetaTrader shows the amount of the variation in brackets: Can somebody explain me what the...
To: MT5 developers Found a bug for u guys it has to do with attempting to declare a Multidimensional Array MQL4 has a limit of 4 dimension MQL5 appears to have restrictions for local variable arrays but can declare much larger arrays in global declarations here: Everything is fine so far... but...
Different Brokers have Different quotes for EURUSD, such as EUR/USD, EUR.USD, and EURUSD2. So trying to use the market info function in the following way..... maxlots = MarketInfo("EURUSD",MODE_MAXLOT); won't return the value if you're using a broker that has a quote of say EUR.USD. Is there a way...
How many ticks will there be in 1min?
I have looked around, but cannot find quite the same problem elsewhere. If it does exist, please point me there... I am attempting to create a custom indicator which will return 3 possible values in a histogram: 1 - when I should be long 0 - when I should be out -1 - when I should be short. I have...
After making a couple of trades, and closing them out, history is not showing all of my trades, even after requesting to display all history. On top of that the history is not showing the price that a trade opened or closed at, it's very confusing, and lacking information.
How do I check through all already opened price? I tried the following, but does not work. if (condition)..... for(bcnt=btotal-1; bcnt >= 0; bcnt--) { OrderSelect(bcnt, SELECT_BY_POS, MODE_TRADES); if(OrderType()<=OP_SELL && OrderSymbol()==Symbol()) {...
Hi all, I am wondering whether somebody could help me with an advice. I would like to create my own log, which would document trading related data for various sessions with my various EAs with various brokers. These logs are to be "aggregated", to be analyzed mainly by a program for various...
I get negative profit when running trailing stop loss because the code does not account for the commission and swap, I tried the followings which don't work need help, thanks! void LongTrailingStop() { int lcnt; int ltotal = OrdersTotal(); double BuyProfit; for(lcnt=ltotal-1; lcnt...
I have programmed an EA and at certain pairs at certain timeframes it is profitable. I basically took the MT4 standard ea and changed the algorithm a bit, took out the lot sizing due to "130" errors. I can set a SL but I want the stoploss to go to breakeven as soon as I am X pips in the plus....
Can somebody please show me an example of how he/she used a buffer on a different buffer? so not the -standard- buffer on price case?
What is the best way to learn forex trading? Iwould like to start trading in foreign exchange, and I am looking fortips on how to get started with forex trading? I have looked at some ofthe trading platforms out there, and they seem quite complex andintimidating. Your help would...
so if you have made a custom indicator, and at the end of your code file you have . . . Buffer[i] = something; } return(0); } But instead of applying this Buffer[i] on price bars, you want to calculate it on the values of a different iCustom indicator. How would you do that? Other_Buffer =...
What I am attempting to do is to take the current stop loss value calculate a percentage like 5% against it to get the pinch of increase I want to apply to the current stop loss to set my next target stop loss in a trailing stop loss. Formula: NewStopLoss = CurrentStopLoss * 0.05 +...
Hy every clever people of this forum, I'm new. I've a strange behaviour of the programm in my EA. I want launch an order by Ordersend function, when "isCrossed" mets the conditions (1 or 2). But when I activate my EA only first case (in this example case 2) is running. In other words if I change my...
I've noticed IsTradeContextBusy() one of the most commonly used functions is now no more in MQL5. Is there a new way to test if the expert advisor can execute an order or not? There are also other depreciated functions that do not have MQL5 equivalents. Those are: int ArrayDimension() int...
Is there any tools help to transform mql4 to mql5?
  GOOD EAs ARE PRICELESS! (15   1 2)
A PROFIT-MAKING/PROFIT ORIENTED STABLE EA IS NOT QUANTIFIABLE IN PRICE!
Hi everybody, Maybe I'm blind but I can't find out how to change on object's name... Please let know! Thanks in advance. Dring.
hi community! can anyone help me with this error? i close an order with "orderclose", it works without any problems, on the same bar an new order is opened, also o.k., and then the EA tries to close the the same order again, it was closed before. of course now with the error output "unknown ticket"...
  MQL5... (1)
Dear Mr. Stringo: I used your ChartInChart.mq5 as an example for testing and evaluating my own EA in MQL5 platform called Trading.mq5 and advanced very well sofar. However I apply many EDIT Objects in an EURUSD-Chart and need to set data into those Edit Objects by means of a Button function on...
It's a simple EA code that brings this error ( '\end_of_program'-unbalance left parenthesis) at copilation) in line(136,4).I have try to check out for this error but I can't find ANY.Pls I need some help,I'm A newbie!I have attached the EA to this text.
I'm trying to export each final formed bar on the M1 period so I developed this script void start() { int i = 1; datetime current; string st, fn=Symbol()+"current.csv"; current = iTime( "EURUSD", PERIOD_M1, 1); while(i == 1) { if( TimeMinute(current) <...
Hi, Using period_converter script I am able to create charts with non standard timecompression. Is there an easy or not so easy way to perform backtesting of suchnon standard time frames? Regards, Michal
I need to add an indicator to an EA... I need a 3 EMA but I need to apply it to an MACD! First is this possible? Second how do you do this? Thanks for the help!
Hi all how is it going? I have a script here I need help with what I want addid is a trailing stop input, and a input to lock in pips For example lets say I open a trade and go long and my take profit is 50 pips and my trailing stop is 20, and lets say the market reverses on me before the trailing...
Hi, I am new to MT4 and just come across about the EA. Can someone advise to me where and how to select the time frame to test on the EA. Thank
Using the iMA function I can get values for various period MAs just fine. The problem is that they don't match with what the value is on the chart when moused over. What I need are the values as displayed. Here's what I get--- (USDJPY) double fast_1=iMA(Symbol(),0,MA_Fast,10,MODE_SMA,PRICE_CLOSE...