 What's going on everybody this is Giovanni from spy options trading. I'm really excited to make this video today for you guys. I think it'll be very helpful for all you technical traders out there to visually build a script on ThinkScript to help you identify easier quicker and a more clear picture of your strategy. This is going to be a very extreme basic tutorial on ThinkScript. There's a couple of basics that you have to understand about scripting but I'll show you here today. I'm just going to make a quick sort of script or algorithm using the MACD indicator. It seems to be a very popular one so let's get right down to it. On our chart here we're going to right click hit studies edit studies. We're going to look up the MACD indicator. We're going to right click on it and then we're going to view this is essentially the code for the MACD line everything you see here. We're going to copy and paste part of the code here for our script and highlight all of this all of this okay just down to here. The reason why it's just down to here is all the other coding is mainly just for colors and whatnot so this is the actual meat of the script so we're going to copy exit we're going to create our very own don't forget to name it first so we're going to use example underscore MACD underscore YouTube because this is going to go on my YouTube channel we're going to hit copy and paste and really quick the first thing I need to do is anywhere it says plot we're going to change those to def or define perfect and we're going to enter enter start new line here next thing you're going to do is you're going to copy and paste from down below I've put it in the description below the two sort of custom scripts for the signals so this is going to be for up arrows so we're going to use the up arrow one we're going to copy paste you can see it's arrow up so here in between these two here we're going to actually script in our algorithm our criteria for the up arrows so let's say for instance as of right now I'm just going to hit okay I'm going to hit okay let's say for instance we're looking for the fast line to cross over the slow line anywhere crosses up going up right so maybe like right right here maybe right here but let's just say again just for example purposes we are going to hit edit and then really and truly we need to know and understand that which one's the fast line and which one's the slow line in our script here so it is going to be the value is the fast line and the average is going to be the slow line so anytime the value line crosses over the slow line which is the average so really quick again this is where your knowledge basic knowledge of scripting comes into play plain we are looking to find where the value previous is less than the average previous and the value of the current is now greater than the average of the current so and essentially in a nutshell to describe what's going on here the fast line in the previous candle is less than the average of the previous candle but now the fast line is now greater than the slow line currently and we're going to hit apply we're going to hit okay apply okay and there you have it folks this is everywhere the fast line crosses over the slow line you can see right there you can see in pre-market there see here there there and there there I mean there's it crosses over many times let's add a little bit more criteria let's add a filter let's say you only want to see where the fast line crosses the slow line but is above the zero line so you only wanted to cross up above so we're going to right click studies edit studies edit sources so we've got to hit and say both lines the value line is greater than the zero line and the average line is greater than the zero line and you can tell here that we've defined what the zero line is so this is why we switch all the plot sort of places where it's a plot to define because we have to define what we need to script here so value is greater than zero average is greater than zero so we're going to hit apply okay okay so see how it took away all these other ones here now we're left with just this one and this one in pre-market so anywhere the fast line crosses over the slow line above the zero line you'll get a signal there let's just go back just to quickly back test here crossed over there see it's the only time and crossed several times here look at that good deal again this is a very basic tutorial of things script you can filter this as much as you'd like you can keep adding filters or scripts or criteria or algorithm whatever you like to call them and then you do the exact opposite on the down arrows you hit studies really and truly um you can take this edit source you can just copy all all of this here and then we're going to hit create now we're doing example macd youtube down for instance delete this copy and paste everything everything's going to stay the same except that we're going to change greater than equal to literally the exact opposite of what you see here and there's another thing that you have to switch is the arrow up we're going to change that to arrow down and but again i'm just going to go ahead and put this custom script for the arrows down below both separate ones so we're going to hit okay but on top of that we're going to change the color by hitting the gear here like using this here okay apply apply and there you have it anywhere the fast line crosses the slow line going downward and it's below the zero line you're going to get a red arrow you can do this with any indicator you just have to copy and paste the actual code of of you know the actual indicator for instance rsi line view you can hit inputs define define do all the way down to right here this is the rsi line another very common indicator to use you would just copy this change your plots to define and you can start scripting again you have to have a very basic knowledge or understanding of scripting like that before which is this one right here in brackets the one in brackets that means the before sort of candle and that's how you find crossovers if you guys have any questions of any sort comment down below don't send me an email what i am trying to do with this video is if you have a question i will help you as much as i can with the knowledge that i have with the limited knowledge that i have and the reason why i want you to put a comment in here is somebody might have the same question as you did and everybody can find that answer easily within the comments if this was helpful or if you like this video give it a thumbs up don't forget to subscribe to my channel if you haven't already like and share my videos i would greatly appreciate it guys and i hope that this helps you become a better trader guys thank you so much