In this video, we are going to create a channel object for the highest and the lowest candle on the chart, so let’s find out how to do that with mql5. To get started 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 file, expert advisor from template, continue, I will call this file simple channel object, click on continue, continue and finish. Now you can remove everything above the ontick function and let’s also remove the two comment lines here. We want to start by calculating the candles on the chart that is done by using chart get integer for the chart id zero and we use chart first visible bar, the last parameter here is for the sub-window, the one with the candles is window zero, if you would like to insert oscillators like the MACD you would see that those are drawn in a separate window below but we want our channel object to be drawn in the main window. Let’s create a variable for the lowest candle and we also need an array that is called low and it will hold the lowest candle prices for all the candles on the chart. We repeat that and create a variable for the highest candle and an array for the highest candle prices on the chart. And now we use array set as series for both arrays to sort them from the current candle downwards, so we can fill them with data that is done by using copy low, if you mark that and press F1 you will see that we will get the historical data and the minimal prices for each candle for the current symbol on the chart and the currently selected period on that chart starting from the current candle zero for all the candles on the chart and the results will be stored in the low array that is for the lowest prices. And as you might have guessed there is another function called copy high that will give us the highest bar prices for the history data for the current symbol on the chart and the currently selected period starting from candle zero for all the candles on the chart. And that’s how we store those price values into our high array but now we want to find the extreme prices. For the lowest candle that can be done by using the function array minimum that will search for the lowest value in the whole array, in our case in the array called low starting from candle zero for all the candles on the chart and the price for the lowest candle will be stored in this variable. For the highest candle we use array maximum that will give us the largest element or the highest price in our array and this is the high array starting from candle zero for all the candles on the chart so now we have the number for the lowest and for the highest candle but we need more data, so we use mql rates to create a price information array, if you mark mql rates and press F1 you will see that it stores information about prices, volumes and spread and also the time and that’s what we need, so let’s use array set as series to sort the price information array from the current candle downwards and with copy rates we fill the array for the current symbol on the chart and the currently selected period on that chart starting from candle zero for all the candles on the chart and store the values in our price information array. Before we can draw the object we want to use object delete for the current symbol on the chart to delete any formal objects called simple channel object. We will not have such an object the very first time we call the code but afterwards, we want to make sure that we remove the old values before we draw a new object and to draw that object we use object create, if you mark that and press F1 you will learn that it can take up to thirty coordinates, we need to pass a few parameters, so let’s go through the values one by one. The first parameter is for the current symbol on the chart, the second one is for the name of the object, I have called it simple channel object,