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

Podcast Overview
MQL4 Tutorial for Metatrader 4 or MT4 about automated trading, trading robots, MQL 4 and MQL programming
Language
🇺🇲
Publishing Since
2/11/2024
1 verified contact email on file for MQL4 TUTORIAL
Pitch yourself as a guest, propose sponsorships, or reach out directly to the host.
Recent Episodes

March 24, 2024
MQL4 TUTORIAL – PLATIN SYSTEM – WILLAMS PERCENT RANGE ENTRY SIGNAL
<div> <a href="https://mql4tutorial.com/mql4-tutorial-english/mql4-tutorial-platin-system-willams-percent-range-entry-signal"><img title="AlgorithmicTrading031" src="https://d8wyob5mxqc1u.cloudfront.net/MQL4-TUTORIAL-EN/BASICS/MQL4-TUTORIAL-PLATIN-SYSTEM-WILLAMS-PERCENT-RANGE-ENTRY-SIGNAL.png" alt="MQL4 TUTORIAL – PLATIN SYSTEM – WILLAMS PERCENT RANGE ENTRY SIGNAL" width="" /></a> </div> <p> In this video, we want to create an Expert Advisor entry signal for this little Oscillator here. This is the volumes percent range oscillator. So let’s see how we we can create an entry module for our Platin System with MQL4. The Williams Percent Range Indicator is actually an oscillator signal, therefore it will be shown in a separate oscillator window below the candle chart. To create an entry signal for our Platin System we need to create a file called CheckEntry_WPR.mq4 in the same directory as our other files. Actually you can use this entry signal file also for your own, self coded system or for the RobotTradingSystem. The file has one function called CheckEntry and we use it to calculate the signal for our main module. To do that, we create a string variable called signal but we are not going to assign a value right away, because that will be calculated in the following steps. MQL4 comes with an included function for that calculation and the name of the function is iWPR. It needs a few parameters that we have to pass. The first parameter is for the current symbol on the chart. The second one is for the currently selected period on that chart. The third parameter is used for the number of candles that we are using to calculate our result. And the last parameter is for a shift value. We don’t need that, so we set it to 0. If you open an empty chart in Metatrader and click on Insert, Indicators, Oscillators and pick the Williams Percent Range oscillator, you will see that the default value for the period is also 14. Please confirm that setting with Okay, right click into the chart and save the template as tester.tpl. Tester.tpl is the template that is used in the strategy tester to actually see the entry signal. But back to the entry signal module. Now that we have calculated the WPR value, we can check if the value is below -80. If this is the case, we consider that to be a buy signal, so we assign the word buy to our signal. In the other case, if the signal is below -20, that would mean we have a sell signal and then we assign the word sell to our signal. Finally we use the return statement to return the signal to our main module. Please save the file for the entry signal, but you don’t need to compile it. It will be compiled with the main module when you have changed the entry signal there. To do that, please open the main module, and modify the include statement for your entry signal below the import section. You can outcomment your current module with two slashes. It will then become gray. Please enable the toolbar and click on the compile button to compile the main module and your entry signal at once. You shouldn’t get any errors. If you have errors, please go to our website and check the shop for precompiled source codes. Okay. By now, you should have a working Williams Percent Range indicator entry file that you can use in the Platinum system. Or you can use it in your own system. If you have any problems, please check out our website. Maybe even the premium course might be interesting for you. For now, I say thank you for listening, and I will see you in the next video.</p> <div class="crp_related crp-text-only"><a href="https://bit.ly/3iWZOkm"><img src="https://d8wyob5mxqc1u.cloudfront.net/Reviews/Testimonials.gif" width="100%"></a><br /><font color="red">Not sure what to do? Click on the automated trading assistant below</p> <p></font><a href="https://mql4tutorial.com/algo-trading-assistant"><img src="https://d8wyob5mxqc1u.cloudfront.net/ALGOTRADINGASSISTANT/2022/AlgoTradingAssistantDeepWord3.

