MQL4 and MetaTrader 4 - page 207

To post a new topic, please log in or register
Hi all, I want to forward test daily data but Pepperstone's tick data goes back until only 2009, not enough for several walk forward passes using at least 3 years for the sample data. Perhaps I could use a broker on MT5 like Alpari, but how do I know how reliable their data is?  A search on forums...
Hi... I need to limit number of opened orders in an asset AND limit one order per candle too. See my code... it's allowing more than one orders per candle. I fixed it to allow 2 orders, but only one per candle: input bool LimitBar=true; // Limitar 1 ordem por vela?input int MaxOrders = 2;int...
Hello, I would like to print some information received form an external library. The best thing I have gotten working so far is passing an array of chars as a parameter and modifying each position individually. Is there a simpler solution? Like returning a string from the DLL or modifying a string...
Hi All, I am trying to create a moving average indicator of the OBV. However when I attach it to a chart, it grinds MT4 to a halt and sometimes even crashed MT4. Am I doing something fundamentally wrong here? I tried to first use iMAonArray and when that did not work, then tried to do it manually,...
In the following Indicator I fail to see why I cant here the PlaySound sounfile ive assigned to the SoundFile object? Also it appears to overun my CPU? // Turning Pivot Alarms On/Off Input Variablesinput string SoundFile = "alert...
Hey there, attached you´ll find a screenshot which shows a white rectangle (OBJ_RECTANGLE) and some light blue lines (OBJ_HLINE). As one can see, the lines turn to light yellow when they cross the rectangle, which looks kind of "dirty". I could not find any option/parameter to turn off this kind of...
Hi,  I have an indicator which works very fine in live test. It has to calculate quite a lot and draw some objects in the chart. But when I do a visual backtest, the indicator sometimes starts showing me the right objects and after a time it shows nothing. Could it be, that the OnCalculate function...
Could someone tell me why the code below only closes one open trade per bar? e.g. I have two open orders. On each new bar ClosePending() is called. However, only one will close this bar and the second closes the next bar? Thanks in advance. //---------------------------Close Pending...
all pending orders should be deleted if an active order is available ... what I'm doing wrong? for(pos = OrdersTotal()-1; pos >= 0 ; pos--) if (OrderSelect(pos, SELECT_BY_POS)&&  OrderMagicNumber()  == Magic&&  OrderSymbol()       == Symbol()){nOrders++;}if (OrdersTotal() > 0 &&...
I am wanting to close a pending order (assume we are only talking about a OP_BUYSTOP here) if the (iMA-iATR) > OrderStopLoss() on every H1 Close calculation. If that is true, then delete the order, and send a new order out with the new calculations based upon where the stop should now be on the...
Hie Guys, May anyone help, Iwould like to code a Line that Closes/Deletes a Pending order, if not triggered,after a certain period of time (say 20 seconds). I have inserted question marks(?????) in the code below,indicating where I would like to insert the line. //----- OrderSelect(cnt...
Hi Guys,,apologize me if my english is bad,,I'm from Indonesia,,and I want to make an EA but I got the problem How to close all opened order and all pending order if one of the opened order is already take profit? I'm very appreciate for all the forum to help me :D thanks.
Dear all, I am creating my system to open two pending orders - BuyStop and SellStop Next, I want it to Close or Delete one of the Stop order when Buy or Sell is executed. Example: Case 1: BuyStop and SellStop are Placed BuyStop is executed - Buy. Then, SellStop should be closed. Case 2: BuyStop and...
Hello  I am looking Elliott Wave tools for mt4, such as the video https://www.youtube.com/watch?v=6TNAdYmmuTk  or something similar Thanks   
Hi, I have got some problems with introduce my conditions in reality. If any good person coul help me a little bit, I would be very gratefull.  How to convert these conditions below to code? For example every candle is 1H candle-> -positions can be opened from e.g. 08:00:00 to 21:59:59...
OP_BUYLIMIT Order placed at 1.09516 with Fill Price at 1.09264. Error says Fill Price is invalid but it looks correct to me. HELP. Thanks, Jim
I've issued an OrderSend as an OP_BUYLIMIT and received an Invalid Price error. The Ask Price and Entry Price: 1.09516, The Fill Price: 1.09264. The  SL Price: 1.08944, TP Price: 1.09644. These prices seem correct to me so I don't understand the error.. Thanks, Jim
Want to ask a problem, how to read today high and today low before certain time? ex: today high and low from 0:00 to 13:00, on 13:00 make a decision. already tried double todayHigh = iHigh(NULL, PERIOD_D1, 0); but didn't do anything double todayHigh = iHigh(NULL, PERIOD_H1, 1); open in wrong desire...
HelloInitially desculpelo for bad English. I am with following problem. I write this code: extern int MagicNumber=10001;extern double Lots =0.1;extern double StopLoss=60;extern double TakeProfit=30;extern int Slippage=3;int operacao=0;int ThisBarTrade=0;double resetlots=Lots;int resultado=0;int...
Hey guys, before starting i want to apologize for my bad english. I will try to explain my problem and hope you can understand me und help me. With this code below my text i'm trying to scan a lot of forex pairs from one chart. The code should run the main part only in the first minute of an hour...
Please find the below code and here's the problem: datetime fromDT ="00:00",            toDT ="07:00"; int      fromBar = iBarShift(NULL, 60, fromDT),            toBar = iBarShift(NULL, 60,   toDT),           length = fromBar - toBar + 1,            HHbar = iHighest(NULL,60, MODE_HIGH, length,...
I try to test my EA and problem is I don't know how to create testing scenario logic is - if indicator A got value N and indicator B got value M - open position in real life i need to wait hours to get this match and ops error in code, fix and wait again  is there any way to simulate market for...
We haven't seen any changes since the 950 build on 22nd December 2015. Does anyone have any idea of when the next platform build might be released ? I'm asking this because I have a pending enhancement for querying the Windows Scaling that was implemented a few weeks ago.
I am trying to code an EA, that will check for certain criteria across multiple currencies, and if they are satisfied open a trade. To try and get the code to work the only criteria I am currently using is open a new bar (I'll add more when I can get this bit to work). I'm also limiting it to 3...
Hi can anybody suggest why the envelopes are not showing when I drop this on a chart? I believe I have coded it correctly ?? Thanks 
Hi,  Can anyone suggest a fix for this compiling error on the || or statement:  if(PriceHighBack>=BolUpper && PriceMedian<BolUpper || PriceHighBack>=BolUpper && PriceMedian<PriceMedianBack) I get this compiling error: check operator precedence for possible error; use parentheses to clarify...
  Client API (1)
Hi,  this is directed to MQL4. Is it possible to get a free API for some currency pairs and gold prices in various currencies?   thank you   Jack 
Hi, everybody. Had this ea but i want to opposite of that ea. When it buy i want SELL and when it sell i want BUY. And i don't know what should i change. :(   Help me please!!!      //+------------------------------------------------------------------+//| Script program start...
hi. i run my ea successfully on several broker platform (4 or 5 digit ) , but when i run it on windsor platform i have this error. for windsor the symbol is named as " EURUSD@" as below picture , and the error code is:     and the error code refer to : ================================== and if...
Hello to all, I have a problem with iMA function for calculating the moving average. The function almost always returns the correct value but in some cases of some currencies returns to ZERO. I am making a simple calculation of the moving average of 200 periods eg. SMA200 = iMA (Symbol iTFMinute,...