Transcripts
1. Introduction: When it comes to day trading or scalping, which is basically just short-term directional trading. There are obviously a host of different strategies and techniques and approaches that you could use to actually go about doing this. And in this course, you're gonna see my personal approach, which is based entirely off of proven statistics and probability. And specifically in this course you're going to see how you can apply the concept of standard deviation to know objectively if the market has actually gone over, extended over any time period, either over one day, a few days, a week, a month, et cetera. And based on these points of overextension, you will then know mechanically when to enter the market and make a trade, as you will also see in this course with the day trading or scalping simulator that I programmed, it is definitely possible to gain an edge and therefore long-term profitability when day trading or scalping using this approach. And if this is the first course and when you've come across, my name is Scott race. I currently work as both a software engineer in the financial services industry and I'm also an entirely self-taught and self-directed trader and investor in the stock market. And much of my statistical and mathematical understanding of both the stock market in options comes from my time in college where I study both computer science and economics at UC Berkeley and in my courses that you'll be learning a lot of the information that I was taught in college as well. On top of that, you'll also be learning all the information that I have acquired, actually applying the stuff in the real markets. And lastly, before getting started here, I do want to announce that you can now find me on YouTube. I have recently started my own channel where I'll be continuing to push out content related to trading, investing, and personal finance. And you can simply navigate to my profile page on skill share. And there you will find a link that will direct you right on over to my youtube channel. So please check that out and subscribe so you don't miss out. And so with that being said, we're going to jump on over to my computer now and we'll get things started.
2. The Importance of Expected Value: All right, welcome to the first video of this course on a statistical approach to day trading or scalping, which simply means you are making short-term trades, right? You could be either entering and exiting and trade within the same day, hence the name day trading. Or you could be entering and trade today and then maybe a few days later, that's when you exit. Either way, these are short-term trades, and specifically these are going to be short-term, purely directional traits in the sense that you're either going to be buying stock and hoping the price goes up, or shorting stock and hoping the price goes down. Buying futures, selling futures, same kinda thing, purely directional trading. And so as a result of this, you're going to have to find the edge in the random world being the stock market. Because especially in the short term, over a few days, weeks, or even months, the stock market really does resemble a random system, which is why directional trading is so difficult. But it's definitely not impossible, however, to still find an edge. And that's what this course is going to be about using a statistical method or approach to find an edge in short-term directional trading. So let's go to the next slide here. And so in this video I wanted to cover the topic of expected value because this will allow you to determine whether or not you've actually found an edge in your trading strategy. And therefore, as a result, if you are indeed a profitable trader. Moreover, this will also illustrate what exactly you need to be shooting for to reach profitability when you are making short-term directional trades. And so expected value is simply a statistical term. But at least in the case of trading here, it will specifically allow you to project the future average outcome of the trades are making based on your current trading strategy. And so like I said, based on this projection, this is what will allow you to determine whether or not you've actually found the edge and therefore have reached profitability in your strategy. And the cool thing is that this is actually just a simple mathematical calculation. It's very black and white. A yes or no answer in terms of whether or not you're going to be successful long-term day trading or scalping. And so, like I said earlier, the stock market really does replicate a random system. Meaning whether stocks go up or down on any given trading day really is a matter of a flip of a coin. It's about a 50-50 chance that stocks will either go up or down. And there really is no way to get around this number. When you look at the win rates or the success rates of some of the best stock traders in the world. They are typically correct and make money about half the time. Half their trades are around 50% of their trades are actually profitable and the other half are not. And that's because there really is no edge in determining whether a stock is gonna go up or down in the next couple of days, just like there is no edge and trying to predict the outcome of flipping a coin, right? It's simply impossible to accurately and consistently flip a coin over and over and over again and be correct and calling heads or tails more than half the time. And I will actually give you a demonstration of this fact at the end of this course, when I show you the scalping simulator that I programmed, which uses real historical stock market data. And you'll see that the wind right, is right around 50%. And so now what does this mean? If you want to be successful at day trading or scalping? This means that on average then your profits need to be greater than your losses. And this is where the concept of expected value comes into play. Because if you know your average profit portrayed and your average loss portrayed and your win rate, which is pretty much a given right around 50%. Then using these three numbers, you can project what the future average outcome of your trades will be. Meaning specifically as you continue making trades into the future. Of course, some of those trades will be profitable. Some of those trades will not be. But taking the outcome of all those traits together and averaging them together, is the average outcome going to be a positive number or a negative number? And of course, the goal here is for it to be a positive number because that means, of course, as you continue making trades, then on average, the outcome of those trades is positive or profitable. So then if you keep making trades like the way you're currently doing, your account is steadily growing in size. Of course, Sundays or some weeks or some months might not be good. You might, for example, go through and account drawdown at some point in time. That's totally expected in a very natural thing to happen. But as long as the expected outcome of your trades is positive, is profitable, then yes, as you keep making trades over a long period of time, you should be expecting your account value growing. So let's look at a few examples of this. In example one, let's say you've made a 100 trades at this point. And now looking back at this 100 trades that you made, Take all the profitable trades and average the results, and that will give you your average profit for trade. Sometimes you might make 200 bucks with a profitable trade. Other times you might only make 20. But on an average, let's say it's right around a $100. And then same thing for your average loss as well. So I'm older losing trades you've made so far in the past. If you were to average the losses of those trades, then like I said, let's say the outcome of that is you'd have an average loss of minus $100 for any of you are losing traits. And so now tying in expected value, the simple mathematical calculation you can use to figure out whether or not you do indeed have a profitable strategy in your hands. You simply take your average profit, you multiply it by your win rate, which is 50% in this case. And then you subtract from that your average loss times your loss rate, which is also in this case 50%, right? Because if you went half the time, that means you also lose half the time. So 50, 50% percent. And so if we take 100 times 0.5 minus 100 times 0.5, we get 0. And this is not good because as you continue making trades going forward into the future, expected outcome of your trades is $0. You don't make any money and you don't lose any money. And that should make sense because on average, if you win half the time and you make a 100 bucks and you lose half the time, and you also lose a 100 bucks in that case, then averaging everything together, you should make or lose no money. And so like I said earlier, that's why we want the outcome of this little calculation to be a positive number greater than 0. So let's look at a different example now. Example two. Let's say now the average profit is 75 bucks, but your average loss is a bit larger and it's minus a $125, your win rate is still 50%. Your loss rate is still 50%, right? Because short-term trading really is a matter of flipping a coin. So once again, applying the mathematical calculation here, 75 times 0.5 minus 125 times 0.5 gives you an expected outcome of minus $25 per trade. And this is definitely what you don't want, right? Because now as you continue making trades, you're going to be steadily losing money half the time you make money on your trades. But if on average, you only make 75 bucks for each of those profitable trades, and then the other half the time you actually lose a 125 bucks per trade on average. Than just thinking about this conceptually, it should make sense that yeah, as you continue making trades, you're going to be slowly losing money. In this case, you'd be losing about 25 bucks for each tray that you make going forward. And so this is why coming to our third example now, why your average profit must be greater than your average loss if your success rate or your win rate is pretty much going to be pegged right, around 50%, right? Because in this example, just flipping the numbers around. If your average profit now is a $125 and your average loss is minus 75. Once again, applying the calculation here, you actually get a positive expected outcome of twenty-five dollars. So now as you keep making trades, of course some of them will be losers, others will be winners. But because on average your winners are greater than your losers, that means everything together, your wins and your losses, you'll still be making money and growing your account in the long term. So this, an example of three here is the exact kind of thing you want to be shooting for. When you are making short-term, purely directional trades, you have to find a way to make your profits on average greater than your losses, because you really don't have any control over your actual win rate. You can't be right more than half the time flipping a coin. And because stock price fluctuations in the short-term behave in a very similar manner, then there is no way to be correct about whether stocks go up or down more than about half the time as well. And so then naturally this begs the question of, so how do you get your average profit to be greater than your average loss? And there is no one single way to do this. But this course will show you one of those ways, specifically using statistics and probability. And so in the next video, you're going to start to see how exactly this will work.
3. Standard Deviation Overview: Alright, thanks for joining me here again in the next video of this course. And in this video here, I'll be giving you just a brief overview of standard deviation and probability. I'm not gonna go too in depth in this video or in this course. I simply want to show you generally how the stuff works and then how we're going to apply it to the stock market. But if you do want to see a much more in-depth look at standard deviation and statistics and probability and how all this stuff works. You can watch my other skill short course called options trading, understanding stock market behavior and that class like a several ticket deep dive into this stuff and basically prove that the stock market closely resembles a near perfect random system, which ultimately as why this statistical approach to day trading or scalping actually works. So now diving in here in order to understand what standard deviation is, you first need to understand what the bell curve is. And the bell curve, also referred to as the normal distribution curve, is simply used to calculate the probability of an event occurring. Now the main caveat here with using this curve to actually model a random system is that the system you're trying to model actually has to be a random system. So for example, if you are rolling a pair of dice, flipping a coin, modelling the stock market, et cetera, these kinds of things that do exhibit random behavior. You can use this curve to figure out the probability of a specific event happening in that random system. So coming to the next slide here, standard deviation now is simply a way to specify a range of outcomes. And the chance or the probability of an event occurring within this range is what you use the bell curve to figure out. So for example, here I pulled an experiment that I did in the other skill share course, I mentioned where I wrote a computer application to simulate flipping a coin. And in that simulation, we did 10 thousand trials of flipping a fair coin 100 times and then recorded the number of heads that we got for each of those trials. So flip a coin a 100 times, maybe we got 48 heads and 52 tails. Write that down, then repeat that process again. Flip the coin and other a 100 times. Maybe this time we got 55 heads and 45 tails. Write that down and then just keep repeating that process 10 thousand times. And then after the simulation was over, I simply plotted the results on this chart that you can see right here and right off the bat, I'm sure you can notice that the chart resembles a near perfect bell curve that you saw on the previous slide. And once again, that's because the process of flipping a coin is a random system. And so all of this chart is showing you is for each of the 10 thousand trials we did, were simply marking How many of those 10 thousand trials yielded 50 heads, or 49 heads, or 36 heads, and so on and so forth. So for example, and I'll back out here again so you can see my mouse. You can see on these 10 thousand trials of flipping the coin 100 times, the outcome that was most frequent was getting exactly 50 heads going up to the right here. And then over to the y-axis, you can see this specific outcome occurred about 850 times. So 850 of the 10 thousand trials gave exactly 50 heads and exactly 50 tails. And it should make sense that this particular outcome happened the most because flipping a fair coin gives you exactly if 50% chance of getting heads and a 50% chance of getting tails. So that means if you flip a coin 100 times, you would expect to get exactly 50 heads and 50 tails. And so the further away that we get from 50 heads on both sides here, you can see that the number of times these particular outcomes occurred are much, much less. And again, that should be expected because flipping a fair coin a 100 times and getting like 65 heads and only 35 tails as a pretty unlikely outcome. So of course, these kinds of events are not going to happen nearly as frequently. And now tying in standard deviation into this, you can see the standard deviation for this experiment is five. And so what this means here is you take the standard deviation, you subtract it from the average, which is 50 in this case, and that'll give you 45. And then you also add it to the average, and that gives you 55. And so your one standard deviation range is between 4555, which you can see on the chart right here. This is the range. And so now if we go back to the previous slide and we refer to this theoretical bell curve right here on the x-axis, these little symbols right here, these are simply sigmas, it's just a Greek letter. And sigma in the world of statistics refers to standard deviation. So this range right here, between negative 1-sigma and positive one sigma. This is a one standard deviation range. And these percentages right here, these are the probabilities of something occurring within these ranges. Now in this diagram, in particular, this one standard deviation range is broken in half. So to get the chance or the probability of something occurring within this entire range, you just add these two probabilities together. So that would give you red around 68%. So now coming back to our experiment here, one standard deviation range for this experiment is between 4555. That means if we were to flip a coin 100 times again, the chance or the probability of getting a number of heads between 4555 is 68%. That is the probability. And so this also means that if there's a 68% chance that the next time we flip a coin, a 100 times the number of heads falls within this range. That also means there's a 32% chance that the number of heads falls outside of this range, either below 45 heads or above 55 heads. And that's simply because probabilities can't go above 100%, right? So 100% minus 68% is 32. And once again, if we come back to the theoretical bell curve here, if you were to add up the probabilities on the left-hand side and the right-hand side of this one standard deviation range, you would get exactly 32%. And so now expanding further on this, if you want an even greater certainty of something happening in a random system, right? If you want it to be more certain than only 68%, then you could just use a two standard deviation range. And all you have to do to calculate that is you multiply the standard deviation here by two. So in this case you would get ten and then you would subtract it from the average that will give you 40. And then you also add it to the average that gives you 60. Now between 4060 is your two standard deviation range. Looking at the chart here, here's 40, here 60. And you can see looking at this chart, the vast majority of the outcomes in a simulation fell in between this range. And specifically this means, again, flipping a coin 100 times more. The chance of getting a number of heads within a two standard deviation range. Between 4060, there's a 95% chance of that happening, right? Coming back to the diagram again here, you can see this negative two sigma and this positive two sigma. Here's a two standard deviation range right here. So now adding up these probabilities, 13.6 plus 34, plus 34 plus 13.6. This will add up to right around 95%. And you can keep repeating this process to get even more and more certain of something happening in a random system. You could use a three standard deviation range, or four, or five or six or so on. Although going beyond three really isn't necessary because once you are looking at a three standard deviation range, the chance of something occurring within that range has a 99% probability. So coming back to the experiment again here, that would mean between 35 heads and 65 heads. You'd have about a 99% chance of flipping a coin a 100 times more and getting a number of heads between these two numbers. And that's really it. I hope this was a pretty straightforward explanation and demonstration of standard deviation and the bell curve. And like I said at the beginning of this video, you can apply the stuff directly to the stock market. You can use standard deviations to specify the chance or the probability of either the market as a whole or individual stocks staying within a specific range, either a one standard deviation range, a two standard deviation range, so on and so forth. And as you will see in the next video, it's one, the market or an individual stock moves beyond a certain range. That's going to be a signal for you to then make a trade on that asset, either buying it or shorting it. So I'll see you in the next one.
4. Application to the Stock Market: All right, we'll come back to the next video in this course. And now in this video here we're going to apply standard deviation and expected ranges to the stock market. And so what you're seeing here is a one-year price action chart of SPY, right? This is just an ETF that tracks the S and P 500. So this could be a good example of an asset that you might want to scalp or day trade, either actually on a day to day basis or you might want to go a little bit more long-term, maybe on a week to week basis. But bottom line is a lot of people do trade SPY on a very short-term basis. And so the way we're going to apply a one standard deviation range to SPY, or a two standard deviation range, et cetera, et cetera, is we can simply go to the trade tab here. And this is the option chain for SPY. And the really cool thing about options, specifically the way they're priced, is that they factor in this thing called implied volatility. And implied volatility is simply the market's expectation of where a certain stock or where a certain asset like SPY will be at a particular point in the future. And specifically when you do look up the apply volatility in your trading platform. And you can see on the right-hand side, for each of these option expiration cycles, these are the one standard deviation expected ranges. And so you can see here on the right-hand side, we have a percentage and in parentheses here we have an actual number. So what does this mean? Well, these percentages here are the implied volatilities for the options in their corresponding exploration cycles. And implied volatility, when you see as a percentage, is typically going to be coated on a one-year basis. So for example, if we were to look at the March 19th exploration cycle, these options expire in 32 days. So going over to the right, this percentage is calculated from those options in that expiration cycle, right? The thinkorswim platform here, we'll actually do some math behind the scenes to back out this number from the actual prices of those options. Now the thing here though, is that this number is quoted on a one-year basis. So based on the prices of these options, the market is expecting SPY to be either up or down a year from now by around 21.64%. Now, obviously, if you are trying to day trade or scalp SPY, you're not gonna care where the market is expecting SPY to be one year from today. That's much more long-term than what you actually want. However, in parentheses here, you can see this plus or minus 20.381. This is the actual expected move based on the implied volatility, but instead, this number being quoted on a one-year basis, could it based on the expiration date of these options? So the way you read this is by March 19th, in 32 days, the market is expecting SPY to be either up or down by around $20.38. And again, this number comes from the one-year implied volatility, which comes from the prices of these options. So now if you wanted to day trade SPY, you can look at the exploration cycles of options that expire in just a few days. So for example, this expiration cycle, February 16th, these options expire in one day. So again, coming over to the right here, the implied volatility based on the prices of those options is 13.44% And then based on this number, the expected range of SPY one day from now is up or down by $3 and rounding up $3.07 basically. So this is the one-day expected range of SPY. And specifically it is the one standard deviation expected range meeting tomorrow when the market opens, there was about a 68% chance that SPY is going to stay within this range. Tomorrow could be an update. It could be a down day, but there's a 68% chance that either way, it's going to move either up or down by less than $3.07. And moreover, So if this is the one standard deviation expected range for tomorrow's trading day, then the two standard deviation range, we'd just be two times this. So that'll be $6.14. And that means there's a 95% chance that during tomorrow's trading day, SPY is going to move either up or down by $6.14. And so what does this all ultimately mean then? Well, for example, you could wait to see if SPY actually moves beyond this one standard deviation expected range. Maybe tomorrow during the trading day, SPY rallies over $4. So that'll be well beyond the one-day expected range for SPY. And if that happens, that could be your signal to then enter the market. And short SPY, because the likelihood that SPY moves beyond the one standard deviation range is only 32%. So if you see that happens, that is going to be a rare occurrence. And what does the market typically do when it has a significant move? So looking at this one-year daily price action chart, for example, you will be able to notice many places where the market got extended, either to the upside or the downside, and then at some point shortly thereafter it reversed. So for example, we can see right here, the market definitely got extended to the upside. This might be a one or two standard deviation move. So this is a very rare event. And then what happened afterwards? You had a very significant drop. Notice how quickly this happened compared to how quickly this happened, right? Typically when the market gets very extended like this, either to the upside or the downside, you oftentimes do see a reversal. That happens a lot more quickly than it took for the actual extension here to take place. You can also see it back here and March when the market was crashing, very massive down move very overextended to the downside. And then you had a huge and quick reversal back to the upside. And then you had a small pullback here, and then another very big push higher and then appraise Swift pullback. Same thing over here, that Marta got very extended, as you can see. And then soon thereafter they'd pull back very quick and pretty violent. Another example right here, pretty big down move, got a bit overextended to the downside, and then Bush very significant pull back to the upside. And then one more example right here, pretty big down move and then a very swift up moved thereafter. So this is what the market generally likes to do. You can see this blue line right here. This is the 20 period moving average. And the market generally does not like to get that far away from this 20 period moving average. And so of course, just by looking at this, if you are trying to judge whether the market is over extended, either to the upside or the downside. It's going to be a very subjective thing if you're just looking at this picture. Yes, you can also use some indicators like these purple lines. These are what's called Bollinger Bands. Certainly help. But fact of the matter is when you are looking at something visual like this, there is going to be room for a lot more subjectivity, and therefore you might be more prone to making mistakes. That's why dealing with concrete numbers here. So you know exactly what the one standard deviation or the two standard deviation expected ranges for certain period of time. This is how you will know exactly when the market may be actually getting overextended, right? For example, if in your trading strategy you wait for a two standard deviation move, okay, so that means tomorrow, for example, if SPY moves by over $6.14 or so, then you know, with absolute objectivity, that is a very rare, insignificant move and could be a great opportunity to make a trade. And going back to the charts here one more time. So obviously this is a daily chart over one year. But even if you go down to a much more granular timeframe, let's look at the five-day, five-minute chart here, right? So this is five days of SPY price action, and each bar represents a five-minutes. And so even on very granular timeframes like this, you will still see very similar patterns. The market gets away over extended and you have a pretty significant pullback. Another overextension, and another huge pullback. And at this point the market was definitely overextended to the downside. So what do you get? A significant pull back to the upside and so on and so forth. And the same kind of behavior or the same kind of pattern can also be seen on a very long-term timescale is, well, let's look at the maximum weekly chart here. So this is going all the way back to 1997, and this is a weekly chart. And I'll zoom in here a little bit. So now this is going back to 2009. And so like I said, you can still see kinda the same behavior here. When the market gets too far away from moving averages, you often see a pullback back down to the moving averages. You obviously see it here. You see it here, you see it here. And of course, I would imagine that at some point this huge up move is going to end. And it's going to end with a pretty significant pullback back down to the moving averages. And so that's why you can use standard deviation ranges on really any timeframe that you want. If you actually want to day trade SPY, for example, and be in and out of trades in the same day. Well then you can use the one day expiration cycles of options to tell you what the expected ranges are for that one day. And then conversely, if you want your trades to last a little bit longer, maybe a few days a week are more. Well then just look at all these different expiration cycle as you have. And based on all of their different expiration dates, you have all the one standard deviation expected ranges. And so because when the market does get overextended, when it goes beyond a one or two standard deviation range, because you typically see a very quick, insignificant retraction thereafter. This is how you will gain a slight edge in your trading in that your profits on average should be a bit bigger than your losses. Because, and coming back to the charts when we're time again, let's go back to the one year, one day chart right here. Because obviously every time you make a trade when the market moves beyond a certain range, it's not always going to immediately come back around in your favor and make you money. For example, looking at this move right here, and I'll zoom in a little bit. So this move right here, maybe at this point right here, maybe this was the one standard deviation move. And so if you enter the market at this point and you shorted SPY, hoping thereafter it will go down so you can make a profit. Well, obviously that did not happen. The markets still continue to be higher. And so this is where mechanics are absolutely paramount. Because when you are wrong, you're going to have to know when to get out and cut your losses. So if you've shorted SPY right here, and then obviously it went a bit higher. So maybe at this point you cut your losses. You took a small loss and then continue to wait. And then maybe here, maybe at this point this was a two standard deviation move. And so once again, you enter the market and you shorted SPY. And this time you happen to be right. And this time the market did reverse and it went down hard, right in just one day here, the market undid 1-2-3, 4-5-6, call it seven days of previous price action. Basically seven days of continuous up move with the exception of this day right here, was all undone by one day. So even though you took losses right here, right, because your first try didn't work out. Because the market reverse so swiftly and so significantly, those losses here would have been totally recuperated and you would've made much more on top of that. And so that's generally how this kind of strategy works. You're obviously not going to be right every single time. Especially because as I've said and suddenly other skill share courses and in some of my YouTube videos, whether stocks go up or down in the immediate short term is pretty much the flip of a coin. And so that's why when you made the trade right here, you basically have a 50-50 shot of The next day being either higher or lower. Like I said, there is really no edge and trying to predict whether stocks are going to go up or down in the short term. Rather, in this kind of trading approach, you are trying to make trades as close as possible to when the market is going to make a big move, right? Maybe instead of getting lucky and shorting the market at pretty much the very top, maybe you shorted right here the day previous and the next day you took on losses, right? Because again, it's a toss of a coin where the stocks go up or down in the short-term. But as long as this point had not reached our stop loss, then you would continue to hang on to the trade. And then the very next day, that's when you got the really big down move. And this would have totally restored the losses you took right here. And then also would have made you a lot of profit on top of that. So really when you get down to it, using standard deviation and he's expected ranges is allowing you to mechanically and objectively pick your spots, pick your trade entries. Because like I said, just looking at a chart, there's a lot more room for subjectivity and deciding if the market is over extended or not, right? Perhaps at this point the market starts to look a bit overextended, but based on the implied volatility for SPY this time, this move here may still had been well within the one standard deviation expected range. This may have been totally normal. And so unless you actually check those numbers and you know, with absolute objectivity, whether or not the market is getting a bit overextended or not. Moving beyond a 12 or three standard deviation range, then there's gonna be a lot more room for mistakes and errors. And in my experience so far with trading in the market, the more mechanical and objective you can be with your trading and more successful you should be. And so there you go. I hope that all made sense. And in the final video coming up next, I'll be showing you that day trading simulator that I programmed. That's going to give you a pretty clear demonstration of how this is all going to work. So I'll see you the next one.
5. Scalping Simulator: All right, welcome back to the final video in this course. And in this video here, I'm gonna be showing you this little scalping simulator that I programmed. And it's going to demonstrate how this statistical approach to day trading is actually going to work. And so just to give you a high level understanding of what this program is going to do. That's going to take in two sets of data. If I go to this next tab here, this is 15 years worth of daily price action for SPY. I got this data as usual from Yahoo Finance. And so each row in this file here represents a specific date, which you can see right here. And then you get some important metrics for SPY on that day. For example, you get the opening price for each of those days, you'd get the daily high, low, the closing price, the adjusted closing price, and the volume for each of these days. So like I said, 15 years worth of data for SPY. And then in the next tab over here, I also have 15 years of weekly v6 data. And the VIX is just an index that tracks the implied volatility for the S and P 500. Now the v6 is not exactly track implied volatility for SPY specifically, I believe it actually tracks the implied volatility for the S and P 500 Index, which would be SPX. But SPY is a very close proxy for that. And so like I said, this is 15 years worth of weekly v6 data. So for each row here, each of these dates represents the Monday, or I should say, the first trading day of every particular week since 2006. And so basically what this scalping simulator is going to do is it's going to walk itself through this weekly v6 data. And for each week, it's going to calculate what the expected move is for SPY for that particular week. Like I said earlier in this course, when you do look at the implied volatility, the VIX included, it's going to be quoted on a one year basis. So the program here is going to have to take the closing price of VIX for each one of these weeks. And it's going to have to convert it into only a one week expected move. So it's going to use the same kind of mathematical procedure that you saw in the thinkorswim platform. Where when I pulled up the option chain on the right-hand side, you saw the implied volatilities in percentages. And then next to that you saw in parentheses the actual expected moves based on the expiration dates of those options. So like I said, that's the same kind of thing that this program is going to do here for each one of these dates or for each one of these weeks. And so once it knows for every given week what the expected movies for SPY, for that week. It's also going to keep track of the SPY data, the SPY price action during that week to see if SPY actually moves beyond that expected range, either to the upside or the downside. And so then of course, if and when SPY does move beyond the weekly expected move, the program here is going to simulate a trade, right? Specifically, if SPY has a huge rally and increases and goes beyond the expected range to the upside. Once that happens, this simulator here is going to short SPY. And in case you aren't familiar, shorting stock as how you make money on stock prices actually go down. It's just the opposite of bind stock and hoping the price goes up. And then conversely, if SPY moves beyond the expected range to the downside, then this program here is going to simulate buying SPY and hoping the price goes back up, right? Like I mentioned in the last video, this style of trading here is basically waiting for the market to make a very overextended move in the hopes that soon afterwards it will retract in the opposite direction very quickly and significantly. And that's what this program here is going to do. And so now if I come over to my terminal here, this is where I can actually run the program. So this is the command right here that I'm going to use to actually run this thing. And you can definitely ignore some of this stuff here. But I do want to direct your attention to these guys right here. These are some of the arguments that I'm passing into the program. Basically what they mean here, looking at this num shares 1 first, when the program does actually make a trade, either buying shares of SPY or shorting shares of SPY. It's going to do so with 100 shares. So if SPY drops well below the expected range, then it's going to buy a 100 shares of SPY. And then conversely, if SPY has a huge rally and moves above the expected range, then it's going to short 100 shares of SPY. And I do want to say this is just a number that I have selected for this demonstration. Obviously 100 shares of SPY. Whereas if right now that ETF is trading for almost 400 bucks a share, 100 shares of that is going to cost around $40 thousand, right? So of course two things here. If you do want to day trade SPY, you certainly don't have to trade a 100 shares for each trade. You can definitely go much less. On top of that. You can also use margin to reduce the amount of capital that you need to put up to actually trade this thing, right? Most margin trading accounts will allow you to only put up 50% of the total capital you need to actually be in the trade. So even if you were to trade a 100 shares of SPY, and the total value of that would be $40 thousand. If you are using a margin account to do this, then you as the trader, would only have to put up maybe 50% of that capital, $20 thousand, and the other 20 grand would be borrowed from your broker. Now of course, there are other risks that come with margin, and I will not go into that in this course here. But just wanted to note that you definitely don't have to trade a 100 shares of SPY or any other stock that you want to trade. And you also do have the option to use margin to help reduce capital costs even further. And then lastly here with this profit target and stop-loss point, these two arguments here are telling the program went into actually exit the trade either for a profit or a loss. And the actual values here, 11 represent percentages. So basically I want this program to take profits at 1% and cut losses at 1%. And specifically this is 1% of the total notional value of the position. So 100 shares of SPY at around 400 bucks a share right now, that would be $40 thousand, right? 1% of that is 400 bucks. So for example, if this program here what to find a trade. Buy 100 shares of SPY. It's going to hold onto that trade until there's either a profit of 400 bucks, 1% of the total notional value of that position. Or it's going to cut losses and get out if it hits a loss of 400 bucks. And so these are going to mimic the very important mechanics that you're gonna need to have in your trading strategy. You need to know upfront when you're going to take profits and when you're going to cut losses, I've kept it simple here in that both the profit target and the stop-loss point are the same, just 1%. They don't have to be the same, but you must be consistent in your trading. And lastly, before running this program here, I do want to mention that this is simply for demonstration purposes only. There are some actually pretty significant handicaps to this simulation. One of which has to do with the actual data here. Specifically that this is only opening and closing prices for each one of these dates here, both for SPY and the VIX. And obviously it's very possible and much more likely that at some point in between the opening and closing prices that these profit or loss points would get hit. But of course, I'm only able to use either opening or closing prices for these trade exit points. And specifically this program here is only going to be using the adjusted closing prices. And also on top of that. At the end of each week, if the program is still in a trade, it's simply going to get out of that trait, either for profit or loss wherever that trade may be at that time. So if the market opens on Monday and SPY goes outside the expected range by Wednesday, it'll make a trade and then come the following Monday if the program is still in that trade and it has not hit one of these profit or stop-loss points, it's just going to exit the trade. And of course, in reality with this kind of trading approach, you could definitely continue to hold onto that trade. But for the sake of making this simulation as mechanical as possible, which is basically a requirement when you're trying to get a computer to do this. Like I said, this is mostly just for demonstration purposes only. So now I'm going to hit enter and this program will run. And so there you go. And so as it scans through all of that data, all 15 years plus, you're going to see some metrics for each one of the trades that it made. So for example here, let's look at trade 14. You can see the expected range for this particular week, which was somewhere around August 21st, 2015. The expected range was anywhere in-between $200.47 to the upside for SPY and $177.71 to the downside. And specifically, each one of these ranges here, this is a 1.5 standard deviation range to standard deviation moves do not occur that frequently. And a one standard deviation move occurs a little bit too frequently. And I've found that waiting for maybe a 1.5 standard deviation move somewhere in-between 12 gives you overall better performance. So like I was saying, this was the 1.5 standard deviation expected move for this week. And at some point during this week, SPY fell down to $177.63. So a little bit below the expected range to the downside. And so it was at this price where this program simulated making a trait. It went long. It bought 100 shares of SPY at this entry price on this date right here. And then you can see three days later on August 24th, the exit date. You can see obviously in this particular case right here, this was a losing trade because SPY continue to fall even lower. It went from 177 down to 170. And so ultimately this trade lost about $750. Now if you recall, the stop-loss point was 1%. And if SPY was trading for, let's call it around to a 100 bucks, 100 shares is $20,000.1 percent of that is $200. So obviously the loss here was well beyond that 1%. And again, this is just because of that handicap, like I mentioned, where I'm only able to use the closing prices of this data here. So definitely intraday, actually during one of these days, during this week, you should have cut your losses well before you ever got to a loss of 750 bucks, once you hit that minus 200, you're gone. So again, it's going to be cases like this that's going to actually dramatically impact the overall performance of this program. But you're still going to see at the end, it's going to come out on top, even with these significant drawbacks that you actually wouldn't be dealing with in a real life scenario. So let's scroll down a bit here and let's take a look at trade 17. Here. Again, the 1.5 standard deviation expected range for this particular week was anywhere in between 288.292163.7. And so we can see on October 11th, 2018, as PY fell down to 26069, so well below the lower end of this range. And so as a result, this program bought 100 shares of SPY AND went long. And then one day later, on October 12th, the market had a pretty big reversal in the other direction. And spy rallied from 260 to 264. Which means this time there was actually a profit of $362.06. And let's look at one more trade here. Let's take a look at trade 20. The expected range was between 251189. And so we can see back in March, on March 26th, 2020, this is one that market was crashing because of the coronavirus pandemic. We can see during this week, spy had a pretty big bounce all the way to two hundred fifty seven and ninety two, so well above the expected range to the upside. And so in this case, the program entered the market, made a trade and shorted SPY, right? Because in this case the market has gone well above the expected range. And so like I said, when you short stock or when you shorten ETF, you're hoping the price goes down, it reverses. And that's how you make money in that situation. So if we shorted SPY at two hundred fifty seven and ninety two, and then SPI did fall back down to 25024. This trade made $768 and profit. And so now if you scroll to the very bottom, we can see some statistics for the overall performance amongst all these traits. So adding up all the profits and losses for each of these trades, the total P and L at the end of it all is positive $687 and for only making 21 trades. And given also the significant handicaps that this program had to deal with, which you would not have to deal with if you are doing this live. I think the fact that this program still came out on top with a nice profit. With any profit periods speaks volumes to this kind of strategy. And you'll notice the win rate for all these trades was only 52%, right? So of these 21 trades, only about half of them were actually winners, the other half were losers. And once again, this proves my point that trying to guess where stocks are gonna go in the short-term, either up or down, really is the matter of a flip of a coin. It's 50-50. But because you're using standard deviation to pick your spots carefully and mechanically, at a point where the market is getting overextended. If the market does reverse from that point, it is more likely that if it does reverse is going to do so very significantly. It's that significant big move in the opposite direction that is going to allow your average profit to be larger than your average loss, right? In this case, our average profit amongst all these trades was $136.39. The average loss was a $103.66. So looking at these two numbers in absolute terms, 1.3.6 versus 103, obviously 136 is greater than 103, which is why even with a win rate, basically at 50%, you still get to come out on top in the end. But in order to actually have a chance of achieving something like this, you must have a clear set of mechanics that you stick to. No matter what. How long are you going to wait before entering the market and making a trade is a one standard deviation. Move a 1.5 to whatever you decide, stick to it, be consistent. When are you going to take profits at 1.5%, 2% percent, whatever it is, stick to it, be consistent. What about losses? Are you going to take losses at the same percentage as your profits or something different? Are you going to cut losses a bit sooner or are you going to hold onto the trade a bit longer even if it moves against you. Once again, whatever you decide to stick to it, be consistent. Now this is not to say though, that you should never make changes to your trading strategy as you continue making trades in a very consistent manner. And if you then look back on your trays and you see something that could be improved, then of course make that improvement. But you're never going to know with a high degree of certainty if there is actually something in your trading that could be improved if you are not consistent while doing so. If your trades are just all over the board, then there's going to be very little you can actually learn from them. And so this is where trading really becomes like a science. You figure out a trading strategy that makes sense to you. You apply it consistently. You keep all your controls constant. And then based on the data, based on your past trades, if you see something that could be improved, okay, make a small tweak, tweak one variable in your trading strategy, and then keep trading with that one small adjustment and see how that adjustment actually affects your performance. If it degrade your performance, OK, at least you know exactly what's causing that. If it improves your performance again, you know what's causing that. And then you can repeat the process, tweak something else, only that one thing and see how that works and so on and so forth. But if you change everything at once and you're inconsistent and doing a bunch of things at the same time, you are not going to know which of those things as actually helping you and which of those things are actually not helping you. So I hope this video here and the simulation was very helpful, at least in giving you some insight into how this kind of trading strategy actually works. And also the kinds of things you should be shooting for. Generally speaking, in your own trading endeavors. Whether or not you actually choose to pursue this kind of statistical approach today, trading or scalping or not. Either way, if you are trying to be successful at day trading or scalping, given that your win rate is going to be almost always pegged right around 50%. You have to find a way to get your average profits larger than your average losses. There's no one way to do that, but this statistical opposed to day trading is definitely one such way. So with that being said, I'll see you in the next video just to wrap up some things up and send you on your way. Thanks.
6. Wrapping Up: All right, so at this point you've finished the course. I hope you enjoyed it. And to help get you started trading in the market using statistics and probability, you can take a look at the course project down below. And so with that being said, thank you so much for watching this course. I am Scott raised again, and I do appreciate any and all feedback that you may have. Moreover, if you've got questions or unique clarification on something, please do post a comment in the discussion section of this course and I'll get back to you as soon as I can. And I also encourage you to check out the other courses I have on skill share, a Galata content published on other stock market investing concepts, options, options trading, and if you computer science topics as well. And lastly, don't forget to check out and subscribe to my YouTube channel. And please do also follow me on the skill shared platform so that you'll get notified every time I come out with the new course. So thanks again for watching and happy trading.