February 25, 2024
MQL4 TUTORIAL – SIMPLE SMA STANDALONE EXPERT ADVISOR
<div> <a href="https://mql4tutorial.com/mql4-tutorial-english/mql4-tutorial-simple-sma-standalone-expert-advisor"><img title="AlgorithmicTrading032" src="https://d8wyob5mxqc1u.cloudfront.net/MQL4-TUTORIAL-EN/MQL4-TUTORIAL-SIMPLE-SMA-STANDALONE-EXPERT-ADVISOR.png" alt="MQL4 TUTORIAL – SIMPLE SMA STANDALONE EXPERT ADVISOR" width="" /></a> </div> <p> In this video we are going to talk about a standalone Expert Advisor that is going to actually trade. Whenever the price is below this yellow line here – this is a Moving Average – we have already made a sell trade and in this video we are going to find out how to do a standalone Expert Advisor that actually trades in MQL4. 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 click on: “File/ New/ Expert Advisor (template)” from template, “Continue” (Next), I will call this version: “SimpleStandaloneSMA”, click on “Continue” (Next), “Continue” (Next) and “Finish”. Now you can remove everything above the “OnTick” function and let’s also delete the two comment lines here. Okay. Let’s start by creating a string variable for the signal, that variable will be also called: “signal” and we don’t assign a value here because we are going to calculate it later on. To calculate it we use the built-in “iMA” function that comes with MQL 4 and it will calculate the Moving Average for the current symbol on the chart and the currently selected period on that chart – for example I’m on the 1-minute chart right now – we want to calculate the Moving Average for 20 candles, I don’t want to use a shift value, I could move the Moving Average drawing to the right or to the left but we are going to use a zero (0) shift value here. “MODE_SMA” will calculate the Simple Moving Average, “PRICE_CLOSE” we’ll use the close price for the calculation and the last value here is candle 0 (zero) – that’s the current candle – I could also calculate the Moving Average based on one of the other candles here but in this simple version we are going to use the current candle. And if the Moving Average is below the current price – so if my Moving Average (MyMovingAverage) is below the close price for candle 0 (zero)… …and please notice that close for candle 0 (zero) actually doesn’t exist because candle 0 (zero) is always the candle that is just in development and close price for candle 0 (zero) gives you the current price here and when that price is bigger than the Moving Average value we want to set the signal variable to buy so we assign the word: “buy” to our signal. And guess what? If the Moving Average is above the current price, so if my Moving Average (MyMovingAverage) is bigger than the current price we want to set the signal variable to sell so we assign the word: ”sell” to our signal. Now let’s actually buy something! When the signal equals buy and “OrdersTotal” equals 0 (zero) – and that is true when we have no open orders – we use the “OrderSend” command to buy 10 micro lot and the take profit value is 150 points above the Ask price. If you are interested in the “OrderSend” command just mark it here and press F1 and you will see how it works, but let’s continue with the selling part! To sell 10 micro lot we check if the signal equals “sell” and if we have no open orders and in that case we use the “OrderSend” statement to sell 10 micro lot and this time the take profit value will be 150 points below the Bid price. Please notice that we use “OP_BUY” to buy something and “OP_SELL” to sell something. That’s almost it. In the last step we use the “Comment” function to output the words: “The current signal is:” and the calculated signal on our chart. Okay, so far so good, please click on the “Compile” button or press F7 on your keyboard, you should see no errors and we have 2 warnings because we could use the return value for “OrderSend” but for this simple example everything is okay,

