Download MetaTrader 5

MQL4 and MetaTrader 4 - page 9

To post a new topic, please log in or register
hello, can anyone know why these two indicators show different result? Indi_A.mq4 is original code Indi_B.mq4 is my changed code // Indi_A.mq4#property indicator_separate_window#property indicator_minimum 2.0#property indicator_maximum 4.0#property indicator_buffers 4#property indicator_color1...
Hello everyone, I'd like to ask you all for some hints and tips on creating a professional style code to help maintain my trading account. I don't know there to start, but so fair this is all I have. void ACCOUNT_MANAGEMENT()  {   int AllOrders=OrdersTotal(),TotalAskOrders=OrderSelect(OP_BUY || No...
Hi, I called the code if(OrderSelect(ticket,SELECT_BY_TICKET)) everytime Start function executes.  Is it expensive to call this function everytime? I do this to populate new records to check the values in OrderCloseTime() and OrderComment(). L
Hello guys i have this idea i wish to implement into my EA, this idea involve waiting one hour after my order has been close that is either if TP or SL is hit and i have been thinking and came up with this so guy please i need your help. below is my attempt, is it correct? or should there be any...
What do I need to delete or reset to get the current build of metatrader to save all it current display settings so that when I close and open MT4 I still see all the toolbars and navigator windows setting I had when I closed MT4?
Hi!  I am new to MT4, although I have spent a few years studying, practicing, and scripting with Forex trading before I used metatrader.  Now I'm trading rather successfully with MT4 using Expert Advisors running a Virtual Server. Question: If I am running expert advisers now, and I synchronize...
I, is there a function to have the total profit of all the opened order? Like OrderProfit...Thank's Piero
Hi everybody, I am new to coding and need help to find the highest volume but keeps getting error message "possible loss of data due to type conversion". double hiVolume;    int val_index = iHighest(NULL,0,MODE_VOLUME,20,2);    if (val_index!=-1) hiVolume = Volume[val_index]; Can anybody point out...
I want to add additional symbols to MT4 and upload custom market data in offline mode for building and testing EAs. How can I edit symbols.raw symbols.sel symgroups.raw ? This is only for offline testing and optimization purposes. I am using MT4 as the engine to build/test/optimize these symbols,...
Hello, one of my EA users has problems with its initializing and working. The symbol() function returns the name, but for some reason this name does not work on other functions. MIN_LOT = SymbolInfoDouble(Symbol(),SYMBOL_VOLUME_MIN); returns no value. SYMBOL=Symbol();...Print("Attempting to open BUY...
New article Why Virtual Hosting On The MetaTrader 4 And MetaTrader 5 Is Better Than Usual VPS has been published at mql5.com: Renting a virtual server right from the MetaTrader 4 and MetaTrader 5 terminals is the optimal way to ensure uninterrupted work of your trading robots and Signal...
Hi! Please if anyone know what is this... I start my computer today.. and.. all accounts gone. I use IBFX. 1 real account and i think 6 demos at same MT4. Thanks this happen only in my office. So i have the same at home.
I've run an optimization for a particular EA, when the optimization completes i've gone to "copy all" the results to paste into Excel (which i've done many times successfully with other EA's) it copies the results but in one long row. This is happening across different machines and different...
I have an EA that I am currently using and works great. I am running one EA that looks at all of my open trades (lots of different pairs) in a loop and deals with each individually, not just the pair that my EA is attached to. The EA gets into trades but does not put a Stop Loss until it meets...
Hello, I have this indicator that use to paint the moving averages and fill the space between them with a color of my choosing but now it no longer paints the moving averages and it only paints the space between them.  Can someone help me fixing this?  Here's the code: #property...
Hello, Is there any way to send simple orders (just BUY, SELL, CLOSE) to MT4 from another computer (which is running a Java app) via IP? Don't need bi-directional communication; just uni-directional. Thanks in advance.
Hi friends I wonder how could it be possible for "MarketInfo(_Symbol,MODE_TICKVALUE)" to be equal to zero? I've written the code below to calculate the broker's commission in point but sometime it takes the zero divide error !    double commission_in_point=((commission_per_lot)/MarketInfo(_Symbol...
Hi  i wrote this: double This_Vol=iVolume(NULL,PERIOD_M1,0); and i faced this warning:  "possible loss of data due to type conversion." when I checked the returned value in Comment() I find out it is integer . so why I have this  warning? also I tried whit this : int This_Vol=iVolume(NULL,PERIOD_M1...
Hello everyone, I have internet connection problems in my area, so I am interested in IsConnected(). I was trying to test this today, but after disconnecting my WiFi and cables from internet and restarting my computer. MetaTrader was telling me it is still connected. Should I add a delay before EA...
Hello, I currently have a (raw) socket server by python/php and I want to get Tick() of many pairs from MT4 to this server. I search so many libs/dll for MT4 (WinSock, WinINET...) for this but all do not work. I would like to make each chart a socket client to connect to socket server. Then, each...
I know that the function "WindowHandle" exists. But what if I have multiple same Currency-Period charts? It will return one of these, but I would like to get the one were my EA is running from. How could I achieve that?   Thanks! 
Hello I wrote a boolean function . This code always returns false. I wrote some print order to check the program. I have the value of the deviation and the function prints the calculated value of Parameter2. Most of times it meets the conditions (Parameter2<=-deviation)  or (Parameter2>=deviation)...
With the following code, using the variable "period" (which can become PERIOD_M5, PERIOD_M1, PERIOD_H1) and the variable "long" (various integers) c = NormalizeDouble (iClose (NULL, period, length), Digits); if they were set to PERIOD_H1 and 4, I was sure I would have obtained the closing price of...
Hi, I am new on MT4. I was looking for an EA which allow me to add multiple TP on single trade. for example:  Add a Stop loss at -20 pips Add Take Profit 1 at +20 pips Add Take Profit 2 at +30 pips SO basically when Take Profit 1 hit +20 pips it start operating as Stop loss. Trade will close once it...
Hi guys, If someone could shed some light on my problem, it would be greatly appreciated. The EA is checking the EURUSD Bollinger bands (Chart it is attached to), but not the USDJPY Bollinger Bands. Can anyone see why it isn't checking the USDJPY BB's also?  Thanks. void...
Hi can someone please assist me. I have no knowledge of MQL but i have created my first EA. I am not sure if it will work and would appreciate some pointers from the experts. 
Can asynchronous order tickets be processed at the same time? Meaning can I make a trade open/modify/close request #2,3,4, etc without waiting for confirmation from request #1. "MT4 does process multiple orders at the same time and this change was made during a relatively recent update by...
Hello Group... I wonder please if someone could help me with what is probably a very trivial thing. I have created several offline charts of non-standard timeframes (ie. 35 min, 40 min, 50 min, 55 min, etc) using the Period_Converter script. I need to apply an indicator to these charts which...
All of a sudden one of my FFCal news indicators is giving this error in build 1080 using the EventSetTimer function. It worked perfectly fine in previous builds, was there something change that I am missing?