MQL5 Tutorial

MQL5 Tutorial

By Raimund BauerBusinessTechnologyInvesting
Download on the App Store

All MQL5 Tutorial episodes

  • MQL5 TUTORIAL – IS 3 PERCENT MONTHLY TRADING PROFIT POSSIBLE

     

    (00:00) Request for 3% Monthly Profit in Trading

    • The video starts with a mention of a request from an MQL programmer asking if it’s possible to make at least 3% profit per month in trading.
    • (00:08) Comparison with Warren Buffett’s Returns

      • The narrator compares this goal to Warren Buffett’s average annual profit of about 20%, noting that a 3% monthly profit would equate to an annual profit of about 36%, significantly higher than Buffett’s returns.
      • (00:24) Feasibility of Consistent Profits

        • Discussion on whether such consistent profits are feasible, emphasizing that the challenge lies in achieving profitable solutions over a longer period and maintaining at least 3% per month.
        • (00:40) Focus on Minimizing Mistakes and Losses

          • The initial focus for beginners should be on minimizing mistakes and losses, especially in the initial phase, rather than optimizing profits.
          • (00:56) Variability of Monthly Profits

            • Highlighting that each month in trading can be different, and profits from automatic trading should not be expected as a regular salary.
            • (01:07) Emotional Challenges in Trading

              • Discussing the emotional aspects of trading, including the tendency to question and want to improve one’s own system, leading to potential mistakes and frustration.
              • (01:28) Emotional Decision Making and Its Consequences

                • Explaining how emotions can lead to uncomfortable situations or rash decisions in trading, often with disastrous results.
                • (01:44) Trading as Statistical Probabilities, Not Gambling

                  • Clarifying that trading is more about statistical probabilities than fortune-telling or gambling, and deviations from the norm can occur.
                  • (01:55) Importance of Sustaining a Trading System

                    • Emphasizing the importance of sustaining one’s own trading system over a long period, regardless of whether it’s automatic or manual trading.
                    • (02:06) Developing a Solid Strategy and Avoiding Emotional Decisions

                      • The key to success in trading is developing a solid strategy, sticking to one’s own rules, and avoiding emotional decisions.
                      • (02:22) Realistic Expectations and Continuous Learning

                        • Advising on having realistic expectations in trading, understanding it’s not a fast track to riches, and the importance of continuous learning and adapting to market conditions.
                        •  

                          Today I got another request from an interested, starting MQL programmer who asked me if it was possible to make at least 3% profit in a month. In fact, I heard that even Warren Buffett as an investor can only make about 20% profit in a year and he is one of the richest men in the world. A 3% monthly profit would equate to an annual profit of about 36%, which is much higher than Warren Buffett’s average return. Now, does that mean that’s not possible?

                           

                          Well, actually it is rather the case that a profitable solution over a longer period of time is difficult to implement if you want or need to achieve at least 3% per month. The idea is basically not to make a particularly high profit immediately, but to make as few mistakes as possible, especially in the initial phase, and to lose as little money as possible. The majority of all beginners lose a large part or even the entire trading capital within a few months. So the first step is not to optimize profits, but to limit losses while you are still learning and have enough capital. The second problem with this is that every month is slightly different. You can’t think of profits from automatic trading as a regular salary. There may be months when you make minus. In return, you may make a little more plus in another month. In addition, there is the problem that people always tend to question their own system and want to improve it.

                           

                          If you can’t stick to your own rules, you will realize by the third or fourth exception at the latest that you did exactly the wrong thing at exactly the wrong time. This can lead to being frustrated and out of that comes such things as revenge trades. Humans are emotional and that leads to situations always arising where we feel uncomfortable or do rash things. The intention behind it may be good, but often the result is quite disastrous. Many people also see automatic trading as a kind of fortune telling or a substitute for gambling. But in fact it is more about statistical probabilities. And that means that there can be deviations from the norm.

                           

                          An average profit expectation does not mean that you should expect that for every week or month you trade. If you are not able to sustain your own trading system over a long period of time, you will basically have a hard time. Regardless of whether you prefer automatic or manual trading. To be successful, it is important to develop a solid strategy, stick to your own rules and avoid emotional decisions. This is the only way to be successful in trading in the long run and make steady profits. At the same time, one should have realistic expectations and be aware that trading is not a fast track to riches, but rather a discipline that requires time, patience and constant learning.

                           

                          Constant testing and adapting to changing market conditions is essential to be successful in the long run.

                          The post MQL5 TUTORIAL – IS 3 PERCENT MONTHLY TRADING PROFIT POSSIBLE appeared first on MQL5 Tutorial.

                          0 min
                        • Choosing the Best Stop Loss Percentage Solution for Stock and Forex

                           

                          (00:00) What is the Best Stop Loss Percentage? [Not What You Think]

                          • Introduction to the concept of the best stop loss percentage, suggesting it might not be what most traders think.
                          • (00:02) The Equity Stop: A Revolutionary Concept

                            • Introducing the concept of the equity stop, likened to a revolutionary invention similar to sliced bread.
                            • (00:17) Position-Based Stop Loss Solutions

                              • Discussing popular position-based stop loss strategies like fixed percentage stop loss, chart stop loss, and volatility-based stop loss.
                              • (00:27) The Cost of Stop Loss Strategies

                                • Highlighting the costs associated with stop loss strategies, including slippage and emotional costs.
                                • (00:37) Surprising Fact: 80% of Losses Caused by Own Stop Loss

                                  • Stating that 80% of trading losses are caused by the trader’s own stop loss strategy.
                                  • (01:04) The Importance of Robust Risk Management

                                    • Emphasizing the need for a robust risk management strategy in today’s fast-paced trading environment.
                                    • (01:16) Introducing the Equity Stop Strategy

                                      • Explaining the equity stop as a better solution, focusing on account equity rather than individual trades.
                                      • (01:43) Managing Risk Across All Trades

                                        • Describing how using a percentage of account equity as a stop loss level can manage risk across all trades.
                                        • (01:58) Learning About Equity Stop Benefits

                                          • Inviting viewers to learn more about the benefits of the equity stop in their course.
                                          • (02:13) Drawbacks of Traditional Stop Loss Methods

                                            • Discussing the drawbacks of traditional stop loss methods and how the equity stop addresses these limitations.
                                            • (02:35) Importance of Fine-Tuning Equity Stop Strategy

                                              • Stressing the importance of optimizing equity stop settings for maximum effectiveness and profitability.
                                              • (02:52) Invitation to Inquire About Equity Stop

                                                • Offering assistance for any questions about the equity stop via email contact on their website.
                                                •  

                                                  In the ever-changing world of the trading market, knowing how to protect your investments is essential. One of the most popular ways to do this is by using a stop-loss order. A stop-loss order is an essential tool in any trader’s arsenal, but what is the best stop loss percentage to use? In this comprehensive guide, we’ll explore various stop-loss strategies and help you determine the optimal percentage for your trading style.

                                                  What is a Stop-Loss Order?

                                                  A stop-loss order is a type of trading order designed to limit an investor’s loss on a position in the stock market. It works by automatically closing a position when it reaches a predetermined price, known as the stop-loss level. This helps traders protect their capital and minimize losses during times of strong market movements.

                                                  Types of Stop-Loss Orders [Stock and Forex]

                                                  There are several types of stop-loss orders, including traditional stop-loss, trailing stop-loss, and stop-limit orders. Each type has its own unique advantages and disadvantages, but they all serve the same purpose: to limit your losses in the market.

                                                  Factors to Consider When Determining the Best Stop Loss Percentage

                                                  When determining the perfect stop loss percentage for your trading strategy, several factors should be taken into account. These include:

                                                  1. Volatility: The price fluctuations can greatly affect the effectiveness of your stop-loss order. Volatile times may require a larger stop loss percentage to avoid getting stopped out too frequently.
                                                  2. Support and resistance levels: Identify key support and resistance levels in the stock’s price movement. Placing your stop-loss order near these levels can help protect your position, because these are levels where most people pay attention to price changes.
                                                  3. Trading style: Day traders may use tighter stop-loss percentages to minimize losses, while longer-term investors may prefer more wiggle room to ride out fluctuations in the market. If you prefer long term trading, you need to take swap cost into consideration.
                                                  4. Risk tolerance: The optimal stop loss percentage for you depends on your risk tolerance. A more conservative investor might opt for a lower percentage, while a more aggressive trader may be willing to accept a higher level of risk. At the end it depends on what you can actually endure without manipulating the system.
                                                  5. Popular Stop-Loss Strategies
                                                    1. Percentage method: Set your stop-loss order a certain percentage below the stock’s current price or entry point. For example, if you bought at $100 and set a 5 percent stop-loss, your order would automatically close the position if it dropped to $95.
                                                    2. Moving average method: Use a moving average (such as the 50-day or 200-day moving average) as a reference point for setting your stop-loss order. This strategy can help you adapt to changing market conditions and trends.
                                                    3. ATR (Average True Range) method: The ATR is a measure of volatility that calculates the average range of price movement over a specified period. By multiplying the ATR by a certain number, you can determine an appropriate volatility stop loss level based on the stock’s volatility.
                                                    4. Support level method: Set your stop-loss order just below a recent support level. This strategy helps protect your position while allowing for normal market fluctuations.
                                                    5. The Importance of a Well-Defined Stop-Loss Order Strategy

                                                      Having a clear stop-loss order strategy in place is crucial for successful trading. It allows you to predetermine your maximum loss, manage risk effectively, and prevent emotional decision-making in times of market uncertainty. By considering factors like volatility, support and resistance levels, and your personal trading style, you can determine a better stop loss percentage for your unique situation.

                                                       

                                                      How to find the perfect stop loss order percentage?

                                                      When engaging in trading, it is essential to have a personalized and well tailored stop loss policy in place to shield your money from potential losses. A stop loss should protect an investor from suffering severe losses, but determining the appropriate amount of the stop loss can be difficult. For most traders, their own stop loss order is to blame for eighty percent of the losses that they had hoped to avoid. Therefore, what would be the best approach to take? First and foremost, investors need to be aware that there are several distinct types of stop loss strategies, such as fixed, trailing, and dynamic stop loss strategies. Each kind has its own set of pros and cons, and the trader’s decision as to which one to use depends on the level of risk he or she is willing to take and the current state of the market. There is a school of thought among traders that a predetermined percent stop loss is the most foolproof choice.

                                                       

                                                      Each stop loss solution comes with a cost!

                                                      When it comes to stop loss solutions there is something every investor needs to understand: there is no free lunch! Each solution comes with a cost, and it is crucial to calculate that upfront. However, in my opinion, there is one solution that beats them all. It is called the equity stop. Now, you might be wondering what an equity stop is and why it is more effective than all other solutions. Well, let me inform you that most people don’t know about this hidden gem in the world of investing. Unlike other stop loss solutions, the equity stop puts a stop loss order on the amount of equity based on the account. This means that an investor sets a percentage at which they will exit their position, based on the amount of account equity they have. It is a more flexible and dynamic solution that allows for adjustments according to the account monetization. It is less restrictive than other solutions and provides greater control over risk management. Remember, when it comes to investing, it’s not just about the profits – it’s also about minimizing losses. Therefore, if you are looking for a stop loss solution that does not come with a high cost, consider the equity stop. It may just be the answer you’ve been searching for!

                                                       

                                                      Should I use a fixed or dynamic solution?

                                                      A fixed stop loss requires the trader to choose a particular percentage, and once the price of the securities reaches that amount, the trader is required to quit the position. The benefit of taking this technique is that it is unaffected by the current state of the market, and the trader is aware of the maximum amount of money that may be lost on their investment. Fixed stop losses, on the other hand, are fundamentally stiff and might not be appropriate for markets that are more volatile. On the other hand, trailing stop losses are more adaptable and modify themselves according on the state of the market. Because it is determined by the asset’s current value in the market, a trailing stop loss is a type of dynamic trading technique. A predetermined percentage or cash amount is used to determine if the distance between the current price and the stop loss should be increased or decreased. As a result of the stop loss moving in tandem with the market’s movement, traders are able to maximize their profits and minimize their losses. In general, a trailing stop loss is more suited when the market is volatile than a fixed stop loss. In conclusion, dynamic stop losses combine elements of a trailing stop loss with a fixed stop loss. Taking this strategy gives traders the ability to modify their stop loss according on the state of the market. If the market is particularly volatile, for instance, the trader may choose to increase the size of the stop loss order in order to better safeguard their investment. It may be possible for dynamic stop losses to reduce losses more effectively, but using them requires investing time and effort into monitoring market swings. In conclusion, determining the appropriate stop loss % can be difficult because it is contingent on a wide range of circumstances. Traders need to have a solid understanding of the various stop loss techniques, as well as their own risk tolerance and the current market conditions. Fixed stop losses may be appropriate for markets with lower levels of volatility, while following or dynamic stop losses may be more appropriate for markets with higher levels of volatility. In the end, traders should have a well-defined plan and the discipline to follow it in order to limit losses while simultaneously maximizing gains.

                                                      The post Choosing the Best Stop Loss Percentage Solution for Stock and Forex appeared first on MQL5 Tutorial.

                                                      3 min
                                                    6. MQL5 TUTORIAL – Simple Moving Average – Do I need an SMA for my trading strategy?
                                                        (00:00) MQL5 Tutorial – What is a Simple Moving Average Good for? (Easy Benefits for You!) Introduction to the concept of a Simple Moving Average (SMA) and its benefits in trading. (00:02) Understanding Charts with Simple Moving Average Discussing how a Simple Moving Average can help traders understand and interpret charts, especially for beginners. (00:07) The Basics of Simple Moving Average Explaining what a Simple Moving Average is: a calculation that takes the average price of an asset over a specified period. (00:15) Calculating Simple Moving Average Example of calculating a 20-day SMA by adding up the prices over the last 20 days and dividing by 20. (00:28) Plotting SMA on a Chart Describing how the SMA calculation is plotted on a chart as a line. (00:35) Identifying Trends with SMA Using the SMA to identify trends: an upward SMA line indicates an uptrend, suggesting a buying opportunity. (00:41) Interpreting Downward SMA Trends A downward SMA line indicates a downtrend, suggesting a selling opportunity. (00:46) Analyzing Price and SMA Line Relationship Understanding the relationship between the price and the SMA line to determine if the asset is trading above or below its average. (00:58) Bullish and Bearish Signals from SMA If the price is above the SMA line, it’s a bullish signal (consider buying). If below, it’s a bearish signal (consider selling). (01:13) Making Informed Trading Decisions Using the SMA to make informed trading decisions based on the current trend and the asset’s position relative to the SMA. (01:29) Ease of Identifying Current Trend with SMA Highlighting the simplicity of using SMA to quickly determine the market trend and the asset’s relative position for trading decisions.   What is a simple moving average? A simple moving average (SMA) is a basic technical analysis indicator commonly used in financial markets. It is a calculation of average price over a certain period of time, where each data point is given equal weight. The SMA is a widely used tool for traders and investors, as it can help to identify trends and potential opportunities. For example, a trader may use a 50-day SMA to determine an overall trend in a stock’s price. If the stock’s price is consistently above the SMA line, it may indicate a bullish market trend. Conversely, a trader may interpret a stock’s price consistently below the SMA line as a bearish trend. The SMA can be customized to fit different timeframes and periods, making it a versatile tool in technical analysis. While SMA is a relatively simple indicator, it can be a valuable tool for investors and traders to help identify potential trading opportunities. Moving averages are an important analytical tool used to identify current price trends and the potential for a change in an established trend. The utilization of moving averages is significant in the realm of analysis as it enables recognition of the present price tendencies and likelihood of a shift in a preexisting trend. Why should I use a simple moving average? As an aspiring trader or investor, you might wonder why you should use a simple moving average (SMA). The answer lies in the usefulness of this technical tool in identifying trends in the market. By calculating the average price of an asset over a specific period, SMAs give a clear picture of its movement and direction. This makes it easy to understand the overall trend and take advantage of potential opportunities. Moreover, SMAs are widely used by thousands of traders across multiple markets, making it a reliable and trusted tool in the trading community. By utilizing SMAs, you gain greater insight into market movements and improve your chances of making profitable trades. What is the best setting for Simple moving average? When it comes to determining the best setting for a simple moving average, there is no one-size-fits-all answer. This is because the optimal settings for an SMA depend largely on your personal trading strategy as well as whether you’re focused on long-term or short-term trading. For example, a day trader may find that a 15 or 20-day SMA provides the best signals for making quick decisions given the volatility of intraday price movements. On the other hand, for those focused on longer-term trades, a higher SMA setting between 50 and 200 days (the 200-day SMA is popular) can help capture long-term trends more effectively. In short, the best setting will depend on factors like the timeframe of trades, the market being traded, and the level of volatility. Ultimately, finding the optimal SMA setting requires trial and error, as different traders will have different preferences and goals when using moving averages.   Should I use a simple or exponential moving average? The decision to use a simple or exponential moving average depends on the individual trader’s strategy and goals. Simple moving averages weight all candles equally, providing a smoother and less responsive signal. In contrast, EMAs put a higher weight on current candles, making them more responsive to recent price movements. If a trader believes that current events are more important in predicting future price movements, then an EMA may be preferred over an SMA. However, if a trader is looking for a more long-term trend signal, a simple moving average may be more appropriate. Ultimately, traders should experiment with both types of moving averages and decide which one works best for their trading style and goals. What is a weighted moving average? A weighted moving average is a common technique used in statistical analysis to smooth out a data set. It is a type of moving average where different time periods are assigned different weights in the calculation. This is in contrast to a simple moving average (SMA) which assigns equal weight to all time periods. The weights assigned in a weighted moving average can be based on various factors such as importance and relevance of data points. The exponential moving average (EMA) is also a type of weighted moving average, where more weight is given to recent data points. The purpose of Not sure what to do? Click on the automated trading assistant below MQL5 TUTORIAL - HOW TO CREATE A SHIFTED MOVING AVERAGE MQL5 Tutorial Classics - Simple Moving Average Robot… MQL5 Tutorial - Simple Adaptive Moving Average Robot MQL5 TUTORIAL - LIVE TRADING EXPERIMENT 2024 - HOW… How to create an Adaptive moving Average EA with MQL5 The post MQL5 TUTORIAL – Simple Moving Average – Do I need an SMA for my trading strategy? appeared first on MQL5 Tutorial.
                                                      2 min
                                                    7. MQL5 TUTORIAL – SIMPLE IDEMA STANDALONE EXPERT ADVISOR
                                                        MQL5 Tutorial – Simple IDEMA Standalone Expert Advisor (00:00 – 00:02) Introduction to creating a standalone Expert Advisor for the Double Exponential Moving Average Indicator in MQL5. Creating an Expert Advisor in MetaEditor (00:02 – 00:27) Instructions on opening MetaEditor in MetaTrader and creating a new Expert Advisor file named ‘SimpleIDEMAStandaloneEA’. Initial Code Setup (00:27 – 00:51) Removing unnecessary lines and preparing the initial code setup in the MetaEditor. Including Trade.mqh and Initializing CTrade (00:51 – 01:04) Including the ‘Trade.mqh’ file and creating an instance of the ‘CTrade’ class for later use in opening trades. Calculating Ask and Bid Prices (01:04 – 01:36) Using ‘SymbolInfoDouble’ to calculate Ask and Bid prices and normalizing these prices with ‘NormalizeDouble’ and ‘_Digits’. Setting Up Price Array (01:36 – 01:56) Creating a price information array and using ‘ArraySetAsSeries’ to sort the array from the current candle downwards. Filling Price Array with Data (01:56 – 02:09) Using ‘CopyRates’ to fill the price array with data for the current symbol and selected period on the chart. Creating Signal and Price Data Arrays (02:09 – 02:43) Creating a string variable for the signal and another array to hold price data for the indicator. Implementing IDEMA Indicator (02:43 – 03:07) Using the built-in ‘iDEMA’ function to define the Expert Advisor based on the Double Exponential Moving Average indicator. Filling Price Array with Indicator Data (03:07 – 03:50) Using ‘CopyBuffer’ to fill the price array with data according to the IDEMA definition. Calculating IDEMA Value and Assigning Signals (03:50 – 04:45) Getting the value for the last finished candle and assigning ‘buy’ or ‘sell’ signals based on the IDEMA value. Executing Trades Based on Signals (04:45 – 05:08) Using ‘trade.Sell’ or ‘trade.Buy’ to execute trades based on the calculated signal and the absence of open positions. Displaying Signal on Chart (05:08 – 05:20) Using the ‘Comment’ function to display the current signal on the chart. Testing the Expert Advisor (05:20 – 05:52) Instructions for compiling the code and testing the Expert Advisor in MetaTrader using the Strategy Tester. Conclusion (05:52 – 06:09) Conclusion of the tutorial with a demonstration of the Expert Advisor in action, showing how it trades the Double Exponential Moving Average and outputs buy and sell signals on the chart.   In this video we are going to create a standalone Expert Advisor for the Double Exponential Moving Average Indicator; it’s the red line here and whenever it crosses our price it will produce either a buy or a sell signal and now we are going to find out how to create an EA that is able to actually trade the signals automated. To do that please click on the little button here or press F4 in Metatrader. Now you should see the Metaeditor window and here you want to click on: “File/ New/ Expert Advisor (template)” from template, “Continue”, I will give it the name: “SimpleIDEMAStandaloneEA”, click on “Continue”, “Continue” and “Finish”. Now we can delete everything above the “OnTick” function. We start by including the file: “Trade.mqh” that is part of MQL5, now we create an instance of “CTrade” that will be called: “trade”, let’s remove the two comment lines here. Inside of the “OnTick” function we calculate the Ask price and the Bid price by using “SymbolInfoDouble” for the current symbol on the chart, “SYMBOL_ASK” will give us the Ask price while “SYMBOL_BID” will give us the Bid price and with “NormalizeDouble” and “_Digits” we calculate the number of digits behind the dot because some currency pairs have 3 and others have 5 digits behind the dot. Now let’s continue by using “MqlRates”, we create an array for the price data that will be called: “PriceInfo”, we sort the price array (PriceInfo) from the current candle downwards that is done by using “ArraySetAsSeries” for the price info array (PriceInfo) we just created and by using “CopyRates” we fill the array (PriceInfo) with price data, that is done for the current symbol and currently select a period on the chart, we start with candle 0 (zero) – that’s the current candle – and we copy the prices for 3 candles and store it in the price info array (PriceInfo). We also need to create a signal that is a string type variable, this is an empty value because we need to calculate the value later on. Let’s create an array for the price data of the Expert Advisor that will be called: “MyEaArray” and we define the properties for the Double Exponential Moving Average by using the built in “iDEMA” function that comes with MQL5 for the current symbol and the currently selected period on the chart. We will calculate the result based on 14 candles without any shift to the right or to the left and we use “PRICE_CLOSE” to calculate the results based on the close price. Now when you click on: “Insert/ Indicators/ Trend/ Double Exponential Moving Average” you will see that we here also see the period of 14 candles, the shift value of 0 (zero) and it is applied to the close price so that’s what we use here. Let’s sort that array also by using “ArraySetAsSeries” and use “CopyBuffer” to fill it according to the my moving average definition (movingAverageDefinition) that we have created here for buffer 0 (zero) – that’s the red line here – from the current candle 0 (zero) for 3 candles and store the values in our price array (MyEaArray). Now we can calculate the Expert Advisor for the last finished candle – that’s candle 1 in our EA array – (MyEaArray) and we assign the result to the variable “myMovingAverageValue” and if that moving average value (myMovingAverageValue) is bigger than the close price for candle 1 in our price info array (PriceInfo) that would be a sell signal and in that case we assign the word: “sell” to our signal. Otherwise if the moving average value (myMovingAverageValue) is below the close price for candle 1 in our price info array (PriceInfo) – Not sure what to do? Click on the automated trading assistant below MQL5 TUTORIAL - SIMPLE ITRIX STANDALONE EXPERT ADVISOR MQL5 TUTORIAL - SIMPLE IVIDYA STANDALONE EXPERT ADVISOR MQL5 TUTORIAL - SIMPLE STANDALONE RANDOM ENTRY EA MQL5 TUTORIAL - SIMPLE TENKANSEN STANDALONE EXPERT ADVISOR MQL5 TUTORIAL - SIMPLE BEARS POWER STANDALONE EXPERT ADVISOR The post MQL5 TUTORIAL – SIMPLE IDEMA STANDALONE EXPERT ADVISOR appeared first on MQL5 Tutorial.
                                                      7 min
                                                    8. MQL5 TUTORIAL – SIMPLE TRIPLE CANDLE STRATEGY
                                                        (00:00) MQL5 Tutorial – Simple Triple Candle Strategy Introduction to creating a simple strategy in MQL5 that opens a trade after three consecutive bullish candles. (00:19) Creating an Expert Advisor with MQL5 Explanation of how to create an Expert Advisor for this strategy using MQL5. (00:30) Including Trade.mqh and Initializing CTrade Demonstrating how to include ‘Trade.mqh’ for simplified trading functions and initializing the ‘CTrade’ class. (00:40) Determining Ask and Bid Prices Calculating the ask and bid prices for the current currency pair using ‘SymbolInfoDouble’ and normalizing them with ‘_Digits’. (00:59) Calculating Account Balance and Equity Determining the account balance and equity using ‘AccountInfoDouble’ with parameters ‘ACCOUNT_BALANCE’ and ‘ACCOUNT_EQUITY’. (01:09) Setting Up Price Array Creating and sorting a price array from the current candle downwards using ‘ArraySetAsSeries’. (01:28) Filling Price Array with Data Filling the price array with data for four candles using ‘CopyRates’. (01:39) Checking for Bullish Candles Determining if the closing price of the current candle is greater than its opening price to identify a bullish candle. (01:58) Identifying Three Consecutive Bullish Candles Checking if there are three consecutive bullish candles. (02:08) Opening a Position Opening a sell position for 10 micro lots if there are no current positions and three bullish candles are identified. (02:18) Displaying Account Information Using the ‘Comment’ function to display account balance and equity on the chart. (02:25) Compiling the Expert Advisor Instructions for compiling the Expert Advisor in MetaEditor. (02:34) Testing the Expert Advisor in MetaTrader Running the newly created Expert Advisor in the MetaTrader Strategy Tester. (02:54) Observing the Expert Advisor’s Performance Watching the Expert Advisor’s performance in the strategy tester. (03:07) Additional Learning Resources Suggestion to view other basic videos or consider a premium course for further learning. (03:20) Conclusion Thanking viewers for watching and inviting them to the next video.   In this video, we are going to create a very simple strategy that will open a trade whenever we have three bullish candles in a row. This is a very simple strategy, but it works actually okay.   So let’s find out how you can create an expert advisor like this one with MQL5.   Let’s take a look at the source code for our expert advisor. We start here with an include command. With this, we import trade.mqh. This is a library that provides simplified trading functions. With this, we can create an instance of the class Ctrade with the name trade. In the function itself, we determine the price using symbol info double for the current currency pair on the chart. We want to determine the ask price and with underscore digits we get in combination with normalized double the correct number of decimal places for the respective currency pair. We repeat the whole thing here again with the bid price. The line is so far identical except for this part where we use symbol underscore bid. We are also interested in the growth balance. We determine this with account info double and here we pass as parameter account_balance. For the net balance called equity, we repeat this again. But in this case we use account underline equity as parameter. After that, we create a price array with the name price info using MQL rates. Using array set as series, we can now sort our price info array from the current candle downward.   And using copy rates, we now fill the price array for the current currency pair and the time unit selected on the chart. We start from candle zero and fill the array with the value for four candles, which we store in our price info array. Why do I use four candles here? Quite simply, in the experiment, you can swap the numbers around here because candle zero is the current candle and the result changes quite a bit if you omit the current candle. For now, we want to find out if the closing price for candle zero in our price info array is greater than the opening price for candle zero. If it is, we have a bullish candle. We then repeat the whole thing again here for the closing prices and the opening prices of candle 1 and candle 2 and immediately, if we have three bullish candles in a row, we want to know if the current number of positions is zero. If it is, then we would like to open a position. To do this, we use trade sell to open a position for 10 micro lot. Finally, we use the comment command to display the value for the balance, that is, the gross balance and the value for the equity on the chart.   That’s about it for the most part. When you’re ready, you can pop up the toolbar here at the top and click compile or press the F7 key. That should work here without any errors. And if it does for you, then you can click on this little icon up here or press F4 to return to Metatrader. Now here we are going to run our new Expert Advisor simple triple bullish candle. If the strategy tester is not displayed, you can show it here via the menu or with the key combination control and R. Let’s start our test. Then you can see here already the first graphical development and you have programmed this yourself with this few lines here in MQL5.   Okay, if everything went well, you should already have the expert advisor running here. I hope it worked for you. If you don’t know what all the MQL5 code means or if this was too fast for you, you maybe want to open one of the other basic videos in our channel, or maybe the premium course on our website might be interesting for you. For now, I would like to say thank you for watching and I will see you in the next video.   Not sure what to do? Click on the automated trading assistant below MQL5 TUTORIAL - SIMPLE ITRIX STANDALONE EXPERT ADVISOR MQL5 TUTORIAL - 134 STANDALONE BOLLINGER MACD EXPERT ADVISOR MQL5 Tutorial - Advanced Library Expert Advisor MQL5 TUTORIAL - SIMPLE TENKANSEN STANDALONE EXPERT ADVISOR MQL5 TUTORIAL - SIMPLE BEARS POWER STANDALONE EXPERT ADVISOR The post MQL5 TUTORIAL – SIMPLE TRIPLE CANDLE STRATEGY appeared first on MQL5 Tutorial.
                                                      4 min
                                                    9. MQL5 TUTORIAL – SIMPLE STANDALONE RANDOM ENTRY EA
                                                        MQL5 Tutorial – Simple Standalone Random Entry EA (00:00 – 00:02) Introduction to creating a Standalone Expert Advisor that trades random entries in MQL5. Creating the Expert Advisor in MetaEditor (00:02 – 00:41) Instructions on opening MetaEditor in MetaTrader and creating a new Expert Advisor file named ‘SimpleStandaloneRandomEA’. Initial Code Setup (00:41 – 00:52) Removing unnecessary lines and setting up the initial code in MetaEditor. Including Trade.mqh and Initializing CTrade (00:52 – 01:04) Including ‘Trade.mqh’ to create an instance of the ‘CTrade’ class for opening positions. Calculating Ask and Bid Prices (01:04 – 01:33) Using ‘SymbolInfoDouble’ to calculate Ask and Bid prices and normalizing them with ‘NormalizeDouble’ and ‘_Digits’. Setting Up Price Array (01:33 – 01:57) Creating a price information array and sorting it from the current candle downwards using ‘ArraySetAsSeries’. Filling Price Array with Data (01:57 – 02:08) Filling the price array with data for the current symbol and selected period on the chart using ‘CopyRates’. Creating Signal Variable (02:08 – 02:22) Creating a string variable ‘signal’ to calculate the signal later on. Random Number Generation for Signals (02:22 – 02:41) Using ‘MathSrand’ and ‘GetTickCount’ to initialize the random generator and ‘MathRand’ to calculate a random number. Assigning Buy or Sell Signals (02:41 – 03:16) Assigning ‘buy’ or ‘sell’ to the signal variable based on the random number generated. Executing Trades Based on Signals (03:16 – 03:32) Using ‘trade.Sell’ or ‘trade.Buy’ to execute trades based on the calculated signal and the absence of open positions. Displaying Signal on Chart (03:32 – 03:46) Using the ‘Comment’ function to output the current signal on the chart. Compiling and Testing the Expert Advisor (03:46 – 04:16) Instructions for compiling the Expert Advisor and testing it in MetaTrader using the Strategy Tester. Observing the Expert Advisor’s Performance (04:16 – 04:44) Watching the Expert Advisor’s performance in the strategy tester and discussing the results of random entry trading.   In this video we are going to create a Standalone Expert Advisor that is going to trade random entries. It creates buy and sell signals directly on the chart, here is our first open position and now we are going to find out how to create something like this in and MQL5. To do that please click on the little button here or press F4 in your Metatrader, 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 one: “SimpleStandaloneRandomEA”, click on “Continue”, “Continue” and “Finish” and now we are going to delete everything above the “OnTick” function and the two comment lines here. We start by using the “include” function to include the file: “Trade.mqh” that one comes with MQL5 and it allows us to create an instance of the class “CTrade” that we will call: “trade” and we are going to use it later on to open new positions. Inside of the “OnTick” function we want to calculate the Ask price and the Bid price that’s done by using “SymbolInfoDouble”, the first parameter is for the current currency pair on the chart, the second one will deliver the Ask price or the Bid price, it depends on if we use “SYMBOL_ASK” or “SYMBOL _BID” and “NormalizeDouble” and “_Digits” will make sure that we get the right amount of digits behind the dot. Now we use “MqlRates” that structure stores the information about prices, volumes and spread for the candles. We sort the price info array (PriceInfo) downwards from the current candle by using “ArraySetAsSeries” and with “CopyRates” we fill our price info array (PriceInfo) for the current symbol and the currently selected period on the chart with price data from the current candle 0 (zero) for 3 candles. Now let’s create a string variable called: “signal” that will be used to calculate the signal later on, right now it’s empty and here comes the interesting part; we use ”MathSrand” and “GetTickCount” to initialize the random generator because we want to calculate a random number. We use “MathRand” %2 because “MathRand” can return a pseudorandom integer within the range of 0 to 32,767 but we only need 2 random numbers, so let’s say if the random number is 0 (zero) that would be a buy signal and in that case we would assign the word: “buy” to our signal. Otherwise if the random number is 1 we suppose that this one is a sell signal so we assign the word: “sell” to our signal and whenever the signal equals sell and “PositionsTotal” is below 1 – in other words we don’t have any open positions – we use “trade.Sell” to sell 10 micro lot. Otherwise if the signal equals buy and we have no open positions we use “trade.Buy” to buy 10 micro lot. Finally we use the “Comment” function to output the words: ”The current signal is:” followed by the calculated “signal” directly on our chart. That’s it, please click on the “Compile” button or press F7, now you should see that it went well without any errors and in that case you can click here or press F4 to go back to Metatrader. In Metatrader we click on: “View/ Strategy Tester” or we press CTRL and R, please select the “SimpleStandaloneRandomEA” file, enable the visualization here and start your test. And now you should see the first trade on the chart, let’s speed that up a little bit here and you see that we have made several trades, in this case we have made a profit and if you have no idea which results you could expect from a random entry you should definitely try this out. Okay. In this video you have learned how to create an MQL5 Expert Advisor that is going to trade random entries and output signals directly on the chart and you have coded it yourself with a few lines of MQL5 code. Not sure what to do? Click on the automated trading assistant below MQL5 TUTORIAL - SIMPLE ITRIX STANDALONE EXPERT ADVISOR MQL5 TUTORIAL - SIMPLE IVIDYA STANDALONE EXPERT ADVISOR MQL5 TUTORIAL - SIMPLE IDEMA STANDALONE EXPERT ADVISOR MQL5 TUTORIAL - SIMPLE TENKANSEN STANDALONE EXPERT ADVISOR MQL5 TUTORIAL - SIMPLE BEARS POWER STANDALONE EXPERT ADVISOR The post MQL5 TUTORIAL – SIMPLE STANDALONE RANDOM ENTRY EA appeared first on MQL5 Tutorial.
                                                      6 min
                                                    10. MQL5 TUTORIAL BASICS – SIMPLE ACCOUNT CHECK
                                                        Introduction to Account Number Security in Expert Advisors (00:00 – 00:12) Introduction to creating an Expert Advisor in MQL5 that secures your account number, ensuring that the advisor is only usable with a specific account. Declaring the Account Number Variable (00:12 – 00:22) Explanation of how to declare a variable to store the account number for comparison against a predetermined number. Understanding the OnTick Function (00:22 – 00:44) Overview of the OnTick function, which is automatically called by MetaTrader when a new tick is received, and its role in calling the account number check function. Implementing the Check Account Number Function (00:44 – 01:04) Detailed explanation of the check account number function, including the declaration of the ‘is licensed account’ variable and setting it to false. Retrieving and Comparing Account Information (01:04 – 01:38) Instructions on using the ‘AccountInfoInteger’ function to retrieve the account number and type from MetaTrader, followed by a comparison with the predetermined number. Handling the Comparison Result (01:38 – 01:58) Steps to handle the result of the account number comparison, including setting the ‘is licensed account’ variable and printing messages to the terminal window. Compiling and Testing the Code (01:58 – 02:12) Guidance on compiling the code using F7 and returning to MetaTrader with F4 for testing purposes. Conclusion and Practical Application (02:12 – 03:03) Conclusion of the tutorial with a demonstration of running the Expert Advisor on the correct account and ensuring it is not used by unauthorized users.   In this video, we are going to create a little simple expert advisor to secure your account number. So nobody else will be able to use your expert advisor if not a certain type of account is used. So let’s see how that can be done with MQL5. The account number variable: the first part of the code is the declaration of the account number variable. This variable is used to store the account number that is to be compared against the predetermined number. The OnTick function: the OnTick function is a special function that is automatically called by the Metatrader platform whenever a new tick is received. In this case, the Ontick function is used to call the check account number function, which will be discussed in more detail later. The check account number function: The check account number function is the main function used to verify the account number. It begins by declaring the is licensed account boolean variable and setting it to false. This variable is used to store the result of the comparison between the account number and the predetermined number. The next line of code uses the account info integer function to retrieve the account number from the Metatrader platform and store it in the account number variable. The following line of code uses the account info integer function to retrieve the account type from the Metatrader platform and store it in the account type variable. The next part of the code is an if statement that compares the account number variable to the predetermined number. If the comparison returns true, then the is licensed account variable is set to true and a message is printed to the terminal window. The last part of the code is an if statement that checks the value of the is licensed account variable. If the value is false, then a message is printed to the terminal window. Finally, the function returns the value of the is licensed account variable. You can now press F7 to compile your code and return to the Meta trader by pressing F4. Conclusion: This MQL5 code is used to verify if an account number is true or false. It does this by comparing the account number to a predetermined number and then returning a boolean value of true or false depending on the result of the comparison. Okay, so far so good. If everything worked out as it should, you should now be able to run the expert advisor on the correct account. So let’s change that here. I will stop the strategy tester. Let’s pick the right account here, restart the test, and now we get the output, the account number is true. And in this little video, you have learned how to hard code an account number into your expert advisor to make sure that it is not used by anybody else. Thank you for watching and I will see you in the next video. Not sure what to do? Click on the automated trading assistant below MQL5 TUTORIAL - LIVE TRADING EXPERIMENT 2024 - SETUP… MQL5 TUTORIAL - 135 SIMPLE LOT SIZE ROUNDING MQL5 TUTORIAL - LIVE TRADING EXPERIMENT 2024 -… MQL5 TUTORIAL BASICS - 118 SIMPLE LAST ORDER TYPE MQL5 TUTORIAL BASICS - 113 SIMPLE SELL PERCENTAGE RISK The post MQL5 TUTORIAL BASICS – SIMPLE ACCOUNT CHECK appeared first on MQL5 Tutorial.
                                                      4 min
                                                    11. MQL5 TUTORIAL – SIMPLE TENKANSEN STANDALONE EXPERT ADVISOR
                                                      Introduction to Tenkan-sen Indicator in MQL5 (00:00 – 00:22) Introduction to creating buy and sell signals using the Tenkan-sen line from the Ichimoku Kinko Hyo indicator in MQL5. Overview of the purpose and functionality of the Tenkan-sen line. Setting Up in MetaEditor (00:22 – 00:44) Instructions on opening MetaEditor from MetaTrader and creating a new Expert Advisor file named ‘SimpleTenkansenStandaloneEA’. Initial code setup including removing unnecessary lines. Including Trade.mqh and Initializing CTrade (00:44 – 01:08) Explanation of including the ‘Trade.mqh’ file and creating an instance of the ‘CTrade’ class for opening and closing positions later in the code. Calculating Ask and Bid Prices (01:08 – 01:36) Details on calculating the Ask and Bid prices using ‘SymbolInfoDouble’ for the current symbol on the chart, and normalizing these prices with ‘NormalizeDouble’ and ‘_Digits’. Setting Up Price and EA Data Arrays (01:36 – 02:19) Creating and sorting a price array (PriceInformation) using ‘MqlRates’ and ‘ArraySetAsSeries’. Also, setting up an array for the Expert Advisor data (EAArray) and sorting it. Implementing Tenkan-sen Indicator (02:19 – 03:50) Using the ‘iIchimoku’ function to define the Expert Advisor based on the Tenkan-sen Indicator. Filling the TenkansenArray with data using ‘CopyBuffer’. Calculating and Assigning Signals (03:50 – 04:32) Determining the current Tenkan-sen value and assigning ‘sell’ or ‘buy’ signals based on its comparison with the close price of the last candle. Executing Trades Based on Signals (04:32 – 04:56) Executing sell or buy trades using ‘trade.Sell’ or ‘trade.Buy’ based on the calculated signal and the absence of open positions. Displaying Signal on Chart and Testing (04:56 – 05:57) Using the ‘Comment’ function to display the current signal on the chart. Instructions for compiling the code and testing the Expert Advisor in MetaTrader. Conclusion and Demonstration (05:57 – 06:19) Conclusion of the tutorial with a demonstration of the Expert Advisor in action, showing a buy signal and the opening of a position.   In this video we are going to create buy and sell signals and code a standalone version that is able to calculate this one line from the Ichimoku Kinko Hyo, it’s called a Tenkan-sen, that’s the red line here. Now we want to find out how to do that in MQL5? To do that please click on the 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/ Expert Advisor (template)” from template, “ Continue”, I will call this file: “SimpleTenkansenStandaloneEA”, click on “Continue”, “Continue” and “Finish”. Now you can delete everything above the “OnTick” function and the two comment lines here. We start with the “include” statement to include the file “Trade.mqh”, that comes with MQL5 and we need it to create an instance of “CTrade” that will be called: “trade” and we will use it to open and close positions later on. We start by calculating the Ask price and the Bid price, this is done by using “SymbolInfoDouble” for the current symbol on the chart, we use “SYMBOL_ASK” to calculate the Ask price and “SYMBOL_BID” to calculate the Bid price. “NormalizeDouble” and “_Digits” will automatically calculate the right number of digits behind the dot. Next we need to create a signal variable for the signal that also will be called: “signal” and we don’t assign a value here. We use “MqlRates” to create a price array called: “PriceInformation”, that one will contain the prices of the candles, we use “ArraySetAsSeries” to sort the array (PriceInformation) from the current candle downwards and with “CopyRates” we fill the price array (PriceInformation) with data for the current symbol on the chart and the currently selected period on the chart. We start from the candle 0 (zero) and copy the price information for 3 candles into our price array (PriceInformation). For the Tenkan-sen we need to create another array and we use th...
                                                      7 min
                                                    12. MQL5 TUTORIAL – PLATIN SYSTEM – SIMPLY GOOD PLATIN SYSTEM RESULTS (TO ANALYZE AND RETRADE)
                                                      Introduction to Platin System Results (00:00 – 00:02) Introduction to the video discussing the results of the Platin System after 197 days of real trading. Overview of Trading Results and Goals (00:02 – 00:16) Overview of the trading results achieved by February 3, 2023, including the goal of closing the system with a 10% profit. Analyzing Profit and Order History (00:16 – 00:29) Detailed analysis of the profit exceeding the goal on February 1, 2023, and a review of the order history showing the initial deposit and profit growth. Statistics and Performance on FX Blue Website (00:29 – 00:44) Explanation of how to access detailed statistics of the system’s performance on the FX Blue website. Growth and Trade Analysis (00:44 – 01:06) Analysis of the total profit growth, monthly growth, and the percentage of profitable positions, including the average number of trades per day. Annual Growth Calculation and Equity Analysis (01:06 – 01:32) Calculation of the annual growth rate and examination of the equity issue, highlighting the close relationship between equity and balance over the trading period. Detailed Trade Statistics (01:32 – 01:52) Breakdown of trade statistics including the number of orders, gross profit, gross loss, total profit, and profit factor. Additional Trading Statistics and Averages (01:52 – 02:04) Presentation of additional statistics such as average trading time and outliers in the data. Accessing Detailed Statistics and Resources (02:04 – 02:20) Information on accessing more detailed statistics on the FX Blue website and the PlatinSystem.com webpage. Conclusion and Future Plans (02:20 – 02:30) Conclusion of the video with a mention of the playlist for further documentation and the presenter’s satisfaction with the results and plans for the next system.   This video is about the result of 197 days in real trading. Today is February 3, 2023 and I wanted to contribute to the result of my system and have just accidentally started here again a new trade. We will now close the trade because actually I have already reached my goal on the 1 February 2023. The goal with the whole action was to close the system with 10% profit. If you take a look at this, we just crossed $11,000. And here in the the order history you can see that I deposited $10,000 at was as far as I can remember, on July 18 and in fact I exceeded my own profit goal on February 1.   This is the corresponding statistic on my website and if you click here you can have a look at the exact statistics of all data of this system on the FX Blue website. Here one can represent the whole again as total profit. On February 3, just now, I closed the last trade and the first position was opened on July 18, 2022. Overall we have a growth of 10.0% with a monthly growth of 1.4%. The system closed only 68% of all positions in profit and on average we made twelve trades per day over a period of 199 days. Actually, this would only be 197 days if I hadn’t accidentally opened a position when I started this video.   If we take a calculator to help us here and divide the 10% by 197 days and multiply by 365, then we would come to a growth of 18.5% annually. What I find interesting is the equity issue, because here you can see quite well that over the period we traded most of the time the equity was very close to balance. That means we had little drawdowns in the analysis. You can see that we traded exclusively with the Euro US dollar. That was 2408 orders, a gross profit of over $2,000, a gross loss of $1,112 and that results in a total profit of $1,001.28 with a profit factor of 1.9. Here are some additional statistics.   For example, the average trading time in hours. This one is an outlier at 334.9 hours. But on the whole you can say that the vast majority was under 100 hours. fxblue statistics here show a total loss risk of 0%. And you can look at 100 more statistics here. Whoever is interested in it can do that here on the FX Blue side or call the webpage PlatinSyst...
                                                      3 min
                                                    13. MQL5 TUTORIAL – SIMPLE SHIFTED SMA EXPERT ADVISOR
                                                      Introduction to Shifted SMA Expert Advisor (00:00 – 00:14) Introduction to creating an Expert Advisor in MQL5 that generates buy or sell signals based on the Simple Moving Average (SMA). Explanation of the SMA signal for 50 candles and its prediction into the future. Creating the Expert Advisor in MetaEditor (00:14 – 01:13) Instructions on opening MetaEditor in MetaTrader and creating a new Expert Advisor file named ‘SimpleShiftedSMA’. Initial setup of the code environment. Setting Up Signal String and Arrays (01:13 – 01:40) Creating a string for the signal and setting up arrays for the current and shifted Moving Average. Defining Moving Average Properties (01:40 – 02:27) Using the ‘iMA’ function in MQL5 to define properties for the current and shifted Moving Average based on 50 candles. Sorting Arrays and Filling with Data (02:27 – 03:35) Sorting the Moving Average and shifted average arrays using ‘ArraySetAsSeries’ and filling them with data using ‘CopyBuffer’. Calculating and Assigning Signals (03:35 – 04:20) Determining the current and future SMA values and assigning ‘buy’ or ‘sell’ signals based on their comparison. Displaying Signal on Chart and Testing (04:20 – 05:00) Using the ‘Comment’ function to display the current signal on the chart and instructions for compiling and testing the Expert Advisor in MetaTrader. Conclusion and Demonstration of Signals (05:00 – 05:30) Conclusion of the tutorial with a demonstration of the Expert Advisor in action, showing buy and sell signals based on the SMA crossover.   In this video we are going to create an Expert Advisor that is going to output buy or sell signals based on the SMA (Simple Moving Average) here, it’s a Moving Average signal that is created for 50 candles, this one is the current signal and this one is the signal predicted into the future and whenever those two lines cross we either get a buy or a sell signal. When the future SMA is below the other one, we have a buy signal and when the current SMA crosses the future SMA and is below it – like here – we have a sell signal. To create the Expert Advisor please click on the little button here or press F4 in your Metatrader, now you should see the Metaeditor window and here you want to click on: “File/ New/ Expert Advisor (template)” from template, please click on “Continue”, I will call this one: “SimpleShiftedSMA”, click on “Continue”, “Continue” and “Finish”. Now we can delete everything above the “OnTick” function and the two comment lines here. We start by creating a string for the signal, this one will also be called: “signal” and we don’t assign a value right now because this one needs to be calculated later on. Let’s create two arrays; one for the current Moving Average and one for the shifted Moving Average, afterwards we define the properties for the Moving Average by using the built in “iMA” function that comes with MQL5 for the current symbol on the chart and the currently selected period, the calculation will be based on 50 candles, here we use a shift value of 0 (zero), the calculation will be for an SMA so we use “MODE_SMA”, that stands for Simple Moving Average and the result will be based on the close price. The second calculation looks almost like the first one, we have two differences here; the first difference is that this one is for the shifted average definition (ShiftedAverageDefinition) and the second one is that we use a shift value of 20 here, this will move our SMA 20 candles into the future, so when we pass this you will see that this is the current candle, this is the current value and this one is the predicted value that is shifted into the future. For both of our arrays we use “ArraySetAsSeries” to sort the current array from the current candle downwards here for the Moving Average array (myMovingAverageArray) and here for the shifted average array (myShiftedAverageAttay) and with “CopyBuffer” we fill our array according to the definition that we have created here for the current buffe...
                                                      6 min