Enhancing Hands-on Learning Using Mathematica: A Case of Investment Analysis

Ramesh Adhikari, an associate professor at Cal Poly Humboldt School of Business, shows how to use Mathematica for hands-on investment analysis. He walks through real investment strategies and lessons from his own experience, demonstrating how the software helps students learn by doing rather than just reading theory.
Chapters
All right, first of all, thank you all for joining. This is Ramesh Adhikari. I am associate professor at the Cal Poly Humboldt School of Business and currently I'm also the chair of the School of Business. And today we have this presentation called Enhancing Hands on Learning using Mathematica A Case of Investment Analysis. So what we would like to do today, I would like to make it less technical and more informational and I hope that everyone who is attending today gets something out of it. And if you have some questions for me, please wait until the end of this presentation, then we'll have some time for Q and A. So what I would like to talk is this like three important lessons to be aware of in investment. And this is very much personal to me and I think a lot of folks go through my, like my experience. When you are young teenager, early 20s, you think of making a lot of money and then you start trading and then things happen differently and so and so forth. So in my own personal life, what I have done is I started trading early on with the stocks and with the stock investment it's very difficult because you don't have as much capital. So you can buy like 100 or 200 stocks because that needs a lot of capital, right? So when I realized that I don't have a leverage on investment, I moved to options and I traded options for a few years. And options are very tricky, right? And I learned some lessons too. And later I realized maybe option is not the best thing to do. And then I move on to the futures market and I have learned some lessons during my journey and this is what I'm going to share with you all. So the three lessons that I want to share with you, some data and some information is about. It's hard to dismiss your grandma's investment wisdom, right? Don't put all your eggs in one basket. That's the first lesson. Now I'm going to make some cases here. And the second lesson I want to share with you is avoid diving into the options market unless you have a comprehensive understanding of options market. That may scare some of you, but options are easy to understand if you spend some time. But unless you understand it well, don't get into this options market. That's the second lesson that I want to share and I want to give you some insights. And then the third, and I think most importantly is the consider micro future in your long term portfolio, right? And I'm gonna make a very strong case. So at the end of today's presentation, if you walk with this idea Oh, I can use micro futures for long term investment. How do I do it? Maybe I should take some steps doing it. I think I would consider today's presentation is a successful presentation. So I have tried to minimize the technicalities of this presentation and those of you who wants to understand how it is done and how these different functions of Mathematica can be used. I have two articles on the topic. One was published in 2020 is foundation of Computational Finance and then the second one was published in 2021 selected financial applications. And both of these articles are available online. You can download, you can use them as you need it. And the reason I chose Mathematica is because it can incorporate the code text and we can change these different code as you learn and then you learn from the data. It's like more of experiential learning than reading a book somebody writes for you and you read it learn. That's not what we would like to encourage here using Mathematica is use technology such as like Mathematica just an example but you can equally use other like softwares and use data and get gain insight from the data. So that's the whole essence. What how can you learn from diving into the data from this real world instead of reading from the book. So that's why I chose this, this platform and as I said if you are all interested to know more about the functions and how I'm doing all of this, please refer to these two articles and you I mean in those articles I've explained and then and then we could put them all into a package but I chose not to put into package because we want to keep this open. People can look at modify however they want to do as they learn. So let's go to our first lesson. So the first lesson is I think we all know don't put all your egg in one basket. And I'm sorry that it I wish it was more like a live Q A where you know, I could ask questions and the participants could answer. So but some of some of you may be aware of that some stocks do very well and some don't do very well. And there are about how many stocks are in the US traded? 13,14,000 if you also consider over the counter and even the over the counter stocks can be traded if you have a broker's account. So out of that many stocks some do very well and some do very bad. And it is very difficult to know which one will do like good in the future and which will not do good. So I want to share, I Think one example that one of my friend did, he's a doctor and during the time of COVID and he was very confident on one of the companies and he put a lot of money, I mean lot of money. And what happened is the stock tanked and then he lost lot of money. So here are some examples that you know what can happen. And there I have four graphs and I think what is more important for here is just to look at. I want to look at these first two graphs that gives us the price data. And then the second graphs gives us the how the dollar invested would grow over time on the stocks. And currently we are looking at MRNA and as you can see, this is moderna, right? We all know and I think many of us have the vaccine from that company. And from 2021, January 2nd, the price like it was, it went all up to 2, 481. If you look at intraday price, you know, like almost 500. Then over time this is what like $74. But today if you look at the price, the price is even further down. So if you look at how much would that be if you had invested a dollar, then the dollar investment grew up to as you can see, $4.31 and. And then now it's down to what, less than A$66 cents, right? So here are some examples I want to share with you. And this is why, I mean you can definitely change the time frame. You can change. I'm going to change some like some stock that's a mRNA, right? Let's see WNW and I want to just regenerate that graph and I want to show you a chart of this company. So look at this guy here. WNW is a Chinese company. I think they sell groceries online in China and at some time. This is $15. I haven't looked at the price. Okay, let's change that to 2020, right? What happens. It is interesting, if you look at 2020, the price was lot higher. So. So this stock when IPO was there, it's I think 7$. And it went up until like $160 and now it is back to 9 cents or like 9 cents. I mean it's like 9 cents. So the stocks can go from $7 to 160 and can come back to 9 cents. Right. Likewise, you know these stocks you can look at, there's another stock you can look at. So I'm not gonna do one by one, but, but I can share this slide and you can play around it and see some stocks do very well. For example, this DXCM. If you look at DXCM, DXCM and then okay, I'm redrawing this graph here, DXCM that now we have the data since 2000. So there's a much fluctuations, right? And then dollar invested right here it like dollar invested at the beginning of 2020 went up until like how much? Like three dollars and back to what, 1.28 then again up here. And so, so the essence, what I'm trying to say here is some stocks do very well, but majority of stocks don't do well. And if you put all, all your stock, all your money in one stock, then there's a pro, I have a lot of friends and some of you may know your friend who put lot of money in one stock and they lost a lot of money. Like one of my friend, okay, so LC lcid, I think many of you know, he put a lot of money on that. That's electric car company. And you know, this is very volatile, you know, like from $10 to the $60 and back here $60 and then again now back to $5 or $4 now. So, so the whole idea, the essence I'm trying to say is that the stocks are very volatile. It can go 500, can easily come back to $25. And some stocks can't even go to less than a dollar from $200. So one lesson that we should be aware of, don't put all that money because anything can happen in the stock market in stock market moves in the, you know, like a momentum. And if you fail to get that momentum, it's hard to realize the profit. So what's the best way to invest then? Then you need to invest in a more broader ETF or portfolio like NASDAQ 100 or S P 500. Right. And I have many other like many other functions I have here. I'm not gonna run it again. You can use this function and I have many other functions in that article that you can use to analyze stock screen stock, analyze stock, compare performance of the stocks and then help you find out the best stock. Right. So the essence of this part, what I want to summarize here is non finance student don't know the volatility nature of the stock and they put a lot of money in one stock and what happens is they lose a lot of money. And I want to share that wisdom with you all. Okay, so because of the time limitation, now let's move on to the second part of this, which is I think that you can also look at. I think I don't have to do this, but you can if you want to run this. You can also compare different performance. Like these guys. I was, I was running to get ready for this presentation. Some stocks like Tesla in the 2022 until like yesterday the the holding return was 464%. SRG is another one and something like that. And you want to compare different stock like here you can change it and then run it. I'm gonna do it because it takes time. So the next thing I want to share is the about the options market. And this may be so options. I'm not gonna explain what is call option and what is put option. What I have created a little function here that helps you to understand what really affects the option price and this call price, whether this is a call option or is the put option. You know, it's the same thing that affects the price. And for example here, if the volatility is changing, let's say the volatility is from 15%, it goes to 40, 60%. The option gets more expensive, right? Likewise, time to expiration. If you increase the time to expiration, options get expensive. If your strike price is higher, call gets cheaper. But the put option gets more expensive if your strike price is more. Right. And with the volatility, whether that's a call or put, the price changes. So what you need to remember is that there are these factors, they affect call and put. And if you don't know how to select strike price, and then if you don't know the expected volatility, how it's going to work, then the options market can really be against you. So that's why lot of people, especially the big institutional investors, use options to make money by selling it. So when you are individual investors and want to use the, you know, option, it's very tricky. One has to understand the technical aspect of this call option and put options. But there are a lot of ways you can combine this call and put and design your strategy. And there are a lot of folks who make a living using call and put option trading strategies. So if you are interested, there are thousands of videos on YouTube. You can look at the essence here. What I'm trying to say here for our presentation purpose is that you know, the call option or the put option is impacted by a lot of like interest rate, time to expiration, volatility and also the dividend as well as the price of the stock. So in order to be able to trade options, you need to understand how each of these factors Affects option and how to use that information in order to trade options. So that's the thing that you need to be aware of before you dive into options market. And I have here another functions that Mathematica has a built in function that you can usually use to price option and here I was using what would be the price of a call and put that expires in a year from to like yes I was doing this yesterday. So a year from now and then you can run any options. But again this is using the historical data and history does not repeat most often in the stock market. So history only guides that but doesn't give us the full information and answer. So the volatility is the number one factor that needs to be considered when thinking about this options. But okay, you can rerun it, you can change the ticker symbol, you can change the strike price and the expression date. Rerun it and get this. I want to get to the next point which is what I really wanted you to learn about the futures market. And there are all kinds of futures but for us today I want to share some of the futures that are based on equity indices. Gold and, and oil like MES, MNQ, MYM, M2K they're all the equity futures meaning their value are derived from the equity indices. And there's a one mcl the micro crude oil future and then MGC is a micro gold future and the tick size and the tick value, point value and the notional value. So what I want to, I want to tell you in short is okay for now we can ignore tick size. What is tick value like? Tick size means by how much the price moves up and down. That's the tick size, right? And then tick valum means when the index moves up and down by that much by how much dollar value changes that the tick value. The point value is important here. Point value basically means when S P500 goes from 4200 to 4201 how the value of your portfolio will change when the index will change by one unit that means the value of your portfolio goes up by five dollar and MNQ two dollar and MYM this is the Dow futures one dollar and M2K five dollar so if you are investing MCL then one point increase or decrease would be ten dollars. So there are a lot of details here which we don't have time. What I wanted to you know, show you here is you know, here I'm just plotting some of the historical data, right? So here I'm looking at, I'm looking At the. This is the ES, S, P5 and index data since 2020 to October 30. And you can look at here values on the presentation mode. It doesn't show here. Maybe I can run. But okay, so you can plot it, right? And then you can also look at. Okay, here you can see this is a interactive trading chart. And I can see here, for example, for this guy here, s P500 index. Back in when December 2022, the value of this index was 3,849. And then it went from that point all the way to here up in August 1st, 2023. It's like 4600, right? And then now it down to this. So the point is it moves ups and down. So if you buy a future, one future and then hold for X number of years, how much would be the rate of return? So that's the part I want to share with you. And I'm sorry that this time is shorter than I thought. So here's an example, right? Let's look at. The point value is $5, right? Which means what, like when S&P 500, like 500 goes up and down by one point. By how much dollar do you have to. So this is a point value. So what was the beginning value? Let's say you invested in December 2022. So the value was, let's say roughly 3,900, right? And then you hold it like three, four months or until about 4,600, right, 4,600. So let's say you wanted to buy when the index was 3, 946. What would be the rate of return then? Then here I have a little. I mean, this is very explicit. I'm going to share with you all and then you can look at. So I can run this right? And then see what happens. Okay. Oh, I did the 446 that you lose a lot of money, right? 40. I want to do this 4600. So 4600. So in that case, okay, so look at here what happens in order to buy one future, right? So the investment margin rate is not like margin rate means how much money do you need to put in order to invest in that Stock? For S P 500, it's about 7%. Like 7% of notional value. And how you calculate notional value, mostly you divide, multiply point value by the beginning value and then the 7% of this notional value is the initial money you need to invest. That's called the initial capital. You need to take that position. So for example, if you do this, meaning when S P500 was 3900, you needed 1365 to buy one option, like futures, right? And then you hold on up until like 4600 and you sell it, how much would you make? 3, 500, right. That would be 3500. So what is the rate of return? So 156%. Right. So here's an example. Another example, like Nasdaq, you can Google NASDAQ. In 2009, when there was a crisis in 2009, NASDAQ was 1800. Okay. In back 2009, let's say you bought this, okay? This point value for NASDAQ is 2. And you bought this when it was 1800, right. Then you sold when it was all time high or even today, like 15,000 roughly. Right. If you bought this NASDAQ 100 future, micro future back in 2010, how much money you needed and how much would you get return? So here's the one thing I'm gonna say. Like, let's say this NASDAQ is a bit volatile, so they need about 12% of margin. So I'm gonna do this and if you run this code here, look at this. What happens? In order to invest that buy 1 futures of NASDAQ, you needed 422, 32, that much money you needed. If you had invested that money in 2009 and hold up until when the NASDAQ was 1500, you would make 4,46,000. Then what would be the rate of return? 6011%. Right. So that's a pretty compelling case. Like which stock? If you invest for like 12, 13 years, you would get that there are some stock, but you can count them in like they are by chance. Meaning you can pick out of this 13,000 stock. You can pick one stock, but the futures are there. You can buy it, right? But you cannot hold one future for like 10 years. The @ max on this equity indices, you can hold it for 11 year, but you have to roll over. And whenever you roll from one year to another year, you might lose some time, you might gain some time. But if you consistently hold that future for a long period of time, then rate of return is very high. So the takeaway masses. I know this like 20, 25 minute presentation would not make you understand what I'm trying to say. But the essence is this is a vehicle that you can really use to build capital over time. Let's say now everybody's talking about the recession. I don't know what's going to Happen, right? But let's say during our lifetime we get an opportunity and you get an opportunity to buy stocks. Then best way is to buy these micro future. And why this is now because micro future did not exist 2009. I mean first time they were launched in October 2019. And now you and me and individual investors can go and invest. And this gives a leverage investing capacity. That means if you have a 10,000, like buying a house, you pay down payment 5% or 10%, you hold 500,000 worth of house. Likewise here you just need 12% of money. And then you can hold like you can have a 10,000, but you can hold 100,000 worth of portfolio. And when the portfolio value goes up by 20%, 100%, then your value increases based on the entire portfolio value, not the initial value. So the takeaway message is educate yourself about these futures, micro futures and get ready for next investment when the times comes. With that short note. I know this is sort of time, so I would like to, you know, I mean Mathematica can be a tool that can be used for educating and learning at the same time. I often use this in the classes classroom for live demonstration and students are often excited with that short note. I would like to stop here if you guys have any questions. So I don't know how that works, but we can, we can talk about it. Do valuation even matter? This is a question we always ask as a finance faculty. In the long term, valuation does matter. But in the short term, stock market is mad. As you all know, anything can happen. So in short term, all investing or trading is all about the momentum. If you are able to cast the momentum, you're good. Valuation does not matter. But if you're thinking about long term valuation does matter. And do you even use the VIX as an indicator? Yes, VIX is always gauge of future volatility. And especially if you are thinking about trading in options, VIX is the to go. So these are the three questions. I see. But again guys, so this is very short. But consider micro future in your portfolio. And then when the times comes, invest and improve your financial health. That's all I would like to share. Thank you so much. Okay, bye bye.
More from Guy

Cheryl Strauss Einhorn | The Human Edge: Smarter Decisions in the Age of AI | Talks at Google

Rachel Glennerster | Innovation and the Center for Global Development | Talks at Google

Rebecca Winthrop | Rethinking the Purpose of Education in the Age of AI | Talks at Google

Dr. Robert Wachter | A Giant Leap: How AI Is Transforming Healthcare... | Talks at Google






