MQL5 Tutorial

MQL5 Tutorial

By Raimund BauerBusinessTechnologyInvesting
Download on the App Store

All MQL5 Tutorial episodes

  • MQL5 Tutorial – How to simply count your positions with MQL5
    In this video we want to create a little Expert Advisor that will tell us how many positions we have opened for a currency pair. An Expert Advisor like this is useful if you want to handle more than one position for each currency pair as I do, this is called a Multi-currency Bot. As you can see I have opened one, two, three, four, five, six positions for the Euro U.S. dollar. So if I click on Euro U.S. dollar and drag it on the chart, it will say positions for this currency pair six. Now how can we do that? First of all please click on this button here or hit the F4 key to bring up that Meta Quote language editor also called Meta Editor. Now we need to click on new and select Expert Advisor from template, click on continue, I will give it the name Simple Position Count. Click on continue, and finish. You can delete everything above the OnTick function. We also will remove the two comment lines here and the first thing below is a variable but it will be a local variable to count the positions for this currency pair. Now we are going to count all the open positions, that is done by using the function PositionsTotal, subtract one and count down to zero until we have no open positions. We will need to open a bracket for loop, and a closing bracket, and between these two brackets we will get the symbol of the open position by using the function PositionGetSymbol. And if the symbol position is equal to the symbol on the chart, we want to add the value one to the current positions for this currency pair. And after we have counted all positions, we want to output the current positions for this currency pair on the chart. This is the text, this is the value and we are using the Comment function. So this is it. Let’s see if it compiles. Okay that worked without any errors or warnings. So let’s hit the F4 key, open a chart window and drag the EA simple position count on your chart. And it says we have two open positions for this currency pair. This is one and this is the other one. So let’s switch to Euro U.S. dollar, and now it says we have six open positions. Let’s check the Australian against the Canadian dollar and it says we have one open position, and this is this one. In this little video you learned how to create a simple MQL 5 Expert Advisor to count the positions for a currency pair and output the number on the chart.
    4 min
  • MQL5 TUTORIAL BASICS 127 – SIMPLE ELLIPSE OBJECT
    In this video we are going to create an object. This is a circle. It will show us the last, highest and lowest candle within the last 30 candles. So let’s find out how to do that with MQL Five. To get started please click on a little button here or press F4 on your keyboard.   Now you should see the Metaeditor window and here you want to click on File, new file, Expert Advisor from Template, Continue I will call this file Simple Ellipse Object as our circle is actually an Ellipse. Now let’s click on Continue, continue and finish. Now you can delete everything above be on Tick function and let’s remove the two comment lines here. We start by creating a variable for the highest and the lowest candle. Let’s also add two arrays for the High and the Low values.   We use Array set as Series to sort the High and the Low array from the current candle downwards. And now we can fill our array for the current symbol on the chart and the currently selected period on that chart. From candle zero to candle 30, we use Copy High to copy the highest prices of each candle in the High array. The same can be done for the Low array, we use Copy Low. Everything else is the same, but this time the values will be stored in our Low Array.   That makes it possible to calculate the highest candle by using Array Maximum. That will give us the highest value within our High Array. Starting from Index zero for 30 candles and as you might have guessed, for the lowest candle, we use Array Minimum and we look into our Low Array from candle zero to candle 30 and store the lowest value in this variable here. With MQL Rates, we create a Price Information array for the candle prices. This one as well needs to be sorted with Array set as Series and with copyrates for the current symbol on the chart and the currently selected period on that chart.   Starting from candle zero for all the bars on the chart, we want to store the values in our Price Information array. This expression will give you all the bars that are available. On a slow computer you might use a fixed value like here for 30 candles. Now we have everything we need, but before we draw the circle, we want to use Object Delete for the current symbol. And we want to delete all the former Ellipse objects. You might not have such an object, at least for the very first time when you start the Expert Advisor. But once the old object is deleted, we can draw a new one. That is done by using Object Create for the current symbol on the chart.   This is the object name. This is the object type. We use OBG_Ellipse. The object should be drawn in the main window. It will be started at the time when candle 30 has been drawn on the chart that is the left border. The upper border is for the highest price of the highest candle.   The right border is the point in time where we see candle zero, the current candle . And the lower border will be the lowest price of the lowest of the last 30 candles. Let’s set a few object parameters. I would like to change the object line color. That can be done by using object set integer. If you mark that and Press F1, you will see that we need to pass a few parameters. The first one is for the current chart ID. Zero means we want to do it for an object in the main chart with the candles.   The second parameter is the name of the object. The third one is the property that we want to change. In our case we want to change the object property color and we want to set it to blue. The next property I want to change is called object property fill. That’s the background color of the object and I want also to set it to blue and that’s about it.   If this was too fast for you or if you have no idea what all the code here does, you maybe want to watch one of the other videos in the basic video series. Or maybe even the premium course on our website might be interesting for you. That’s why you also can find source codes like this one in the shop. In case you don’t want to type everything.
    7 min
  • MQL5 TUTORIAL BASICS – 126 SIMPLE RUNNING TIMER
    In this video we are going to create an Expert Advisor that is able to calculate the time that has passed since we have started the Expert Advisor. This can be useful for several things. Let’s find out how to do that with MQL Five. To get started, please click on a little icon here or Press F Four on your keyboard. Now you should see the Metaeditor window and here you want to click on File, new file, Expert Advisor from Template, continue I will call this file Simple Running Timer. Click on Continue, continue and finish. Now you can delete everything above the on tick function and let’s also remove the two comment lines here. We start by defining three datetime variables. Date time is the type of variable that we are going to use when we use something that contains a date or a time. And to get the time that the Expert Advisor is running, we want to check if the start time equals zero. That will be true the very first time we start the Expert Advisor. And if this is the case, we want to set the start time to time local. Time Local is a function that will return the local time of the computer where the client terminal is running. So this is the initial value for our counter and all the other times the current time will be set to time local because time is moving. So this value will change every time a tick comes in. Well the Ontick function will not run every second, it runs whenever the price changes, so keep that in mind. Now let’s calculate the past time. The past time will be the current time and we subtract the start time. Now let’s use MQL date Time. This is a date type structure and it makes it basically possible to get time based values in different formats. For example, we can calculate the hour, the minutes and the seconds. And that’s exactly what we are going to do now. To do that, we use Time to Struct. The first parameter is the past time. The second parameter is the date time structure that we have created here. To calculate the hour based value, we create an integer variable here and we assign Date Time structure dot hour for the minutes. We do the same, but this time we use date time structure dot min. And for the seconds we use Date Time structure dot SEC. If you would need something like days, this also would be possible because once you hit the dot you can pick one of these values here. The hour, the minute and the seconds will be enough for us. Now let’s create a chart output using the comment statement. This will output the start time, the current time, and the past time in hours, minutes and seconds. And that’s about it. Well if this was too fast for you, or if you have no idea what all the code here does, you maybe want to watch one of the other videos from the basic video series or maybe even the premium course might be interesting for you. You can find that one on our website where you can also find a link to the store where you can download source codes like this one in case you don’t want to type everything. By the way, this once again was a suggestion from a premium course member. And if you are a premium member and if you have an idea for a video like this one, please let me know. For now, please click on the compile button here or Press F seven on your keyboard. You shouldn’t get any errors here and if that is the case you can click the little button here or Press F four to go back to MetaTrader. And in MetaTrader please click on view, Strategy Tester or press Control and R. Please pick the new file simple runningtimer EX5. Mark the option for the visible mode here and start your test. Here we are, our expert advisor is running. It counts the hours, the minutes and the seconds. This might be useful if you want to do something that is time related. From now on you will find the first videos for this MQL five tutorial in 26 languages. We have created subtitles for YouTube. And in this little video you have learned how to create an expert advisor that is able to calculate hours,
    6 min
  • MQL5 TUTORIAL – SIMPLE MOUSE CLICK EVENT
    In this video we are going to talk about simple event handling. Event handling is something that happens when you try to interact with your chart; in our case we are going to find out how to get a simple mouse click. Let’s left-click on the chart here and we get the text: “You pressed the mouse at the following coordinates:”, we have an “x” value and the “y” value here and when I press the mouse on the left side of the chart here you will see that we have a low “x” value because the “x” axis goes from the left to the right and the “y” axis goes from the upper to the lower border, so when I click here at the middle of the upper border we have a high “x” value and a low “y” value and you will get the highest values in the lower right corner here. In this video we are going to find out how to code and MQL5 Expert Advisor that is able to capture the coordinates of the mouse click wherever you click on the chart. To do that please click on the little button here or press F4 on your keyboard, now you should see the Metaeditor window and here you want to select “File/ New/ Expert Advisor (template )” from template click on “Continue”, I will call this Expert Advisor “SimpleMouseClick”, click on “Continue”, “Continue” and “Finish” and now you can delete everything above the “OnTick” function here and the two comment lines and usually we would use the “OnTick” function here because this one is triggered whenever the price changes on the chart, but in our special case we are more interested in mouse clicks so let’s change the “OnTick” to an “OnChartEvent” function. The “OnChartEvent” occurs whenever you do something on the chart, for example you could press a key, move your mouse, create or change an object and whenever that happens the “OnChartEvent” will be fired. It has a few parameters; the first one is an ID – that’s for the event ID –, the second one is of the type long; it’s called “lparam” for long, the third parameter is the “dparam” for double and the last parameter is called “sparam” for string because it’s of the string type. Now we want to find out if the mouse button was clicked. MQL5 has a special kind of event type that is called “chartevent_click”, let’s mark that and trust the F1 key and we learn that we have “chartevent_KEYDOWN”, “chartevent_MOUSE_MOVE” or in our case “chartevent_click” for clicking on the chart and if our first parameter for the ID equals “chartevent_click” we want to use the built in comment function to output the text: “You pressed the mouse at the following coordinates:” followed by the “x” and the “y” value. The x value will be delivered by the “lparam” and the y value will be delivered by the “dparam”. Please don’t forget the closing brackets here and when you’re done you can click on compile or press F7 on your keyboard; that worked without any errors or warnings so now we can click on the little button here or press F4 to go back to Metatrader. In Metatrader we would usually click on “View/ Strategy Tester” or press CTRL and R and we are still able to pick the “SimpleMouseEvent.ex5” file here and start a test but when we click on the chart we don’t get any output, so let’s stop the test here and simply drag the Expert Advisor with the name: “SimpleMouseEvent” on your chart, let’s confirm the question if we really want to attach the “SimpleMouseEvent” on to our chart, so now you know how to create an Expert Advisor to get the coordinates for the “x” and the “y” values for any point on the chart and you have created it yourself with a few lines of MQL5 code.
    5 min
  • LEARN MQL5 TUTORIAL BASICS – LEVEL 1C BUILD YOUR OWN ALGO TRADING SYSTEM FARM
    Welcome to our new documentation series on creating your own Algo Trading System Farm. We use automated voices and technologies to help you improve your results faster and with less effort. In this part, we will look at the basic installation of MX Linux. First of all you have to find out how to change the startup settings on your computer so that the installation works later on. This varies depending on the type of computer but most of the time you can get into the configuration by pressing a certain key like Escape or F1. There you can make a setting that allows us to start from a USB stick. But first we have to create this USB stick.   There are different programs for this and depending on the operating system it is quite different. Most people watching these videos will probably start from a Windows operating system and there is a very good and easy way to create a USB stick from our downloaded ISO file. In the last part we said that we want to download the 64 bit version for Fluxbox. But in fact MX Linux offers the possibility to download a 32 bit version. So even 15 year old computers can be used with the latest software. In our example we use a device from 2010. In fact, I also have some netbooks that only work with 32 bit operating systems. They run MX Linux smoothly even with only one gigabyte of memory. However, these devices are not really suitable for building an algo trading server farm.   Instead, we use a Tecra A11 notebook from 2010. This device is no longer a high-performance computer, but the RAM can be upgraded to 8GB. That was quite expensive in the last few years, but meanwhile the technology has developed so much that the RAM for such outdated devices has become very cheap again. Now to create our boot medium on the USB stick we need an appropriate program. Therefore we first download the portable version of the software Rufus for our Windows PC. Rufus is a software that is able to create a boot medium within a few minutes even without installation on your Windows PC. The portable version can be started after the download with a mouse click and here we will get the corresponding ISO image of the version we downloaded for MX Linux. We also need a USB stick that is capable of actually functioning as a boot medium.   Most current USB sticks should be able to do this without any problems. We have a 32 gigabyte one here, but if you have an old USB stick lying around that has 8 GB or more then it will do. Before you can write the ISO file to the USB stick, please make sure twice that you have selected the correct setting for the target drive. In case of doubt, please remove all external USB devices like hard drives or SD cards in case of notebooks. This will help to avoid confusion. After you have made all the settings accordingly click on the appropriate button to create the USB stick. This should be done within five to ten minutes. Once that is successfully completed, we insert our newly created USB stick into our target computer for the start of MX Linux. Don’t worry, nothing will be installed yet. Before starting the installation process, MX Linux will first run in test mode on the target computer. This gives you the opportunity to make sure everything works before overwriting your other operating system.   If you want to backup your former Windows system before overwriting it with MX Linux, there is a very good and free solution from a company called Lazesoft. It is the so-called Recovery Suite. With it, you can restore the installation from your Windows machine via a USB device as well, if needed. By the way, the Recovery Suite is also capable of backing up even large Windows installations to an external hard drive via a USB port. Okay, that’s it so far with the preparations for the installation of our first server for our Algo Trading System Farm. If you want to run your own Algo Trading System, just subscribe to our Youtube channel. If you need better results faster,
    5 min
  • LEARN MQL5 TUTORIAL BASICS – LEVEL 1B BUILD YOUR OWN ALGO TRADING SYSTEM FARM
    Welcome to our new documentation series on creating your own Algo Trading System Farm.    We use automated voices and technologies to help you improve your results faster and with less effort.    Okay, let’s get started!    Today we will start building our infrastructure so that by the end of this course we will have an automated trading system farm.    Until then it will take some time, because I will not be able to contribute information on this topic every day.    There are different reasons for this.    The first reason is the current rather tense political situation here in my area.    The second problem is that we have some health issues to deal with.     For example, we are in a situation right now where my father is dealing with a stroke and hemiplegia and has been institutionalized.    The third problem concerns economic aspects.    Of course, as an economically oriented company, we have to do certain things in a certain order so that the bottom line can cover net needs and costs.    In plain language, this means that this project will be completed bit by bit, but at the moment we can’t say how fast or slow the upgrade will be due to the circumstances mentioned above.    Most viewers will probably already have an operating system that they want to continue using.    In our case, however, we will be using a 10 year old netbook and installing the software that we currently think is the best solution for those who have not yet chosen an operating system as their only option.    This software is a Linux distribution based on Debian called MX Linux.    MX Linux has managed to grab the first place on the list of the most popular Linux distributions within the last few months.    And the reason for this is quite simple, with this software you can do many things that are very difficult to do with other Linux distributions.    Many things work already after the first installation, the hardware is recognized very well, even if the devices are more than 10 years old.    In addition, MX Linux is able to run a very modern and up to date version of Linux with very few resources without having to deal with any command line commands all day.    In plain language this means for all who want to use MX Linux that you can combine the advantages of several worlds and still be able to use a performant and easy to use operating system without having to pay license fees.    We have tried several different Linux flavors for our own company over the last few years and most of the time you hit a limit at some point that doesn’t allow you to continue.    In this case it’s relatively easy to implement, you don’t need any special knowledge.   And for MX Linux there are so many helpful documents on the web that even beginners should be able to handle it better than with Windows.    The interface and the appearance can be completely adapted to your own wishes, so that even as a MacBook user you could be of the opinion that you are using an up-to-date system from Apple.    But that’s not really that important for us.    For us it’s much more important that pretty much all hardware that has come out in the last ten years is supported and that includes the now 12 year old netbook that we use for it.     You should be able to follow every single step easily.   So this documentation series might be a bit long for some people if they are already familiar with Linux.    But many people have not had any contact with Linux until now and may have been willing to pay the license fees for a single operating system in the past.    We did that too, but Linux offers us a decisive advantage for our server farm.    This advantage is that we are able to use modern technology to cost-effectively run even old hardware without having to pay additional license fees, even if we want to expand our server farm to 50 or 100 servers.    This may not be very interesting to some viewers now, but I can promise you that in the next few years you will see that exactly such sy...
    5 min
  • LEARN MQL5 TUTORIAL BASICS – LEVEL 1A BUILD YOUR OWN ALGO TRADING SYSTEM FARM
    Welcome to our new documentation series on creating your own Algo Trading System Farm.    We use automated voices and technologies to help you improve your results faster and with less effort.    This is a new project that has been on my mind for a while and in the last weeks I have been asked from time to time if and in which form something new from me on the topic of Algo Trading will be released.    In fact I spent some months with another project about automatic customer acquisition and this project is finished since this week.    So I thought about what one thing I would like to do now and decided to tackle the topic Algo Trading System Farm here as a documentation.    The goal of this documentation should be to create an infrastructure with a few minutes effort every day.   This solution should enable you to run several Algo Trading Systems for Metatrader on any operating system, which are able to trade independently 24 hours around the clock on up to 22 charts fully automatically.   No matter if you want to do this on a Windows PC, on a Linux computer or on a MacBook.    And no matter if you want to trade with MetaTrader 4 or MetaTrader 5.   For all these solutions there will be a possibility here that also works on your own computer.    We will use a variant that consumes very few resources and even runs on a 10 year old netbook.    This means that you can now go to the basement and revive your old PC from 10 years ago and use it for your own automated trading system with Metatrader.    We will go step by step and use the possibilities that modern technology offers today.    This also includes that I use technologies for this content here that allow me to dub the created videos in multiple languages and also fully automated.    For the English MQL5 channel I will use my own voice but for other languages and the MQL4 channel I will use automatic solutions.    Okay, that’s it for today.    If you have any questions or suggestions about the content in this video, feel free to send me an email.    I always reply personally to emails and usually within 24 hours.    If you simply want to improve your results with automatic trading, then subscribe to our YouTube channel.    If you need faster and better results, then check out the premium course on our website.    For now, I say thank you for your attention and I’ll see you in the next video!
    3 min
  • MQL5 TUTORIAL BASICS – 125 SIMPLE ATR SELL TRAILING STOP
    In this video we are going to create a sell trailing stop that is triggered by the Average True Range indicator. So let’s find out how to do that with MQL 5. To get started please click on the little button here or Press F4 on your keyboard. Now you should see the Meta Editor window until you want to click on File, new File, Expert Advisor from Template, continue. I will call this file Simple Average True Range Sell Stop.   Click on Continue, continue and finish. Now you can delete everything above the on tick function and let’s remove the two comment lines here. We start with an Include statement to include the file trade mqh. This one contains the class Ctrade and we are going to use an instance called Trade. Let’s set a basic variable for the stop loss points.   We also need to calculate the stop point value and we use a global declaration for the bid price. And inside of the Ontick function we want to have a string variable for our signal. Now we are going to calculate the bid price. That is done by using symbol info double. For the current symbol on the chart we use symbol underscore bid. And with normalize double and underscore digits we can automatically calculate the right number of digits behind the dot depending on the currency pair. Now let’s create a price array.   This is a double array and let’s define the Average True range here. That is done by using the IATR function that is included in MQL5. It uses a few parameters. The first one is for the current symbol on the chart, the second is for the selected period on that chart and we will calculate the result based on 14 candles. Now we use array set as series to sort our price array from the current candle downwards. And with copy buffer we fill our price array according to the definition that we have created here for buffer zero starting from the current candle zero and we want to copy the data for three candles and store them in the array.   Now we can get the Average True Range value for the current candle by looking at candle zero in our price array. I use Normalize Double and Five to cut off five digits. Because that is how we see the Average True range indicator is shown on the chart. I also want to declare a static variable for the old value because I want to know if the current value is below the old value and if that is the case, we want to set our signal to sell and now we use trade sell. And if the signal equals Sell and positions total is below one, we have no open positions but a sell signal and that’s when we use Trade sell to sell it 10 microlot. This is a test position.   We do it on a demo account because to trigger a sell trailing stop we need to have a position. And now we want to get the calculated stop point value by calling a user defined function called Check ATR Sell trailing stop. We pass the average true range value that we have calculated as a parameter. Now let’s add a chart output by using the comment statement. This will output the current signal, the average true range value, and the calculated stop point value. Afterwards we assign the average true range value to the old value for the next time. And that’s it for the main function. But this function doesn’t exist, so we need to create it right now.   Our user defined function will have the name Check ATR Sell trailing stop. It gets the average true range value as a parameter here. We use this little formula to calculate the stop point value by using the defined basic stop point value and we will add this multiplication here. Now we are able to calculate the stop loss price. That is the current bid price plus the calculated stop point value times the point value. With the for loop we go through all the open positions to get the symbol of the current position we use Position get symbol for the current counter value. And if the current symbol on the chart equals the position symbol we want to continue. So let’s get the position ticket by using position get integer and the paramete...
    9 min
  • MQL5 TUTORIAL BASICS – 124 SIMPLE ORDER CLOSE TIME
    In this video we are going to create an Expert Advisor to calculate the closing time for already closed positions. So let’s find out how to do that with MQL 5. To get started, please, please click on a little icon here or press F4 on your keyboard. Now you should see the MetaEditor window and here you want to click on File, new File, Expert Advisor from Template, continue. I will call this file Simple Close Time. Click on Continue, continue and finish.   Now you can delete everything above the on tick function and let’s also delete the two comment lines here. We start with an Include statement to include the file Trade.Mqh. This contains the class Ctrade and we are going to create an instance called Trade. Inside of the On Tick function we want to calculate the Ask price and the Bid price.   That can be done by using Symbol Info Double for the current symbol on the chart. We either use symbol Ask or symbol Bid. And with normalize double and underscore digits we make sure to calculate the right number of digits behind the dot. As we want to calculate the time for Order closing, we obviously need to open a few positions. We use Trade Buy or Trade Sell to open a test position for ten microlot. You wouldn’t do that on a real account, but that’s what demo accounts are good for. And obviously we need positions or we wouldn’t be able to calculate any close times.   And to do that we want to call a user defined function called Get Closetime. This function doesn’t exist so far, so we need to create it now. So let’s go on. The name of the user defined function is Get close Time. We use Void here because we don’t need to return any values.   We need to declare a few variables. You may not need all of them, but I have used them in another video. And this one is the most important thing for us. We want to calculate the time when a position was closed. So let’s get started and use History select, starting from the current time.   We want to go through all the closed orders and positions in our case and for each entry we want to get the ticket number. That can be done by using History Deal Get ticket for the current counter value. And if that is greater than zero we start to read out the position properties. For example, the order profit will be calculated by using History Deal Get double for the current ticket number. And we use Deal underscore Profit here. The order type can be calculated by using History Deal Get integer for the current ticket number. And this time we use Deal underscore type. Let’s continue and calculate the current symbol by using history deal get string for the ticket number and we use Deal underscore Symbol. The next item is the entry type.   The Deal entry will be calculated by using history deal get integer for the current ticket number and we use deal underscore entry. And now comes the interesting part because we want to get the deal time. That is done by using history deal get integer for the current ticket number and this time we use deal under score time. But as you see we will receive an integer value that is not very good to read for humans.   So the closing time in our case needs to be reformatted by using time to string for the deal time that we have calculated here. And we use time underscore date and time underscore seconds to make it more readable. And if the current symbol for the deal fits and is equal to the symbol on the chart, we want to find out if it is a buy or a sell order because we don’t want to calculate anything for pending orders. And we also want to know if the order was actually closed. That would be the case when the deal entry value equals one. And if all conditions apply, we will calculate our result. This is a string value that we will print out in our Journal.   It contains the values for the profit, the ticket number and the closing time. So let’s use the print statement to print it out to the Journal tab. Finally, we need to close the loops and the function and that’s about it...
    8 min
  • MQL5 TUTORIAL BASICS – 123 HOW TO FIND ERRORS IN BIG JOURNAL FILES
    In this video we are going to check the Journal for error codes and find courses for errors. So let’s find out how to do that with MQL 5. This should be a trailing stop. Actually it’s a sell trailing stop but it doesn’t work. The stop doesn’t move.   Now we need to find the cause. If we look at the history, we see that there are no stop loss modifications. There’s nothing that we can find. But when we click on the Journal tab we should see that we have modification errors here. You see the red marks and this is when we see errors during the execution.   But this is only a small part of the journal and you might look at a time when no error is occuring. And when you look at it you might not see any errors because they maybe happen only once a day. So let’s stop the test here. My journal is still running. It might take a few seconds before all the entries are written. That happened right now. So we can now right click onto one of the entries and select open.   This will open the logs directory here. This is the current log file from today. You can see that it contains the date and when you point your mouse cursor over the file you will see that it is a very large file. In my case it’s 479 megabytes. That’s almost half a gigabyte.   Now we can right click on the file and can Select Open. But when we do that it will probably crash because Notepad as it is delivered with Windows is not a good tool to open files of this size. In my case, I’m going to use Notepad Plus Plus. This is a free software that you can download from Chip or any other websites. And this editor is able to open very big files. When we scroll down, we can see that this file has thousands and thousands of lines.   We could now manually scroll through the file, but this could take hours. But one of the best things in Notepad Plus Plus is that we have a very good search function. Let’s change the language here to English. That might be better for you. Now I can click on Search and Find and I can look for certain terms. Here we have the term log in. And what I can do is I can type in or copy and paste the term I’m looking for and click on this button “Find all in current document”. And it will now show me the lines that contain my search term and I can click on these lines here. And it will jump to the search results. In our case we know that we wanted to move a stop loss. So I’m going to click on Search, Find. And I will look for the term failed. Click on Find all in current document. Well this might take a little while because it’s a very large file. And here is my search result. So this is a very fast and easy way to find errors in big log files. In this case it’s easy to see what is causing the error. So let’s go to Google and look for MQL 5 error codes.   This is the first entry and this table will show you the different error codes that can happen. And the cause of the error, like in my case the invalid stops. So if your expert advisor is not doing what it is supposed to do, you now know how to find the errors in the journal. Because in this video you have learned how to find error codes even in big journal files and you have done it yourself in a few minutes.
    5 min