Historical Value at Risk (VaR) with Python

preview_player
Показать описание
Implementation of Historical Value at Risk (VaR) and Conditional Value at Risk (CVaR) with Python.

★ ★ Code Available on GitHub ★ ★

★ ★ QuantPy GitHub ★ ★

★ ★ Discord Community ★ ★

★ ★ Support our Patreon Community ★ ★
Get access to Jupyter Notebooks that can run in the browser without downloading python.

★ ★ ThetaData API ★ ★
ThetaData's API provides both realtime and historical options data for end-of-day, and intraday trades and quotes. Use coupon 'QPY1' to receive 20% off on your first month.

★ ★ Online Quant Tutorials ★ ★

★ ★ Contact Us ★ ★

Disclaimer: All ideas, opinions, recommendations and/or forecasts, expressed or implied in this content, are for informational and educational purposes only and should not be construed as financial product advice or an inducement or instruction to invest, trade, and/or speculate in the markets. Any action or refraining from action; investments, trades, and/or speculations made in light of the ideas, opinions, and/or forecasts, expressed or implied in this content, are committed at your own risk an consequence, financial or otherwise. As an affiliate of ThetaData, QuantPy Pty Ltd is compensated for any purchases made through the link provided in this description.
Рекомендации по теме
Комментарии
Автор

Thanks for sharing all of this information and code. The hill is steep, but worth it, I feel.

oldtimehockey
Автор

Thanks, You so much It is very useful

AkashChauhan-rwqh
Автор

Hi mate,
Great work and thanks for sharing, I’m struggling to apply your code based on an Excel file where I simply have portfolio monthly returns.
I get “can’t multiply sequence by non int of type float” .
I’m not sure how to approach this, I’m sure it’s because of the first steps but I’m quite new to Python so any help would be more than welcome.
Cheers

ali-claudebarry
Автор

Hey man! awesome video, cleared a lot of concepts. I have a doubt. If I wnated to calculate each day VaR or CVaR in a sliding/rolling window method with window size=7, and want to get each day's VaR or CVaR of each stocks or Portfolio, how to do that?

mediumdatascience
Автор

I am not sure if we are allowed to simply multiply daily returns by T. They are not log returns, so wouldn't it be more correct to do something like this: (1+returns)**T - 1?

mr_mr_
Автор

thank you so much for the video, I am going through your videos! I would like to become a quant that is my dream job

gian_piano
Автор

Great Video .. if possible please make more videos on credit risk and FI derivatives valuation

finvengers
Автор

If i have the historical daily var and i want to comvert it to a 30 day period window, i just multiply by the sqrt(30)???
Thank you very much.

Saboman
Автор

Could you elaborate on the weights, why is it random? what if I want to put in my own weights?

mr.gk
Автор

Thank you for the video. I have a question. How can I compute the quantiles for a specific p, using Rankit-cleveland method? It is used to estimate the value at risk using quantile regression and I am kind of stuck. please help

Im-Assmaa
Автор

Hey mate, is the historical Var just the n th percentile of the profit loss distribution?

tblaze
Автор

Actually I have a question, why do we need to add stock+'.AX'?

joker-fv
Автор

Being picky here: The Pythonic function name would be get_data, not getData, per PEP-8

nccamsc
Автор

Excellent. You forgot to plot the chart.

aarondelarosa
Автор

Hi…when i am giving the last code u did with the initial investment part..i got an error: cannot pack non-iterable Nonetype object and i am basically getting it in the code: pRet, pStd = PortfolioPerfomance(weights, meanReturns, covMatrix, Time)..can you pls help me with this?

krishnakundu
Автор

Hello, here the code is used with random weight. But what would be the code with lets say a 16.66% weight for each of your stock as you have 6 stocks ?

Vince-rmrr
Автор

Hi mate, First of all thanks for this helpful VaR series. I tried to run the code, but in the function historicalCVaR, I get an error in the line:
belowVaR = returns <= historicalVaR(returns, alpha=alpha)
TypeError: 'Series' object is not callable

Any ideas why? Cheers!

alfilart
Автор

may be breaking changes, I get the following error,
RemoteDataError: No data fetched using 'YahooDailyReader'

wryltxw
Автор

I get: "RemoteDataError: No data fetched using 'YahooDailyReader'". I checked the symbols and they are correct.

mariaaguilera