 Hello, and welcome to this session. This is Professor Farhad in which we would look at new trading strategies that involve algorithmic trading, high frequency trading and dark pools. These topics could be covered in an essentials or principle of investment course, graduate or undergraduate level, as always, I would like to remind you to connect with me on LinkedIn if you haven't done so. YouTube is where you would need to subscribe. I have 1700 plus accounting, auditing, tax, finance, as well as Excel tutorial. If you like my lectures, please like them, share them, put them in playlists. If they benefit you, it means they might benefit other people. Connect with me on Instagram. On my website, farhadlectures.com, you will find additional resources to complement your finance, as well as your accounting CPA exam, CFA exam. The topics I'm going to be covering today are covered way in depth and in more explanation in a book for my favorite author, Michael Lewis, called The Flash Boys. So if you find you like this topic, this is the textbook I suggest you read. And this is the same person that wrote the big short. So let's start by looking at algorithmic trading. And what is algorithmic trading? It's the marriage of electronic trading, which is trading stocks with computer technology. Simply put, it's what you know about finance and trade, combine that with programming and data science. And this is what it looks like. You have trading and finance, buying on margin, selling, selling short, putting stop orders, stop limit, so on and so forth, knowing some programming and data science. When those two married, they'll give you algorithmic trading. And basically what you do is you delegate the trading decision to a computer, not to a person. So the person is not making the decision. The computer is making the decision. And as of today, around 2020, more than half of all US equity is initiated by a program rather than by a person. So how does it work? How does it work? Simply put, a program, a program, what it does, it tells the computer to sell or buy based on certain proprietary algorithmic instruction. And when you, how do you write those programs, either using coding like Python, C++, Java, or some other language? And simply put, I'm just going to give you some very simple example, just keeping it as simple as it's going to get. For example, you tell the computer once a certain stock crosses the 50 day moving average, you buy it. That's it. And you just tell the program. For today, I will choose 30 stocks. If any of them passes the 50 day moving average you buy. Also, I'll tell them if any of those 50 stocks falls below the 50 day moving average you sell. So that's it. And you don't have to do anything. You go have your coffee, sit around, talk to your friends, and the computer will monitor this process and execute the trades for you. Okay. Now, also algorithmic, algorithmic trading, it's a little bit more than that. It could also, there's a lot of thing about it, that could also scan good or bad news, looking for words like fraud, growth, losses. And what they do is once they look at that news, they analyze it and they trade accordingly. So if it's good news, they will buy the stock. If they think it's bad news, they will sell the stock. So the best way to illustrate this, I'm going to give you an example, just kind of, again, this don't don't read too much into my example, just to get the gist of it, because this is for one thing, it's, it's proprietary things. So we really don't know how things are conducted, but just gives you an idea how algorithmic, algorithmic trading works. Let's assume Reuters released this report about Johnson & Johnson. Johnson & Johnson knew for a decade that asbestos lurked in its baby powder, Reuters investigation. Now, once this, once this report is released, it may take a person, maybe, I don't know, five minutes, 10 minutes to read, to absorb, understand the concept and react accordingly. Now, a program might look forward, for example, for example, you, you will, you will program your system to look for investigative Reuters report. And basically you would say, okay, the word cancer in there, the program look for the word J and J, the program look for the word lawsuit, and they will do this in, in fraction of a second, or maybe in five seconds, and they would look there, maybe there was a cover up. And accordingly, the program will start to sell Johnson & Johnson because that's bad news. So the, the program already started to know about the news before the trader was able to read the report and react. So this is how it works. So this is basically not an extreme example, maybe a real example, but just to give you an idea how those computers work in executing trades. And let's take a look at the comparison between algorithmic and traditional trading. They're kind of a little bit extreme, but to kind of make the point, algorithmic trading is one hundred percent computerized, which is it doesn't involve any emotion, which is that's important because a human, they involve emotion, a human, you have fear sometime you get scared, sometime you get greedy, you make the wrong decision. Computers don't do that. You tell them what to do and they will follow it one hundred percent of the time. Algorithmic trading constantly markets surveillance. So there's two o'clock in the morning you report in Europe about some product and you are sleeping, you don't have to, you don't have to worry about this. The, the program will take care of it. Now traditional for traditional individual, you have limited time capacity for, for an attention during a particular day. You can back test your strategy. You're using old data on large scale. So algorithmic trading, once you write the program, you can test it based on old data. You can do this with traditional, but not at the same extent. Execution is the same every time because it's 100, 100 percent computerized. It's consistency. Human nature. We are not consistent. Why? Because we have biases. We involve emotion. We are tired. We are not working that day, so on and so forth. Trades are as good as your code when it comes to computer trading. Trades are as good as your judgment. So here you are comparing codes to judgment. And if the codes are properly, are properly executed, then they are better than the judgment because sometime judgment again, you could be biased. You could be biased. Let's talk about high frequency trading or HFT. This is a subset of algorithmic trading. But here the computer is relying on extremely rapid decision. So rather than using a program that's going to buy and sell at a certain point based on your instruction in the code, this is going to buy and sell as quickly as possible. Here you are dealing with speed. So high frequency traders compete for trades that offer very small profit. Here you are buying and selling, but you're making very, very small profit. Here what you need to have to be successful in this. You have to have access to new information. I'm sorry, access to information about the trade first. In other words, trade in front of others. How does that work? Let's assume you someone wants to buy 1000 shares of Apple. OK, they're willing to buy them at 351. They'll place a limit order to buy 351. Here's what's going to happen. You will send your order to the exchange. Here's what happened. The exchange is basically servers. Those servers that are run by companies, what they would do is they would know someone wants to buy 1000 shares at 351. And this is happening in milliseconds. So it's like this. As I'm talking right now, there's millions of transaction that's taken place, but I'm just going to give you an idea. Once they know someone is trying to buy someone committed to 1000 shares at 351. Automatically, they will send a signal. They will search the market for at another exchange where they can buy it for three hundred fifty dollar fifty dollars and ninety ninety nine point nine nine cent. So immediately, they will buy those shares like in that millisecond and they would sell it to this individual at 351. So what happened is they trade in front of others. So simply put, if this if this order went to the market, maybe and it took like maybe a second or two, maybe this exchange would have found about it and execute it at three fifty one or three three fifty point nine nine nine because you want it to be at 351. Anything below is acceptable. So what they did, they bought at three fifty point nine nine nine and they sell it to you at three fifty one and they made that small very fractional profit. But again, you are dealing with high frequency traders. Millions, if not billions of shares are traded. So this is where you could make your profit. Simply put, it's like you are trading on inside information. That's basically what you're doing. High frequency trading because you are trading in front of others. But here you are talking about like seconds, not seconds, like one tenth of a seconds. If you're interested in this, how this happens, read that book that I showed you at the beginning, The Flash Boys by Michael Lewis. It will tell you all about it. But if these opportunities are numerous enough, they could accumulate to big money. That's the whole point of high frequency traders. They rely on cross market arbitrage in which even tiny price discrepancies. We're not talking about pennies. We're talking about zero zero zero one of a penny and they would still make a profit, would allow the firm to buy a security at one price and simultaneously sell it at a slightly higher price. And you're talking very fraction of a penny. OK, there's a tremendous premium on being first to hit the bid or ask price. So buying and selling quickly will make a difference, will make a difference here. Are you saying is this legal? In a sense, yes, it is legal because these these are making market in the stock. So they are trading stocks. So that's why it's legal. OK, high frequency trading. We have something called co-locate and this is very important because straight execution are extremely fast, measured in milliseconds or microseconds. What happened is HF high frequency trades tried to locate their trading their servers next to the trading centers. So for example, if there's a New Jersey, a place where there is an exchange, what they'll try to do if the exchange is here, they will try to buy a building here and have their servers here so they could communicate with this exchange very quickly rather than a server that's located here because they want to get to this information again. Millie or even microseconds before this exchange. So that's so what happened is where were these centers or these exchanges are located, the real estate is very expensive because all these companies want to locate there. So the extra time it takes for a trade order to travel from a remote location to a New York exchange would be enough to make it really impossible to win a trade. If someone is in New York, if someone next to the exchange in New York, they're going to get to the they're going to get to the trade faster. OK, so just to kind of give you an idea, light can travel only at 186 miles and in one millisecond. So let's assume an order originated in Chicago transmitted at a speed of light, which is 186 miles and one millisecond. It will take almost five milliseconds to reach New York. Now that order could not possibly compete with one launched from a co-located facility in New York. So if somebody next to the server in New York, you send it in Chicago, it's going to take five milliseconds. They're going to beat you to it. They're going to beat you to it. OK, in some ways, co-location is a new version of an old phenomenon. What does that mean? Many broker firms originally located their headquarters in New York. And the reason is before the phone and before the technology, they were co-locating with the NYSE, the New York Stock Exchange, so their brokers could bring trades on foot once they have a buy or a sell to the exchange quickly and efficiently so they can get there. Now what you do is you locate next to the servers. And this is a picture what we're talking about. Let's assume this is in South Africa and this is Johannesburg Stock Exchange. If you are located outside South Africa, it will take 167 milliseconds to send an order to that exchange. If you are located in Cape Town, South Africa, it will take 20 milliseconds. That's a huge difference. If you are located in Senton, it will take 2.7 milliseconds. So notice where you are located physically makes a difference in high frequency trading because you want to get to the information as early as possible and click that buy and sell and buy and sell constantly based on the prices. Now also what make high frequency trading more common is because of the decimal because you're dealing with small fraction less than a penny or less than one tenth or one hundredth of a penny and you make a profit for large trades. And talking about high frequency trading and algorithmic trading, we cannot not talk about the flash crash that happened May 2010. Approximately at 8 to 42 New York time, May 6, I still remember that day the Dow industrial average was down about 300 points for the day. And I still remember I was watching Bloomberg News because there was demonstration going on in Greece. The market was demonstrating concern about the European death crisis specifically in Greece and nerves were on edge. In the next five minutes, I still remember those five minutes. The Dow dropped additional 600 points and that was a huge because the Dow was not 25,000 was around like I don't know the 10,000 maybe range. So that was a huge drop and only 20 minutes later it recovered most of those 600 point. And what was disturbing the I shares Russell 1000 value fund they fell from $59 to 8 cent. So you could buy them at at some point during the day at $459 those fund they went down to eight pennies shares and large consulting company Accenture also were trading they went from $38 to a penny. So if you were there and you bought them, you would have like that. Great. Another extreme example price quotes for Apple and Hewlett Packard increased to over 100,000. Okay. The market was clearly broken. So what causes this flash crush? This is what we need to talk about. It's still debated but obviously the SEC did their own investigation. The SEC report issued after the trade pointed to a four billion sale of market index future by a mutual fund believed to be Waddle and Reed because we really don't know we believe to be this company. So what happened? Let's assume that's the case. Waddle and Reed tried to sell for four billion worth of future market contracts. What happened when you tried to sell the prices go down because you're trying to sell? As market prices began to tumble because it was a large order, many algorithmic trading program withdrew from the market because they see the prices are going down and most of them they were they were programmed the prices are going down. Don't buy just let it go. So if there's no buyer and those who remain became net sellers. So there's no buyers that only seller and there's an order to sell and no one to buy the price will drop substantially. So further pushing down equity prices as more and more and as more and more as as more and more of these algorithmic trades shut down liquidity in these markets evaporated buyers for many stocks simply disappear. So this is what happened. So this is why the are dangerous sometime is is they interpret the information differently and if they all go in one direction they could influence the market substantially. So finally trading was halted for a short period when it resumed buyers decided to take advantage of the severely depressed stock prices. And guess what the market the market rebalanced again. But again as I said some of them went down to them pennies some of them went down five ten dollars and a lot of people took advantage of that short that short change in the and the stock price. So and the market rebounded almost as quickly as it had crashed given the interday turbulence and the clearly distorted price at which some trade has been executed. The NYSE and NASDAQ decided to cancel all trade they were executed more than 60% away from the reference price close to the opening price of the day. With basically if you drop too much they will not execute it. Okay. And almost 70% canceled trades involved ETFs. The last thing we're going to talk about today is dark pools. Dark pools are just exchanges but they're not public exchanges. Again dark pools are basically servers they are trading amongst each other but you don't know who are the people. So electronic trading network where participant can anonymously buy or sell large block of securities. Now why that's the case because a lot of large traders sometimes they don't want people to know they are buying or they are selling. Why? Think about it. If somebody knew that somebody is going to sell 100,000 shares of Apple stock they will front run you and they will sell before you. Why? Because they know once you sell the price goes down. So they will sell then they will buy once the price goes down. Same thing if you want to buy they will buy in front of you. Then once you once you start to buy they will sell it back to you. So these large these large trades they would like to be anonymous. So what they do is they use those dark dark pools. The fear that if others see them executing a buy or sell program their intention will become public and prices will move against them. That's that's why. Now back in the old days not back in the old days we have something called blocks and what is a block? It's a large transaction at least 10,000 shares of stock are bought or sold. So when you say there's a large block it means 10,000 shares or more are bought or sold. And when this happens means it's there's a large move in the market. It could be hundreds of million but they're in $10,000 blocks. So they used to have what's called block brokers. Part of the expertise of the block brokers was in identifying traders who might be interested in large purchase or sale of giving an offer. So this is they would they would help arrange buyers and sellers used to be called block brokers. Now block brokers the secretly arranged large trades out of the public eye so avoided moving prices against their client. And the reason is you don't want your client to be hammered whether they're buying they don't want them to buy more because they're desperate seen as desperate or they're selling the prices will go down. So they will try to kind of get you to buy and sell without everybody know. Here here comes the block trading and you don't need those block brokers. Why? Because you can go to a dark pool and you can buy and sell without anyone knowing. So they don't know who you are and you will try to find someone who also wants to buy and they don't want anybody to know that they're buying. So this is what the trade happened in that dark pool. So it's a trading system in which participant can buy or sell large blocks of securities without showing their hands. Showing their hand means you don't know before they you don't know until after the trade is done. So limit orders are not visible to the general public as they would be on the conventional exchange who nobody knows. So the trades identities also kept private so no one knows who bought and who and who sold. Traders are not reported until after they are crossed. It means they are executed which limits the vulnerability to other traders anticipating one trading program. So you will know after the fact that that occur but that's too late. You can no longer front front run them whether buying or selling. So who uses the dark pools? Usually it's large traders large investors. The regular investor you and I will not have access to the large pools because it makes them less vulnerable to high-frequency trader. You don't want to be front run. You don't want to someone in front of you. Go ahead know about what you're doing. Know about your intention and trade in front of you. And if they trade in front of you they would either make the price higher to buy or lower when you sell. That's the purpose of it. But large pools sometime they're not really as perfect in 2011 pipeline LLC which is operated a dark pool was accused of enabling high-frequency traders to peak in the dark pool to know what's going on. So again once you let somebody look and what we're talking about here is milliseconds just to know what's going on. So they can trade in front of you. Also in 2014 Barclay was accused of misrepresenting the level of high-frequency trading in the dark pool that they operated. They were giving misleading information about the how many trades was going on inside the pool. So dark pool are somewhat controversial because they contribute to the fragmentation of the market. What does that mean? It means now you have trades that's going on not in the public eye not in front of everyone because that's the purpose of it of the stock exchanges to have a transparency. Everyone knows what's going on. So the price is fair. The price is fair. When many orders are removed from the consolidated limit order like in the dark go to the dark pool there are fewer orders left to absorb the fluctuation and demand for the security. Now you have less people buying and selling the stock and the public price may no longer be fair in the sense that it reflect all all the potential available information about the security. So if you want to buy Apple stocks and you don't know what's going on in that dark pool then you don't have all the information. Some information is missing from you. So the price is not fair because that information supposed to be available to you as well. So another approach to dealing with large trades so if dark pools is for large trade is to split them into many small trades each of which will be executed on an electronic market attempting to hide the fact that the total number of shares ultimately be bought or sold is large. So if you want to buy 10,000 shares rather than buying 10,000 shares break it down into 200 shares and send them to different markets then no one will know what's going on. In this trend what's going on here had led to rapid decline in the average trade size which they is less than 300 shares. So what's happening a lot of people since they may not be able to access the dark pool if they have a large order they will break it down into smaller pieces especially that the fees now to trade stocks is very small because the bid and offer is in decimals. If you like this recording please like it, share it as I told you if you like this topic read that book Flash Boys. In the next session we would look at trade and cost as always I'm going to remind you to visit my website farhatlectures.com for additional lectures and resources about your CMA, CP, I'm sorry CMA, CPA, CFA accounting courses finance courses, study hard and good luck.