Trading Indicators Explained With TradingView 4: Moving Average Convergence Divergence (MACD)

Trading Indicators Explained With TradingView 4: Moving Average Convergence Divergence (MACD)

YouTube Video

YouTube Video Transcript

[Music] hey this is David for big bits in this video we’re gonna take a look at the moving average Convergence divergence otherwise known as the MACD indicator which you can find on trading view it is one of the built-in indicators so if you want to search for it you can just type in MACD and it’ll be the first result as a built-in indicator and you can click to add it I’ve already done that and it is down here on the chart you can see it consists of two lines the blue line being the MACD lied and the orange line being a signal line and I’ll explain to you what this means in just a moment and there’s a histogram which shows the difference between these two lines and of course I’ll go in and show you more about this but as part of this series where you’re going to discuss in detail the calculation for the MACD so you can kind of understand why the movements in the indicator happen and also kind of how you can anticipate what’s going on because you know how it’s calculated so really to get started I want to show you a definition for it that way you can see exactly what I’m talking about first of all and this is a reference to investopedia I’ll put this in the description of the video so you can have a link to it as well but the moving average Convergence divergence there’s a trend following momentum indicator that shows the relationship between two moving averages of the securities price now I am just reading this from the site that’s because they do a really good job of explaining it the MACD is calculated by subtracting the 26 period exponential moving average from the 12 period EMA now if you’re curious what an EMA is I have another video about that in this same series so you can go back and look at that video but basically it’s just a moving average of the price that’s weighted more heavily on the newest candles so if you’re interested in that please go look back at that video otherwise we’re gonna continue on just kind of assuming you know what an EMA is the result of that calculation the difference between those two is the MACD line and then you have a nine period exponential moving of that MACD line which is your signal line which is also plotted on the same chart and those can both be used to trigger buy and sell signals for you and this article will show you kind of how you can do that and we’ll discuss a little bit that later after we talk about the calculation itself and the MACD can have many different types of signals it’s not just whether or not the two lines cross over or how the histogram moves so we’ll discuss that in just a moment but for now let’s go ahead and take a look at how this is actually calculated so the first thing you’ll notice is we have to have a 12 period and a 26 period EMA so I’ve added those exponential moving averages to our charts but you’ll notice here that the MACD those numbers are very small compared to what we see on our actual chart and I know you can’t really see those so let me move my camera here where are you you can see these numbers are much smaller 400 200 compared to the scale of 10000 here so there’s obviously something that makes them much smaller and that is just because as I said before you subtract the 26 period which is the blue line here from the 12 period and you’ll get the orange line down here which is the MACD line and I’ve actually got an indicator here that we’re gonna code that’s gonna be the exact same as this – some of the coloring on the histogram and the color around the lines but it’ll show you exactly how this is done so I’m gonna bring up the source code we’re actually going to go ahead and get rid of the built in MACD indicator because we’re gonna build our own and right now you can see I’ve already coded all of it and I’ve just commented out the code that we haven’t shown on the screen yet so the first thing we do of course is calculate our EMA 12 and our EMA 26 and we’ve plotted just the EMA 12 so let’s actually change this and I want those lines to match what’s on the actual chart so I’ll change that to blue we’ll save that change and so now we’re plotting both these lines you can see the numbers here and here blue and white should match here and here and they do so now we have our 12 and our 26 period EMA plotted on the chart but that’s not what the MACD is the MACD is the difference of the 26 period from the 12 so we’re gonna go ahead and comment those back out and we’ve calculated the MACD by subtracting the 26 period EMA from the 12 period EMA and now we can plot the MACD I’ve plotted it as blue leave the actual color was orange on the other indicator so I need to change those up in the code so give me just some moments there we go all right so you can see now our scale is much smaller we have our difference between these two lines and you can see of course the scale like I mentioned we’re under 500 just like the actual MACD that’s built into trading you so this is our MACD line this is the moving average Convergence divergence line and you notice there was another line we referred to as the signal line and that is just a non period exponential moving average of this orange line and we can show that now because we’ve already calculated that we use the built in exponential moving average function and we calculated the EMA of that MACD line not the price over nine periods back and we say that it’s a signal and we’re gonna plot the signal as blue now so let’s save those changes there you go so now we have that you kind of get an idea of what’s going on you can see as the momentum on the price built up the shorter period moving average went up quicker than the slower period moving average so the MACD line went up and you sell it’s a little bit more jagged so the signal line is sort of a smooth line of the MACD and because of that it lags behind the MACD which is why up here when the MACD peaked and it went down below the signal line the signal line was still kind of moving up because it’s movements lag behind because it’s averaged in from the last nine periods of this line and really doesn’t have as much to do with the current price as far as how it relates to the MACD itself so that’s something to keep in mind you can kind of catch wind momentum can shift if you notice these dips on the MACD line itself even if it doesn’t result in a crossover it can indicate that the lines are gonna get closer if the price does start to drop and maybe you can get an idea of what’s about to happen judging on that and other indicators that you use at the same time so now we have our MACD and our signal line and we can identify crossovers and we can identify movements and on the built-in indicator there is a horizontal line plotted at the zero line and crossovers above zero tend to be cross ups I should say that make the above the signal tend to be bullish above that and below that they tend to be bearish if they cross them but there’s many ways to do that we’ll discuss all this in a moment but the main thing we have to discuss now is there’s one more feature of the MACD indicator that we haven’t talked about yet and that’s the histogram and all the histogram is is the difference from the MACD line to the signal line that it creates with its nine period EMA and I’ve already done that and if you’re curious about the code and you followed my pine script tutorial development series you’ll notice there’s a little bit of interesting code here and it just says that we’re gonna make the color of this green if our histogram is above zero and red if it’s below so we’re gonna head and save this now we can see that on the chart on the zoom out see and get a better idea of what’s going on you can tell when the MACD goes under the signal line the histogram turns red and based on how far below it is that’s how low the histogram goes so that is another part of the MACD that’s basically everything now I’m pretty much just gonna read off some of the important things from this investopedia article because it’s really good it gives you a lot of great information on how to actually use the MACD and how you can use it to determine potential buy and sell signals so let’s go ahead and take a look at this again there’s a lot of great information in this I really recommend you check this out the MACD is often displayed with a histogram which we just talked about which graphs the difference between the MACD and the signal we just did that and you use the histogram to identify when bullish or bearish momentum is high so you can see on this indicator with the MACD the histogram the bearish momentum was very high as the histogram increased two levels relatively high – elsewhere on the chart and the same can be said for the bullish momentum when it is higher on the positive side versus relative areas on the MACD as well so the limitations of the MACD and this happens quite often is that it can produce false positives and essentially that means if you’re looking to trade the MACD and you’re looking for crossovers a lot of times you’ll have a crossover but the price won’t act in the way that you would expect that product crossover to actually happen so for example here is a good one you can see the MACD line crosses under the signal line here and the MACD and the signal line pretty much stay level but the price goes up and if you were to try and trade that cross under and you thought it was bearish here the price would have continued up not only that the price barely moved down here and it cross back up up here so you would have lost considerably especially if you were trading on margin in this example so that’s an example of a false positive you can see on the MACD and this happens a lot other ones occur when let’s see there’s one here there is a bullish crossover here but you see the price pretty much stays flat and this is another example of the false positive where there’s a crossover but the lines just kind of tend to move and hover and just kind of grind their way back to zero as the exponential moving averages kind of level out and meet each other again so those are things you should watch out for and why the MACD is often used with other indicators to help identify momentum changes that can be coming or have just occurred so let’s continue on with this article I just talked about this and a slowdown in the momentum that’s the one I just mentioned we’re sideways movement or slow training movement causes the MACD to pull away from its extreme positions and go back to here so it was way down here the price went sideways and it slowly went back up that’s what it’s referring to here now one of the other things we can talk about here of course are the crossovers and it’s showing that a bit here yeah these are the crossovers we’ve already mentioned this but when you have a bullish crossover while the trend is already going up and you’re above the zero line it’s often very bullish and shows a lot of positive momentum the same can be said for a bearish trend bearish cross down I should say when it crosses downward then of course it is confirming the bullish trend excuse me the preparer is just trend you can see the price is moving down in a bearish way here so when the crossover confirms here that is basically saying that is the bearish confirmation and the momentum should continue down from there now there are also examples of divergence there are plenty of resources on divergence and I’m not gonna read this word forward but essentially you look for divergences from how the price moves versus how the indicator is moving so you can see here the price is moving down but the indicator and is bottoming upwards so it’s finding a higher bottoms the price is finding lower bottoms so it’s it kind of indicates that the price moving down is kind of running out of momentum you find this divergence and it could be good for indicating when the direction of the price can turn around in this case it’s bullish and in this case it’s bearish excuse me price goes up while the indicator tops out going down and it confirms and the price continues to go down that is a sample of a bearish divergence on the MACD now there are also rapid Rises and RAM pitfalls that you can use I won’t read this entirely but it kind of gives you an idea of when things are overbought you can see there’s a huge jump on the MACD here but when you use this with other indicators you can also tell that it is overbought and it might be a good time to actually sell there or when there was another rapid rise here it might be another opportunity to sell here when other indicators also indicate that it is overbought so this shows an example with the RSI we’ll do a video about that later well but for now we’re just focusing on the MACD and you can just keep an eye out for those rapid rises on the MACD especially after continued trends like that and as the MACD stays above it might indicate that momentum is running out and so there’s a quick rise up and it’s also a good time to look for those divergences as well so that pretty much covers it for this video if you like the video please like if you like these types of videos please subscribe to the channel we have all kinds of videos about other indicators and we also do a tutorial series on pine script for trading view so that you can learn to create indicators like we did in this particular video to basically come up with your own indicator or create your own strategy that is something that we also do in that series so if you’re interested in that please subscribe and check out that video series otherwise you can also check out my trading view profile we have tons of scripts I also post some ideas occasionally but I’m mostly focused on development so I won’t post a whole lot of ideas but you can see all the scripts that I’ve created we have tons of likes on a lot of these scripts and got several followers now on the account building up the reputation please check out the profile if you like anything you see please like that of course but other than that thank you and have a nice day [Music]

YouTube Video Description

< br/> #bitcoin #crypto #cryptocurrencies #tradingview

Video resources:


Trade on Coinbase:
Brave Browser:

DISCLAIMER: All my videos are for educational and entertainment purposes only. Nothing in this or any of my videos should be interpreted as financial advice or a recommendation to buy or sell any sort of security or investment including all types of crypto coins and tokens. Consult with a professional financial advisor before making any financial decisions. Investing in general and particularly with crypto trading especially is risky and has the potential for one to lose most or all of the initial investment. In simple terms, you are responsible for your actions when trading.