Download MetaTrader 5

MQL4 and MetaTrader 4 - page 13

To post a new topic, please log in or register
Hello, I am trying to write an indicator to draw vertical line every spesific date on each month, example: draw vertical line every date: 14 January, 14 February, 14 March, 14 April etc... Something like this: extern string hour = "22";extern int width = 2;extern color Color = FireBrick;int start(){...
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 have a problem about debug. Could you help me? return value of 'OrderSelect' should be checked MA.1.mq4 111 7return value of 'OrderClose' should be checked MA.1.mq4 131 16return value of 'OrderModify' should be checked MA.1.mq4 141 22return value of 'OrderClose' should...
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 parameters...
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...
Hello anyone that can help. I would like to ad some programming to my EA to make it really simple for the user. I would like to have default settings for low, medium and high risk.  e.g. if the user sets the "extern bool" to true for "UseRiskPresets" and the "extern RiskType = LowRisk then all 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...
Hello Unfortunately, I decided to migrate to a different laptop with a new windows 10 installed  The manufacturing are becoming fans of 64 bit operating system. Therefore, they sell their new product with one option ( 64 bit ) operating system and backup. Means you don't have a choice to choose...
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...
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);...
Hello, I dragged the Error window which is usually on the bottom off the attatchment with the lower border. Now I cant get it to show there anymore. The only think that I found to show the errors now is the toolbox which has a bug and doesn't show the full content. Do you know how to show the...
Hello to all, I've seen several posts but no one has helped me .... I made an EA that open several orders, I wish to calculate to the whole order with a specific magic number, the algebraic sum of profit or loss in pips . I set a cycle for scanning all orders, and for each one: If buy I calculated...
Hello to all, I start a new thread to discuss more about http://sufx.core.t3-ism.net/ExpertAdvisorBuilder/ , which u can generate a EA with simply put your the trading method and logic idea. Has anyone try this before ? Currently i just build a simple vegas + sidus method EA and forward testing....