MQL4 and MetaTrader 4 - page 344

To post a new topic, please log in or register
Hi,   I'm just wondering if already exists a "protection" agains account blow up. For example, We know there are a lot of EA Robots that make a lot of money then in a few hours they blow up your account.  Since most part of them are martingale/grids I was thinking to create an EA when the account...
Hello Experts! Is it possible to create an EA whose onTick() function is called whenever a new tick arrives, no matter what is the currency of that particular tick? Based on my limited mql knowledge, an EA is only 'listening' on the chart where it is connected to. So if I place an EA on the EURUSD...
Hi please forgive my dumb question as I am new and learning. Have read a few books but cant find the answer to this question.  When making a trade on MT4 Is it not better to sell by Market all the time. My reason is as I write this CHF/JPY shows 118.330sell/118.357buy. If I click sell by market I...
Hi, I'm having some issues with array sorting and ArrayMinimum() and ArrayMaximum().  Not sure if it is Update related or ME related. I'll stick to the basic issue for this post - Min and Max are not returning correct values for me.  Notice the printout below. The minimum is zero rather than -1.0...
Can any one show me how to create the current 5 min candle with this code?//+------------------------------------------------------------------+//|                                                  MTF Candles.mq4 |//|                                       2007, Christof Risch (iya) |//| Shows...
Is there something like a hashset available in mql4? Like to one in Java. I want to add and remove items, and iterate through the items. Sorting is not required. Thanks in advance.
Hi guys, I can't seem to access the MT4 trading platform. It's always displaying "No Connection" at the bottom right corner, and Im not sure how to continue. I've tried making an account, but there aren't much options to choose from and I can't get past the "scan" screen. Can I just access the...
Hello,   I am trying to write EA which will change lot size depending on number of losses. Is there a way to count StopLoss execution in MQL4?     Regards 
So I have touched on this before briefly in a fairly old thread but I am not wanting to come up with an efficient solution to this issue. The programmers at FXCM have emailed me saying that I need to use: Print(" -- Tick Size is: ", DoubleToStr(MarketInfo(Symbol(),MODE_TICKSIZE),5) , " -- Tick Value...
Good morning I want to try and access the LOG files and have read about using routines in KERNEL132.dll (https://www.mql5.com/en/articles/1540) and this looks useful but I am trying to figure how to retrieve the path to the file In Older builds everything appeared C:\Program Files\MetaTrader4....etc...
The mobile terminal of MT4 have thepossibility to close order partialy. Is it possible to close orderpartialy from the PC terminal (and how) or by EA?
Hey everyone,   I'm developing a simple MACD cross buy/sell script, but when I run the tester, it opens a buy order for some lots, and then nothing happens. Prior to the script completing, the single order is then closed. Does anyone know what's going on here? Thanks. Here is the output journal:...
Hi Guys,     Appreciate your reply on this. Thanks in advance On D1 time frame, every bar in MT4  start with 00:00 (eg, 2014.10.31 00:00)   so for 2 different assets, regardless of market opening time Asset 1: iOpen[i]  happens same time as Asset 2: iOpen[i] ?   How about iClose[i] This has been...
Hi Guys, Due to the asynchronous opening and close time of different market, what's the function to extract the Close at certain date and time eg close at 5.00 am for #NKD and USDJPY Thanks in advance ShinjiOno
Hi  I am using the following command in a script and it is working correct with one of my broker account.  Today I opened a new demo account with another broker but the same script is not sending the order and I am also not getting any error code.  I have checked the options in mt4 Allow DLL and...
I am trying to find the first open price from several open orders and symbols.  Below is my initial attempt.  Need help getting this to work. /***********************************//Finding the First OrderPrice for a bunch of orders and symbols***********************************/ int...
  OrderClose() (7)
I get this warning for OrderClose() return value of 'OrderClose' should be checked void macdclosetrade(){      double faster=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,1);//MODE_MAIN   double slower=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_SIGNAL,1); //MODE_SIGNAL   double prevfaster=iMACD(NULL,0,12,26...
Hi all, I have just started trading an ea on my live mt4 account through ic markets. In the demo account and strategy tester the ea worked as expected with stop loss taking effect as soon as the position moves in my favour, rather than waiting for the position to become profitable. I have read in...
Hi quys, I think.... how precisely identify close position on target price, or stop loss price. Because condition as OrderClosePrice()==OrderOpenPrice()+OrderTakeProfit() (for long) isn´t reliable code for very quickly market or gap...   I don´t know that OrderComment() by closed order is the same...
How does one determine the direction (up/down) of the current bar. Close[0] > Open[0] should work but Close value appears to be empty until the bar is complete. I imagine I should be trying to get the most recent value rather than Close. How can I do that?
I want to calculate MA of RSI . SO far I could come this far with this code: double rsi[];     for(int i=0 ; i<=100 ; i++)    {      rsi[i]=iRSI(Symbol(),0,14,PRICE_OPEN,i);    }          ArraySetAsSeries(rsi,true);   double ma=iMAOnArray(rsi,0,5,0,MODE_EMA,1);   Print("MA value ",ma); but when I...
I want my ea to open buy with iccI indicator.for example i want the code to be like this if icci indicator is above 100 and less than -100 then greater than or equal to 100     ( OPEN BUY) Please can someone help me. Below is the image of what I want the code to perform.
Looking for a method to save the current Chart Template to overwrite the name of the template in use. Whilst saving the current chart to a template is simple I'm still perplexed at how to capture the name of the template in use.  It seems that there is no method such as "GetTemplate(ChartID)", as...
I've been programming and testing strategies in my spare time just for fun, but lately a problem with MT4 has made it impossible.  When I run a backtest, change the parameters, and run a backtest again, the second backtest frequently uses the parameters from the first one and so it gives me the...
Yo, I want to take order one by one. I mean when one order is open, he can't open an other while the other is still open. And i don't want that he can close an order until a few time has spent between the order open time and one hour (by exemple) So i wrote a code and It seems It works only for the...
So I am wanting to incorporate ADR into my algorithm and have picked up a public indicator rather than spending time writing it myself. Does the trick for what I am after. //+------------------------------------------------------------------+//|                                           Daily Range...
Hi Coders! I have an .ex4 file (Expert Advisor). How can I decide it use MQL4 or MQL5 library? Thank you in advance. Relative
With the new recent updates, I am unable to choose the broker of my choice. It randomly opens any MT4 broker. Before we had the choice when you could choose the broker & a/c #. Please advise. 
Hello,  I'm trying to install an Indicator in MT4 and can't locate the "Experts File/Indicator" file on my machine.  Any ideas? 
Hello, please see these official prototypes: a) int  ArrayMinimum(    const void&   array[],             // array for search    int           count=WHOLE_ARRAY,   // number of checked elements    int           start=0              // index to start checking with    ); b) int CArrayDouble:...