MQL4 and MetaTrader 4 - page 439

This code is straight from page (https://book.mql4.com/operators/switch) of the manual. int start()                                     // Special function 'start'  {   double Level=1.3200;                           // Preset price level   int Delta=NormalizeDouble((Bid-Level)Point,0); // Excess...
Hi I expected to get a different integer for different colors in order to be able to change the color of a label from green to gray but only if it is currently green. the code below is returning the same integer regardless of the the color. Why? and how to go about it? Thanks string lAlert =...
I have some problems with understanding iMAOnArray for MQL4. Below isscript's code, where I am trying to compare results between iMa and iMAOnArray.In my opinion, if I prepare array with prices and use iMAOnArray on the basisof this array, the result must be the same as I just use iMA. Probably...
Hi, I want to know current profit for each chart. I set 2 EA in each chart. USDJPY EA1 and current profit $12 GBPUSD EA2 and current profit -8$ ======================================== In this case, Account profit() =$12+(-$8) =$4. (total) but I want to know each chart profit separately not total....
Hi, does anyone have read these books? someone could help me to find similar book or better?? Thanks!!!
Hi, I'm trying to create a custom indicator that calculates the lowest highs and highest lows over a certain period and shows it on the chart as a line. It's based on an arrow indicator I've created myself that shows dots as support and resistance until a new high/low is formed. (you can replace it...
Hi everyone. I am reading through the MQL4 manual step by step just trying to make sure I understand each section as much as possible before moving on. I have some code here taken directly from page (https://book.mql4.com/operators/break) of the manual: int start() //
I test more than 3000 EAs and i never came across something like this. I know EAs can be very different in real world than in backtest because of slippage and spread, most of these are short term trader. But I found a long term swing trader that uses tp and sl, no martingale and is profitable with...
Hi all, I am trying to add a components to my current indicator so that it doesn't return any sequential highs or lows. At the moment, the indicator returns a key high or low based on the 'Get Signal' code, but, I would like to add code which wont allow sequential highs or lows - so if the indicator...
hi i m new to coding world i need help i need some one kind who can guide me a little i m working with loop how i will stop my loop i want to reach to a spacifi candle on which indicator showing arrow i can stop loop to very next candle aftr arrow candle but i can not stop loop after unlimited
Hello all I'm new here this is my first topic, I already find all information about the subject in google so on in forex forum but I didn't find the right one can you all help me? Below is my code I want to make it available to close auto trades like EA in EA not just manual trades. input bool...
Here's what I have come up with so far. I need to get the order which got market executed: 1) Its entry price. 2) Based on entry price, do the 25 points distance. (Entry price of market order which got executed - 25) 3) Execute a SellStop order, with inputs entered (Lot Size, TP, SL)...
I was wondering whether there is a minimal amount of elements a dynamic array must have in order to work. This because I’d written a code which started by making a dynamic array of 10 elements and then it started reducing that number to 1. This did not work though, but when I changed the minimum of...
Is it possible inside an EA to detect that the user has changed the parameters of one of the indicators? My current solution is to embed the parameters in the short name of the indicator and then check every second inside OnTimer(). Is there a better way to detect changes to the indicator
I need to read a CSV file like the lines bellow and load in the a structure to access bellow. What is the best form (function maybe) to read and save the data in this structure, I have many lines to read. The file is stored in "..\MQL4\Files\file.csv" directory. I have a CSV file with many lines:...
Hello, Probably this is a question made by many of you already, I want to use the same EA for all symbols on my marketwatch with same parameter and same timeframe, do you have any ideas of how to do it
Hello there, My strategy consists in sending a stop buy order just at the 00.00 (GMT(0)) hourly candle 2 pips above the previous high, and another stop sell order 2 pips below the previous low. I want these two orders to be sent just once for each 24 hours, starting at 00:00 (GMT(0)). At first it...
I'm having an issue with my EA. Although it's doing very well it's not obeying all my conditions all the time. I have a variable named "gap" and my EA should not make trades on currency pairs when there relative strength and weakness are in a certain range to one another. Example: the AUDJPY, the...
  mql4 chart  (1)
hello. how can I drawing line in a single pip a smooth line in chart which kind of chart operation can help me I don't know how can I show massages or chart in window char in mql4 if can help me I'm rly happy tnq ;).
Hi, I'm trying to create a custom indicator that displays certain levels on a chart. Based on a few custom indicators I've created. The idea (picture below): when price moves above HighLine (the green line) and forms a newHIGH (red dotted horizontal line), it needs to display three levels based on...
Hi, I have been programming in MT4 for a couple of months now so forgive my silly question. when I test a strategy I notice that occasionally there is a slippage when opening some positions (long or short) and they coincidentally are equal to the current spread I set in the tester. I know the...
I am working an a indicator that gives me certain information about the currencies I trade. One part of this is the amount of Margin Used to open a trade. Market Info(NULL,MODE_MARGIN REQUIRED) works just fine as long as the "quote" part of the symbol is USD but it does nothing if USD is the "base"...
I am going step by step through the manual and have become a bit confused at this page - https://book.mql4.com/operators/continue. My question should be pretty simple for anyone who understands these loops and where control should/shouldn't be passed to next. Here's the full code
I'm trying to make sure I have the right coding to check and execute a possible close of position After a new bar from opening a position. Can anyone confirm if this code is good. It seems as if each time it checks for close, it would set the "currentbar" again to datetime? void CheckForClose() {
I have some long strings of data that cannot fit in mql4 or would be needed to be imported after it is compiled.  Is it possible to have ex4 read data that is encrypted?    The idea is to have the data read from external source and then stored in an array such that no intellectual property would be...
  hello.mql4  (3)
hi when I use this #property description I see an error 'description' - expression expected firstone.mq4 10 11 its can for lib and if I must download any things where I must give them? I'm sure for mybad typing I'm not engilish :D
Good day to all, I've coded an EA that checks the trend on daily timeframe using a 200 sma  and enters trades on H4. Trend checking logic contains the following code: string CheckDailyTrend(){   // Moving average   double DailyMA = iMA(Symbol(),PERIOD_D1,Daily_MAPeriod,0,MODE_SMA,PRICE_CLOSE,0);...
Dear All, Couldanybody tell me if it is possible to input own data manually twice a day intoMT4 and display them as a line either in the main window, or beneath it? Iwould like to do it for several currency pairs. The data has nothing in commonwith the exchange rate of any currency. Will be input at...
Can I use a gmail address to receive alerts from MT4?  Does anyone know the server info? I tried looking for it but there are many options.  Thanks everyone
[Deleted]
Hi Can anyone explain me the difference between .ex4 and .mq4, except the fact that the mq.4 is redable and not the ex.4. When I create a new EA, it is registered as a .mq4 file, and doubled by a .ex4 file automatically created when the mq4 is compiled. I personnally use a professionnal EA on my...