 Okay, welcome back, Extraiters, and we're going to dive right into ThinkScript, because in the previous video we actually looked at some pre-made or already created scripts, which were the S&P sectors and the S&P labels. So now we're actually going to jump into looking at how to plot things, how to create not just column scripts, but how to actually create some of these chart scripts that we created up here, and we'll even dive into a strategy one. So let's get right to it. We're going to start off, let me switch over here, start off with the Extraids column script. Okay, so the Extraids column script is a breakout script, okay, and the whole idea behind the breakout script as is denoted here in the comments is we want something to alert us to a breakout. Now the way breakouts normally work, just in case, or just to be clear, just to be clear, the way breakouts work is what we want to be looking for is something like this. We have a bar, right, that does that, and then we have another bar that does something similar and maybe it has like a wick, right, and then we have another, we might have like a down bar here, right, the next day, which might even have wicks up there and down here, and then eventually it tries to go again. And so you get this sort of, you know, pattern where it's knocking on the door, it's knocking again, it's knocking again, it's knocking again, and it creates, obviously, a sort of resistance, right, up against which it keeps bumping in. Eventually, eventually, it might garner enough support to break above that level, right, and then eventually, not just close above, but it will actually open and close above, right, and then we can do one of two things. We can take a riskier trade, and this would be the riskiest one of all, because we would, well actually, let's say that this would be risk B, right, and why do I say, whoops, that's a big fat B, why do I say this is risk B, because we would actually want this to do something like come back down and test this level, right, before it actually takes off, right. This is what we would want to see, so this would be the risk, or the type A trade, right, the type A trade, grade A is when it actually retested support and then bounced up, and the breakout is confirmed and completed. The riskiest, which would be grade C, would be if we actually take it somewhere here, or even here, we might decide that it's going to, because it broke above, then that's enough. We definitely don't want to do a D, which is it keeps bumping up against the support level, right, it bumped once, bumped twice, bumped three times, bumped a fourth time, this looks like it's going to break. Let's go ahead and take the trade. That would be the riskiest, because this could just as well wick down the next session, and then keep wicking lower and then just dive down, right, it could end up being like some sort of a double or triple or multiple top or whatever, or just simply a failed breakout, right. That would definitely be something that we do not want to do, that would be extremely risky and actually imprudent, right, on our part. C would be the first acceptable risk level trade, which would be okay, it broke above and it actually closed above the support level, yeah, they might do that, but then they might also open up immediately at this level, right, let me see if this will do or undo, it might open up here and then just dive back right down below that supposedly broken support and then, you know, you're back down below here, which is no good, so this would still be a risky trade, but some people still go for that, I would consider that a lotto if I did do that, because that is still very high risk, this is least risky or less risky, sorry, because it already closed above here and then it opened, well, this could be seen as one of two candles, either green or red, it either opened here and then took off, right, but it never actually touched the support line, so it never really tested the support, or it opened here and then bullishly, you know, skyrocketed back up, if it did that then that's a little bit better, but it's still not grade A, grade A would be that you actually want to retest that before it takes off, the problem is that some people don't want it to do that, because instead of retesting it just might rock it, right, so, but regardless, the safest grade A trade would be after a retest breakout and retest of support, then it takes off, so this is what we kind of want to be alerted, or this is what we want to be alerted to, all right, so this is what we're going to start looking at today and we're going to do, we're going to do it with a column script first, and eventually we're going to do it with a chart script, all right, so, okay, so let's get started with this script, so first we want to define a length, a period length, so we define it 15, so that would be, you know, 15 bars, whatever, and we're defining the price, you know, as close, so whatever the closing price was for that bar then that's going to be our price variable, so we have two variables, all right, and now what we want to do is we want to define a high price, so at some point, actually, oh, let me see, can I get this drawing back? Oh, I don't think I can get that drawing back, at some point, right, we want to be able to find what the highest price was, so if we had, let me have to draw this back again, so let's say that we had the one bar here, all right, and then maybe it had another bar here, and then another one started down here, all right, and then over there, all right, and eventually it broke out, well, that's pretty bad, eventually it does break out above what we consider to be our support level, which is going to be somewhere in here, okay, try to do that again, all right, so that's what we have, okay, so if, oh, that's still working, okay, I have to end the drawing but not erase it, there we go, okay, so what we would want is to find some sort of a high price, right, so we're actually going to be moving backwards in time from whatever today is, and we're going to be looking at whatever the high price from back then was, now remember this candle has not happened yet, right, so we're going to define a variable, we'll call it high price, and we're going to set a counter to number two, okay, remember where, how we normally set this to zero, well, here's one of those cases where you want to set it to two, and we'll see in a little bit why, because it's going to serve as an offset, all right, and it's going to go, that counter is going to count from two to whatever the length was, which is 15, okay, so it's actually going to count 13 periods back, so that's 13 candles, right, okay, and we're going to, again, we're using, we're introducing this idea of with, which means that every time that it counts, it's going to carry something with it, okay, and it's going to be a holder, a placeholder value, which we started zero, okay, so every time that it counts backwards, every time that it does that, it's going to do something with this holder variable, okay, what is it going to do, okay, if whatever the high, remember it's green, so it's a reserve word, whatever the high closing price, obviously, sorry, whatever the high, not the closing price, whatever the high was for that day, okay, for the counter, which is going to start, again, at two, so we're going to start looking for the high on counter equal to two, so that means that we're not going to look for the, remember this one hasn't happened yet, okay, let me kind of cross that out to see if that helps, this one hasn't happened yet, okay, so this is the one that is current, so this is zero, this is one previous, so that's one, this is two previous, so this is two, and this is three previous, and so on, so this candle is three, so what's going to happen here is it's going to start counting or looking for the high of counter two, which means it's going to go zero, one, two, okay, so it's going to start from here, so it's going to omit these two recent candles, all right, so it's going to start at two, and it's going to check to see if that high is greater than the holder, so obviously holder is zero, so whatever the high for that first day, it's going to be greater than the holder, which is zero, if it is, then it's going to take that high counter, right, else it's just going to keep the holder, all right, which would have been zero, okay, so that's what it's going to do, all the way from two, it's going to go back, checking to see for whatever the high was on each day, and if that high is greater than whatever holder was, then it's go ahead and replace it with that new high, otherwise it's just going to keep whatever holder was, all right, now we've defined this high price, what it's going to be, and that's actually going to use that fold function that we talked about, and it's going to go backwards in time, now that's great, it's going to be storing, it's going to be searching through the past 13 days, actually 15, because the first two don't count, right, but the past 13 days, looking for the high, and sticking whatever that high is in holder, so at the end, holder is going to have the high of the past 13 days, okay, now that's great, what are we going to do with that, okay, so we're going to define a trigger, I just happened to call it trigger, okay, if the close on day one is less than the high price, all right, which we defined, let's say that the high is 70, if the close on day one, okay, is less than 70, less than the high price, and the close today is greater than the high price, all right, so that's like if this, if high price is somewhere up here, 70, and today the close on minus one is less than that 70, right, and also today's close, which would be some day in the future, which might be this one, is greater than that high price, whatever that level was, then assign, trig the value of one, else if close two is less than high price, and close one is greater than high price, so it's the same thing, we're just moving close back from one to two, right, and we're moving this one from today to one, right, and the close is greater than the high price, then we're gonna assign it a value two, now this will make a little bit more sense in a little while, else if, and this is the final, else if, this is the final if, the close on day three is less than the high price, and the close on day two is greater than the high price, and the close today is also greater than the high price than three, okay, now let's take these, let's see if I can break these down for you a little bit clear, here's the first one, starting at if, then one, okay, and I do this, I'm probably gonna get an error, else if, then two, else if, and you leave another space here, okay, so this is what's actually, I could even add this here, just to make this a little bit cleaner for you guys to see, all right, so here we go, we have, we're gonna do this, right, else if we're gonna do this, else if we're gonna do this, all right, oh, and then else zero, so we, trig is gonna end up with either a zero, a one, a two, or a three, okay, and think about this, if today, if yesterday's close is less than the high price, and we're assuming that the high price is whatever the support level is, right, because it's the highest that it's been in the past, if yesterday's close is below that price, and today's close happened to be above that price, then that could be a breakout, so let's give it a number one, else if, the day before yesterday is below the high price, and today's, or sorry, yesterday's, because this is the day before yesterday, is below the high price, and then yesterday is above the high price, which means that it already broke out, right, so that's similar to that first condition, but also today's close is also higher than the high price, and that means that you have two candles above the high price, today's close and yesterday's close, okay, see, yesterday's close above, today's close below, right, and only the day before yesterday's below the low, then this is going to be given a number two, it's still a breakout, it could still be a breakout, right, but it has a better probability of being a breakout, why, because here we're saying that this one is below and this one is above, here we're saying that this one is below and this one is above and this one is above, so there's two of them above that support line, that makes it a better quality indicator, so we're going to sign it a number two, okay, so you might want to pick number ones if you're risky, I'll take a lotto, you might pick number twos if you're being a little bit safer, now else if, right, if the close on the day before the day before yesterday is below, the day before yesterday is above, and the day, and then yesterday is also above, so below, below, and then above, below, right, above, sorry, above, and then above, so how many are above, two, this one, and this one, right, and this one was below, so then we're going to sign it a number three, because it's an even better indicator of a breakout, so else zero, which means definitely don't take that, not even if it's, you know, not even if it's a lotto, you don't want to do that, okay, so we're basically assigning trig zero, one, two, or three, and we're saying zero is no trade, one is, it's an okay trade, it's risky, two, it's less risky, it's pretty good, three, that's the best, that's what we're looking for, okay, so let me just bunch this back up, I actually don't know if it would have worked if I left it like that, it might, okay, let's see, else, okay, so there's, oh, and then this one, okay, so there's our trig, okay, so we're defining the trig here, and now we have a value, either zero, one, two, or three, okay, so what do we do with that, we're going to add a label, okay, and yes, it's going to be visible from the get go, and if trig is greater than zero, then it's a breakout, right, it's a different quality breakout, depending on whether it's one, two, or three, but it is a breakout, so that label is going to have the text breakout, and we're going to give it the number right next to it, it's either a breakout of grade one, grade two, or grade three, else, okay, if trig is not greater than zero, which means it's less than zero, or equal to zero, then nothing, and just blank, it's not a breakout, right, and we're going to give it some color, just, you know, for show, so it's going to be color plum, and then we're going to assign a background color to that label, right, just to make it stand out some more, so if trig, which means if we have a value for this, which we should, then color yellow, else just leave a white space, right, there's no, there's a text that's going to say breakout zero, or breakout blank, but it's got a white background, so that's not going to be a trigger, so let's go ahead and see this in action, X trades column script, so we go over here to market watch, right, and we pick now, here's something important, market watch is looking at the Russell 1000, the Russell, the main Russell is 3000, so that's a lot of stocks to sift through, because it has to calculate everything that we just did, you know, it's got to go back 15 candles, only count 13 of them, and then store the values, and then compare it against yesterday's close day before yesterday, and day before day before yesterday, and that's a lot of stocks to go through, so remember you don't want to get rate limited by the thinkorswim service, so let's do it with smaller sample size, let's do it with the S&P 500, all right, and let me get rid of this, because this is a clear screen, okay, all right, oh, I didn't turn off the drawing, there we go, okay, so what we're going to do, and we're going to remove this one, because remember when we did this script on the video way back when, I'm actually going to link to it here, it was called the monthly yearly return script or something like that, we actually had some issues, because we had another M percentage column next to it, and then some of them were appearing up as we're showing up as loading or they weren't loading properly, you don't want to have too many of these scripts calculating at the same time, so let's go ahead and remove the three month script, okay, we'll just do that, and let's go ahead and look for the x-ray column script, let's see if we can find that, go to, I guess we can't sift through, okay, so let's just go and look for x-trades, oops, trades, okay, breakout column, that's what I called it, all right, wait, is that what I called it? Yeah, that's it, that's the one I called it, okay, all right, so let's go ahead and put that one on, add items, right, and okay, here we go, so we removed the one that was here, and we got this one, let's actually move wherever that is, let's move it up, so you can either just drag it or you can use the move up or down buttons over here, and there we go, x-trades breakout column, okay, so what does that mean? It means that these guys are not breaking out, they have a white background, and these are, this one does have a breakout, so let's go ahead and take a look at the chart of Comcast, so let's go to Comcast, add charts, CMCSA, and boom, there we go, oh yeah, that's that's pretty clear, so it went back two candles, right, not this one, not this one, it went back at least two candles, so starting here it started to find whatever the high was, and whenever it found the high, which looks to be this one right here, where the high is 43.53, right, as given by the pie right there, that's 43.53, oh wait, it's 43.38, this one is 43.53, this one is 43.11, so definitely 43.53 is the high, right, that it's going, that it found in the past 13 or 15 candles, you can clearly see, and then it has a breakout, right, and it has a breakout because these candles broke above whatever that resistance was, let's go real quick to, okay, right, and remember that it was above zero, so we gave it the breakout text, right, and we assigned it a color plum, but we also said that if the trigger had been given, then it would be, it would have a yellow background, so that's why we see, right, a plum color text with the yellow background, and right next to it, you can see is the actual trigger number, right, let me see if, okay, we're gonna say it's a breakout, if it's greater than zero, and what level of a breakout is it, well we're gonna add, trig, the value itself, right, we concatenated or appended that to the breakout, so that's what that means, it means that this is a two breakout, that this is also a two breakout, which is Boeing, which is actually one that I was looking at really recently, okay, Boeing, again, it found the high, which is probably that one, and look at that, it's got three candles now above that, okay, and let's go over to, let's find a one, one, there it is, the Dow, Dow, I think that's the actual Dow company, not Dow Corning, that's the actual Dow, as in the Dow Jones, it's also a company, let's go over here, or it could be Dow Corning, let me see, no that's Dow Inc, yeah that is Dow Corning, okay, so this one has, this is the high here, it only has one candle above, right, that resistance, so it is a one, all right, that's why it's a one, Procter and Gamble, P and G, or PG, that is also one, and this is the high right there, and it has one candle above, now let me just check, because I just kind of noticed something, these are both twos, Boeing and Comcast, but it seemed to me that Boeing had three candles above, so something happened, let me see, that would be the high, that does have three candles above, so I'm not, I'm not quite clear what happened there, but you see the point, it's a very, very powerful script, because you can get the breakout, and let me see if there is a three one, doesn't seem to be one, at least not in, you know what, probably not in the S&P 100, but we could probably find one in the NASDAQ 100, which should be here, or sorry here, because these guys rallied more, here we go, NASDAQ 100, and breakout ones, ones and ones, okay, we're at the bottom of the list, can we find a three, no, not in the NASDAQ, today was not a very good, ugh, it wasn't a very good day, I mean it was a good day, it ended up positive, but let's go see the sectors, I believe I have a watch list for the sectors, watch list, top watch list, top 21 losers, S&P 500 sectors would be here, all right, the highest was, it's not going to give me, are you serious, it's not giving me a, okay, let me fix that real quick, customize, let me get the description here, symbol is no good, there we go, oh, there is no description, all right, well that's no good, that's odd, there we go, description, let's put that in, and we probably don't even need the symbol, we're gonna need it for a different list, but okay, okay, utilities and real estate, okay, those were, wait, oh sorry, those were actually the lowest ones, the highest ones, information technology, okay, that's cool, let's see, IT, where were we, charts, I believe, no, market watch, okay, so let's look in here, and information technology, sector disease rate by industry, here we go, information technology, let's just get all the sector, that's a lot, but okay, there it goes, it's sort of working, yeah, that's probably a lot of stocks, so we have a breakout two, one, one, actually we're not seeing a three here, well we'll leave it at that because it seems like it's gonna be a little bit, oh, you know what, what am I doing, I can just sort this there, breakout two, here we go, one, two, yep, no three, all right, well we couldn't find any in here, so the other one was real estate, let's see if we can find anything in real estate, if we can find any threes, there's all the ones, the twos, and no threes, all right, well you get the picture, there's the script, and I believe that's a wrap for today's video because it's already 27 minutes long, so we, again, what did we look at, we basically covered a very quick and dirty version of the fold command, but I did really want to get into that one, okay, and I kind of gave you an explanation of how it works using a graphical, I'm gonna try to post an image of what I mean, have on an index card of how it goes back and looks for the high of the day, right, of the previous days, and how it assigns those values zero, one, two, three, and then from there on it's, you know, it's pretty simple, and in the next video we'll look at some plotting, okay, all right, so I hope this was clear enough, I hope this was clear enough, and if you have any doubts or questions, go ahead and drop a comment, if you liked the video, go ahead and drop a like, and drop a comment as well, if you have any particular subject you want me to cover pertaining to either ThinkScript or Thinkorswim or anything else, and I will see you guys in the next video, so have a great one!