MQL4TUTORIAL.COM

MQL4TUTORIAL.COM

By MQL4TUTORIAL.COMBusinessInvesting
Download on the App Store

MQL4TUTORIAL.COM episodes

  • MQL4 Tutorial Bootcamp 20 – You Came a Long Way
    Next Course https://www.udemy.com/mql4-tutorial-bootcamp-metatrader4-trading-robots-expert-advisors-mt4 We have come a long way today. We have created a profitable expert advisor that will spot long term trends and it cannot only calculate trends, it can also open new trades. It can show valuable data on the screen and it can create screenshots for you. By now, you should know what works and why. And, I have used exactly these principles in all of my EA’s here. But you might see this one had a big drawdown and it would have been a very costly mistake I made if it hadn’t been on a demo account. So testing and error handling is very important. The simple EA we created is under 50 lines of quote. And obviously, there’s a lot more you can do. And there is obviously a lot more to learn. But by now, you should have a good idea if you are willing to put in all the money and effort it takes. Only one out of ten people can do it and by now, you should have a very good idea if this is you. So, if you are ready for the next step, be my guest…
    2 min
  • MQL4 Tutorial Bootcamp 19 – How To Create Screenshots
    Next Video Sometimes, you might ask yourself, why something happened. And I did it very often because I didn’t know what my EA was doing when I was sleeping. If you want to find out how your chart might have looked a few hours ago, a screenshot will be very useful. Just bring up MetaTrader with the F4 key and add another line within the brackets. This will create a screenshot with a name screenshot.gif in your files folder. Once again, compile it and see if it works. Here is our screenshot. That was very easy, wasn’t it? When you do it in back testing, it’s in tester\files and in real time trading, it’s in MQL4\files.
    2 min
  • MQL4 Tutorial Bootcamp 18 – More Data on Your Chart
    Next Video I always do encourage people to do lots of back testing. It is a very good way to get lots of experience in almost no time. And it’s even better if you have some additional information so we are going to print it right on the chart. Hit the F4 key in Meta Trader and add a little bit to the comment line. This will create a new line with the text Account Profit and the actual value. You should be able to compile it without any errors and now you can see the account profit here right on the chart. Let’s add another line with the account equity and now you can also see the equity change here. If you need any additional information like the AccountLeverage or the AccountName or Number, you can go ahead. You now know how it works and you can improve the comment output to look just the way you like it.
    2 min
  • MQL4 Tutorial Bootcamp 17 – Why Does Automated Trading Work?
    Next Video Okay. Obviously, it’s working and it’s making profit. But the question is WHY? How does it work and why does it work? Here is what I think. If you open a position in the back testing module, and the price is going up, you will make a profit. But there are also times when you do have opened a long position and the price will go down. As you can see, we are already in July here. So we are talking about 6 months of trading. The last entry here is from the beginning of February. That means we didn’t make any profits for 6 or 7 month. In back testing, that is absolutely no problem because it’s not real money and it’s not real time. And now, in October, it starts to work again. It took about five minutes in back testing to get it here. But humans have real big problems to deal with drawdowns that can take several months. We made 55 bucks of profit and it took us 12 month. Most humans would go insane to wait from February to October to see the next trade happen. And, that’s why human traders fail. They trade emotionally and they want good results in short time. And if that doesn’t happen, they do anything to get back to their excitement.
    3 min
  • MQL4 Tutorial Bootcamp 16 – Your First Profitable EA
    Next Video Okay. Now, it is going to be interesting. We are putting it all together. Hit the F4 key to bring up Meta Editor and fill in some additional lines here. The first one will check if the number of open orders is zero. We only want to open a new position if we don’t have one. The next line will check if it’s going up. And, if those conditions are true, we open a new order. You might have to change this part to zero depending on which broker you use. You might need it to change zero but that will mean you don’t have any take profit value. Okay. Let’s compile the EA. No errors and no warnings. In Meta Trader, hit Ctrl + R to bring up the back testing module. And now, we are going to do a back test. Mark the Visual mode and select the range from January 2013 to December 2013. Make sure you have chosen the right EA and the right symbol here, and hit the Start button. It works. And we have first results here and you see it’s making profit. Congratulations! You have just written your first profitable EA.
    2 min
  • MQL4 Tutorial Bootcamp 15 – Trend Calculation
    Next Video Okay. Now, we know how to calculate the closing price for a 1 or 2 candles, but this is not enough if we want to have a sophisticated program. On the chart that can be dozens or even hundreds of candles that we might want to calculate and in MQL4, we can do it with a moving average or an IMA. To calculate if it’s going up or down, we will need these 3 lines. The first line is going to calculate the current moving average. The second line calculates how it has been in the past. And the third line will tell us if the result is positive or negative. In this Comment line, we will print the result on the chart, So now, we hit the compile button and drag EA on the chart. It will show us a negative number. That means it’s going down. But it doesn’t seem to go down here. And the reason is we used 10,080 minutes to calculate it. That’s a whole week. If you change the view, you can see that it’s true. And if you change the time period, it is more obvious. So let’s drag another currency on the chart. This one is going down. This one is going down. But this one is positive and it’s going up. So now you know how to calculate a long time trend with 3 lines of code.
    3 min
  • MQL4 Tutorial Bootcamp 14 – How to use the If-Statement
    Next Video An automated trading system should be able to make intelligent decisions when conditions change. This is where we us the IF statement. We hit F4 to create a new Expert Advisor. Call it IFtest. And, in the OnTick function, we will say, if Close 1 is higher than Close 2, Comment (it is going up). We’ll copy this text and change this part to if Close 2 is greater than Close 1, Comment (it is going down). Compile your EA and drag it on the chart. And as you can see, it is saying it is going down. This is because the close price of this candle is lower than this candle. It counts backwards. This is candle zero because it’s not finished. And now, it’s candle 1 because it has finished a few seconds ago. And as you can see now, it is going up because the close price of this candle was higher than the close price of this candle. Drag another currency on the chart and this one should say, it’s going down.
    2 min
  • MQL4 Tutorial Bootcamp 13 – How to use the Print Function
    Next Video The Comment function is a good idea if you are in front of your screen. But maybe you want to store some information for later. We all need to sleep or we need to go to work and we want to know what’s going on. This is where we use the Print function. Hit the F4 key in the MetaTrader to bring up Meta Editor. Mark the word Comment and change it to Print. It should compile without any errors. When we drag it on the chart now, we won’t see anything here. The information will show up here in the Experts tab. You see every incoming tick will create a new entry.
    1 min
  • MQL4 Tutorial Bootcamp 12 – Comment Function with Data
    Next Video Of course, a simple text information is not very useful. We want some more data and we are going to do it right now with account information. If you look up the MQL4 Reference, you can see that there are lots of information available and we are going to use AccountFreeMargin for now. So please go back to your Meta Trader. Hit the F4 key and edit this one. Free margin is, AccountFreeMargin. Hit the compile button. Okay, no errors here. Drag it on the chart and wait for the next tick. And you see my free margin is 10,000 bucks.
    2 min

About MQL4TUTORIAL.COM

From the publisher's feed

MQL4 Tutorial for Metatrader 4 or MT4 about automated trading, trading robots, MQL 4 and MQL programming