February 22, 2024
MQL4 TUTORIAL – SIMPLE COMMODITY CHANNEL INDEX
<div> <a href="https://mql4tutorial.com/mql4-tutorial-english/mql4-tutorial-simple-commodity-channel-index"><img title="AlgorithmicTrading080" src="https://d8wyob5mxqc1u.cloudfront.net/MQL4-TUTORIAL-EN/MQL4-TUTORIAL-SIMPLE-SIMPLE-COMMODITY-CHANNEL-INDEX.png" alt="MQL4 TUTORIAL – SIMPLE COMMODITY CHANNEL INDEX" width="" /></a> </div> <p> In this video we are going to trade the Commodity Channel Index, that’s the Indicator right here; you see the two dotted lines and whenever the line here crosses the upper dotted line we consider that to be a sell signal and when it crosses the lower dotted line that would be a buy signal. In this video we are going to find out how to automatically calculate this signal with a few lines of MQL4 code. To do that please click on the little button here and now you should see the Metaeditor window and here you want to click on “File New Expert Advisor (template)” from template, “Continue”, I will call this file: “SimpleCommodityChannelIndex”, click on “Continue”, “Continue” and “Finish” and now you can remove everything above the “OnTick” function and the two comment lines here. Let’s start with a string variable for the signal, that variable will also be called: “signal” – we don’t assign a value because we are going to calculate that later on. Let’s define our indicator that is done by using the “iCCI” function that comes with MQL4 and if you mark it and hit the F1 key you will see it takes a few parameters. The first parameter is for the symbol – that’s actually the currency pair on your chart –, the second one is for the time frame, in our case we use the 1 minute time frame – another time frame could be 5 minutes or 15 minutes and so on –, the third parameter is for the averaging period, that’s actually the period we use to calculate the signal and if you click on “Insert Indicators Custom CCI” you will see that the CCI period is 14, so that’s what we are using here followed by a typical price. You could also use a close or an open price, the highest or the lowest price, and the last parameter here is for the shift. You could use a shift value to move the Indicator window to right or to the left. We are not going to use it so our last parameter will be 0. Now that we know the value we want to find out if it is above 100, so if the “ICCIValue” we have defined here is greater than 100 – that would be the case when it’s above the dotted line here, because this is the 100-plus line –, we consider our currency pair to be oversold so we assign the word: “sell” to our signal. In the other case if our value is below -100, so if our “ICCIValue” is below -100 – that would be the case when the line is below the dotted line here, because the lower line is the minus 100 line – in that case we consider it to be a buy signal so we assign the word: “buy” to our signal. In the last step we create a chart output that is done by using the “Comment” function and we want to output the word: “Signal:” followed by the calculated signal (signal) and in a new line we want to have the output: “ICCI Value:” followed by the current ICC I value (ICCIValue). Okay. Please don’t forget the closing bracket and when you are done you can click on the “Compile” button here or press F7 on your keyboard and now you should see an output like this. We have compiled it without any errors and without any warnings and in that case you can click on a little button here or press F4 to go back to Metatrader and in Metatrader we use a little trick; please click on “Insert Indicators Custom CCI” we will go with the default values here so please click on “OK”. Now you should see the little window with the Indicator below the candles and now we right-click in our chart and select: “Template Save Template” and save it as: “tester.tpl” because this is the template that our strategy tester is going to use for the next back test. If you don’t see the strategy tester panel you can click on “View Strategy Tester” or press CTRL and R,
5 total episodes available
Deep-dive analytics for MQL4 TUTORIAL
Frequently asked questions
Have a different question and can't find the answer you're looking for? Reach out to our support team by sending us an email and we'll get back to you as soon as we can.
- What is MQL4 TUTORIAL?
- How often does this podcast release new episodes?
This podcast updates inactive.
- Where can I listen to this podcast?
This podcast is available on 8 platforms including Apple Podcasts, Spotify, and more. You can also use the RSS feed directly.
- Does this podcast accept guests?
Information about guest appearances is not available.
Legal Disclaimer
Pod Engine is not affiliated with, endorsed by, or officially connected with any of the podcasts displayed on this platform. We operate independently as a podcast discovery and analytics service.
All podcast artwork, thumbnails, and content displayed on this page are the property of their respective owners and are protected by applicable copyright laws. This includes, but is not limited to, podcast cover art, episode artwork, show descriptions, episode titles, transcripts, audio snippets, and any other content originating from the podcast creators or their licensors.
We display this content under fair use principles and/or implied license for the purpose of podcast discovery, information, and commentary. We make no claim of ownership over any podcast content, artwork, or related materials shown on this platform. All trademarks, service marks, and trade names are the property of their respective owners.
While we strive to ensure all content usage is properly authorized, if you are a rights holder and believe your content is being used inappropriately or without proper authorization, please contact us immediately at hey@podengine.ai for prompt review and appropriate action, which may include content removal or proper attribution.
By accessing and using this platform, you acknowledge and agree to respect all applicable copyright laws and intellectual property rights of content owners. Any unauthorized reproduction, distribution, or commercial use of the content displayed on this platform is strictly prohibited.
