Simple Monte Carlo Simulation of Stock Prices with Python

  Рет қаралды 118,082

codebliss

codebliss

Күн бұрын

Пікірлер: 73
@maheshhraut
@maheshhraut 3 жыл бұрын
Amazing work man. No nonsense, just to the point 👏
@chbrownie18
@chbrownie18 Жыл бұрын
Clear straight forward presentation. Perfect. Sadly my browser doesn't want me to bookmark your site for security reasons.
@otroleonarbe
@otroleonarbe 5 жыл бұрын
great tutorial. One thing that could make this video better will be the font size. I believe it's a little too small, if you're watching on a laptop. IMO. However, keep it up sharing your knowledge to the world :)
@JoaoVictor-sw9go
@JoaoVictor-sw9go 3 жыл бұрын
Great tutorial, but I think the nested loops don't actually need a counter because de y variable has the exact same values. The only adjustment you would have to make when removing the break is loop through the number of periods - 1!
@findpatterns
@findpatterns 4 жыл бұрын
Thanks. The video it's self explained the concept really well.
@goodlack9093
@goodlack9093 3 жыл бұрын
Great video, definitely super useful! Thank you!
@divinastrain1286
@divinastrain1286 5 жыл бұрын
As far as I know, the daily earning rate didn’t follow the normal distributin, but the ln(earning rate ) does. Really want a discussion.
@none4111
@none4111 5 жыл бұрын
There is something odd about the output until I realized its wrong. -> np.random.normal(0,daily_vol). Instead, it should be np.random.normal(statistics.mean(returns[1:])),daily_vol). Basically, the mean is not 0. On average, prices go up for equity and the normal distribution shifts right. (side note: using normal dist. is simpler but doesn't account for higher moments such as Kurtosis and Skewness) Also as other pointed out "count" is not needed. Using last price is correct since that's the initial starting period of the MC.
@marku7z
@marku7z 2 жыл бұрын
This was the first thing, i was wondering when watching the Video few seconds ago - Why do we assume the mean to be 0 here?
@jy5104
@jy5104 2 жыл бұрын
@@marku7z There is something wrong with the last red line as well. It should connect the initial price and the average of the simulation value on the last day.
@esahin01
@esahin01 3 жыл бұрын
Thank you for the video, it is very informative
@wilsonkun
@wilsonkun 7 жыл бұрын
Just learnt how to produce monte carlo using Brownian motion in Python. Looking forward on how to get insights using that graph.
@RailDevil68
@RailDevil68 5 жыл бұрын
Nice man, worked fine for me 1st try.. Well, except for the 'google' part, which i replaced by yahoo but nice !
@DivineZeal
@DivineZeal 6 жыл бұрын
very great video, lots of possibilities
@rajkiranboggala
@rajkiranboggala 6 жыл бұрын
That was a nice explanation. Thanks
@manuelpena3988
@manuelpena3988 5 жыл бұрын
I don't know if I am misunderstanding it, but, is the "count" variable really needed? I think the "y" variable has exactly the same value every moment.
@71javer
@71javer 5 жыл бұрын
Cheers for this, I been tryin to find out about "share options trading" for a while now, and I think this has helped. Ever heard of - Winoorfa Option Olegroson - (should be on google have a look ) ? Ive heard some super things about it and my friend got amazing success with it.
@dragomir44
@dragomir44 6 жыл бұрын
Hey P4F, have you ever gotten the Google "We're sorry but your computer may be sending automated queries" error? form the prices = web.DataReader line of code?
@jongcheulkim7284
@jongcheulkim7284 2 жыл бұрын
Thank you.
@sornponwichaidit4172
@sornponwichaidit4172 6 жыл бұрын
thanks for the great tutorial. why don't you used log return instead of simple return?
@TheKenji1681
@TheKenji1681 4 жыл бұрын
What is the difference with log return and return? I am new 😿
@juinsong7949
@juinsong7949 6 жыл бұрын
May I know why my final simulation_df only displayed one trial path, even thought my code is identical to yours?
@jayjaytapp
@jayjaytapp 4 жыл бұрын
Thanks for the great video!! Sorry for being critic, for your next video I'd be useful if the font sizes a bit bigger and if you try to minimize the noise of your keyboard.
@margy1061
@margy1061 3 жыл бұрын
Great work :)
@markk364
@markk364 4 жыл бұрын
great vid - thanks. i see many predictors that fail to utilize stock-price-returns as a factor for their random.normal shock factor. Looking for more.
@AlvaroLefian
@AlvaroLefian 6 жыл бұрын
great tutorial but please move the microphone away from the keyboard the noise is unbearable
@kurtb3260
@kurtb3260 4 жыл бұрын
Great informative, concise, vid. Thanks for posting the code. Only had to make a few tweaks to make it work for me. Assuming random price action, the logic is correct.
@mxcollin95
@mxcollin95 4 жыл бұрын
Great example! Thanks for posting. 👍
@nstevens81e
@nstevens81e 5 жыл бұрын
Why does this video stop playing at 0:21?
@ZulfiqarAli-ck1kc
@ZulfiqarAli-ck1kc 3 жыл бұрын
Sir please share the playlist
@rverm1000
@rverm1000 5 жыл бұрын
I tried this with python 3.8 . Got a data_source='Google's is not implemented.
@atrumluminarium
@atrumluminarium 4 жыл бұрын
Try "yahoo"
@rverm1000
@rverm1000 5 жыл бұрын
Overall it's a good video
@TheChawamushi
@TheChawamushi 4 жыл бұрын
what does the 0 in the function pd.random.normal represent?
@euanscott-watson3725
@euanscott-watson3725 4 жыл бұрын
I believe its because thats how the normal standard deviation works, the formula is that of N(mu, sigma) where mu is the most common value on a bell curve at the peak. So that means that 99% of the values created by the normal function will be between -3*sigma and 3*sigma
@kurtb3260
@kurtb3260 4 жыл бұрын
Zero represents the center of the distribution.
@inglese2996
@inglese2996 3 жыл бұрын
4 years later... are you a millionaire yet? I mean... does this modelling have a practical benefit and allow you to trade the market more effectively?
@francisodonoghue1581
@francisodonoghue1581 Жыл бұрын
Does not support 'google' , I think (Line 13)
@kebman
@kebman 4 жыл бұрын
You know, given the assumption that price action is random, which it isn't.
@MatthieuVlogs
@MatthieuVlogs 7 жыл бұрын
Great video! I'm just now getting started with Python and Apis with excel- so this was a bit over my head but something to aspire to certainly. As a python interface, I see you're using spyder. I'm using one called python 3.6, will I be able to have the same capabilities with 3.6?
@francisdupuis6213
@francisdupuis6213 7 жыл бұрын
Absolutely. I run python 2.7 and 3.5 as separate environments with Anaconda (highly recommended package by the way). But I'm assuming your using idle with Python 3.6, so it should work fine with some minor syntax changes.
@MatthieuVlogs
@MatthieuVlogs 7 жыл бұрын
Great thanks! Look forward to learning more with your channel
@1234dck
@1234dck 4 жыл бұрын
Great video thanks a lot. But it too small. Thanks again.
@kaplansedat
@kaplansedat 4 жыл бұрын
font size and mechanical keyboard. oh god mechanical keyboard. developers love band wagon.
@JR-ly6bx
@JR-ly6bx 5 жыл бұрын
What IDE are you using
@euanscott-watson3725
@euanscott-watson3725 4 жыл бұрын
Its spyder with an anaconda virtual environment
@arshavir86
@arshavir86 6 жыл бұрын
I am using jupyter notebook and somehow it says "No module named 'pandas_datareader' " How can I fix this issue?
@ai-cowboy
@ai-cowboy 6 жыл бұрын
open anaconda prompt > copy/paste into first line: conda install -c anaconda pandas-datareaderanaconda.org/anaconda/pandas-datareader
@NKernytskyy
@NKernytskyy 5 жыл бұрын
Please use LARGER font, please...
@rverm1000
@rverm1000 5 жыл бұрын
Pandas data reader is not implemented
@Lexluthor2024
@Lexluthor2024 4 жыл бұрын
There's a function in python to silence keyboard?
@oneboy8183
@oneboy8183 4 жыл бұрын
lol that keyboard tho!
@jacktrainer4387
@jacktrainer4387 4 жыл бұрын
Masterful!
@qwesx23
@qwesx23 6 жыл бұрын
blue switch!
@michaelkueng8564
@michaelkueng8564 5 жыл бұрын
Hi, Thank you for this cool video! I tried to do this, but kept getting this error: File "C:/Users/micha/.spyder-py3/temp.py", line 10 start = dt.datetime(2017, 01, 03) ^ SyntaxError: invalid token Does someone know why?
@AM-cg3nt
@AM-cg3nt 3 жыл бұрын
Can’t lead with 0’s - fix it by putting the date as (2017,1,3)
@maribelmenese4845
@maribelmenese4845 Жыл бұрын
Bro forgot the "y" in the thumbnail.
@thunde7226
@thunde7226 6 жыл бұрын
I am using Python 3.6.5................I have an error.....................:( some one help...................warnings.warn(UNSTABLE_WARNING, UnstableAPIWarning) UnstableAPIWarning: The Google Finance API has not been stable since late 2017. Requests seem to fail at random. Failure is especially common when bulk downloading.
@jonswift2455
@jonswift2455 6 жыл бұрын
a few free sources have stopped working, google stopped awhile ago, yahoo stopped late last year i think.
@jonswift2455
@jonswift2455 6 жыл бұрын
change to robinhood or morningstar where google is written
@Axle_Max
@Axle_Max 6 жыл бұрын
The code doesn't work, the data sources are deprecated. Thanks for trying but it's broken
@franklinparker
@franklinparker 6 жыл бұрын
you can get the data using the Quandl library import quandl as ql , then ql.get( "WIKI/APPL", start_date = , end_date = )
@dreamz52
@dreamz52 Жыл бұрын
A lot of issues here
@wildhostage
@wildhostage 4 жыл бұрын
If I could write code like that, I would be so gangsta
@optimizedpran1247
@optimizedpran1247 4 жыл бұрын
sounds like a razer keyboard hahahah
@divinastrain1286
@divinastrain1286 5 жыл бұрын
Hey man. This tutorial is totally WRONG. This is not Monte Carlo. The mean of your result will be same as lasta_day_price forever. That was misleading…..
How to: Monte Carlo Simulation in Python (Introduction)
27:23
Mr. P Solver
Рет қаралды 65 М.
Lazy days…
00:24
Anwar Jibawi
Рет қаралды 8 МЛН
Lamborghini vs Smoke 😱
00:38
Topper Guild
Рет қаралды 53 МЛН
Do you love Blackpink?🖤🩷
00:23
Karina
Рет қаралды 23 МЛН
Predicting Stock Prices in Python
29:14
NeuralNine
Рет қаралды 539 М.
R Finance: Monte Carlo Simulations
16:17
Chessability
Рет қаралды 5 М.
What is Monte Carlo Simulation?
4:35
IBM Technology
Рет қаралды 293 М.
Monte Carlo Simulation of Stock Price Movement
14:37
Option Trader
Рет қаралды 95 М.
Monte Carlo Simulation with Card Games
8:21
Normalized Nerd
Рет қаралды 54 М.
Monte Carlo Simulation of a Stock Portfolio with Python
18:23
Database Indexing for Dumb Developers
15:59
Laith Academy
Рет қаралды 75 М.
Using Monte Carlo simulations for valuation
9:53
Financial Analysis with Dr Jeff
Рет қаралды 19 М.