I spent a good portion of my $90,000 master's degree learning 1 thing:
Simulating stock prices.
The good news?
You don't need a master's degree to build your own stock price simulator in Python.
I'm going to show you how step-by-step:
Simulating stock prices.
The good news?
You don't need a master's degree to build your own stock price simulator in Python.
I'm going to show you how step-by-step:
By reading this thread, you'll be able to build your own stock price simulator in Python.
Here's what you'll learn:
1. About Geometric Brownian Motion
2. Import libraries and set up
3. Build the functions
4. Visualize results
Ready?
Here's what you'll learn:
1. About Geometric Brownian Motion
2. Import libraries and set up
3. Build the functions
4. Visualize results
Ready?
A primer:
GBM is a continuous-time stochastic process where the log of the random variable follows the Wiener process with drift.
What?
Itβs a data series that trends up or down through time with a defined level of volatility.
And itβs perfect for simulating stock prices.
GBM is a continuous-time stochastic process where the log of the random variable follows the Wiener process with drift.
What?
Itβs a data series that trends up or down through time with a defined level of volatility.
And itβs perfect for simulating stock prices.
A Wiener process is a one-dimensional Brownian motion.
It's used in quant finance because of some useful mathematical properties.
In practice, it's used interchangeably with GBM.
You can read more on Wikipedia.
Ok enough, let's see the code!
en.wikipedia.org
It's used in quant finance because of some useful mathematical properties.
In practice, it's used interchangeably with GBM.
You can read more on Wikipedia.
Ok enough, let's see the code!
en.wikipedia.org
If this is all a little too abstract, you might like the Ultimate Guide to Pricing Options and Implied Volatility With Python were GBM is used.
β’ Black-Scholes, the greeks, and implied volatility
β’ Jupyter Notebooks with the code
β’ Live options data
pyquantnews.gumroad.com
β’ Black-Scholes, the greeks, and implied volatility
β’ Jupyter Notebooks with the code
β’ Live options data
pyquantnews.gumroad.com
Spend some time and play around with the variables.
β’ What happens if you double volatility?
β’ What happens if you set mu to a negative number?
You can use this code to simulate a trading strategy too.
It's a great way to get some intuition about how markets behave.
β’ What happens if you double volatility?
β’ What happens if you set mu to a negative number?
You can use this code to simulate a trading strategy too.
It's a great way to get some intuition about how markets behave.
I really hope you enjoyed this thread.
If there's too much to consume now, retweet the top tweet so you can find it later.
You can also follow me @pyquantnews for more tweets and threads that help you get started with Python for quant finance.
If there's too much to consume now, retweet the top tweet so you can find it later.
You can also follow me @pyquantnews for more tweets and threads that help you get started with Python for quant finance.
If you like Tweets performance metrics in your trading, you might enjoy my weekly newsletter: The PyQuant Newsletter.
Python code for quantitative analysis you can use.
Join 4,600+ subscribers who are taking action with Python.
pyquantnews.com
Python code for quantitative analysis you can use.
Join 4,600+ subscribers who are taking action with Python.
pyquantnews.com
Loading suggestions...