Gamestudio Links
Zorro Links
Newest Posts
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
Release 2.68 replacement of the .par format
by Martin_HH. 09/23/25 20:48
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,175 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
VAR (Value at Risk) #475733
01/05/19 18:29
01/05/19 18:29
Joined: Feb 2018
Posts: 236
Italy
tradingest Offline OP
Member
tradingest  Offline OP
Member

Joined: Feb 2018
Posts: 236
Italy
Hi guys,

anybody use the formula or indicator to obtain the correct VAR of a portfolio strategy?

Wikipedia def
What is the VAR? Value at risk (VaR) is a measure of the risk of loss for investments. It estimates how much a set of investments might lose (with a given probability), given normal market conditions, in a set time period such as a day. VaR is typically used by firms and regulators in the financial industry to gauge the amount of assets needed to cover possible losses. For a given portfolio, time horizon, and probability p, the p VaR can be defined informally as the maximum possible loss during the time if we exclude worse outcomes whose probability is less than p. This assumes mark-to-market pricing, and no trading in the portfolio.[1] For example, if a portfolio of stocks has a one-day 5% VaR of $1 million, that means that there is a 0.05 probability that the portfolio will fall in value by more than $1 million over a one-day period if there is no trading. Informally, a loss of $1 million or more on this portfolio is expected on 1 day out of 20 days (because of 5% probability). Follow us for a good trading

Thanks

Last edited by tradingest; 01/05/19 19:14.
Re: VAR (Value at Risk) [Re: tradingest] #475768
01/07/19 16:21
01/07/19 16:21
Joined: Aug 2016
Posts: 27
M
MaskOfZorro Offline
Newbie
MaskOfZorro  Offline
Newbie
M

Joined: Aug 2016
Posts: 27
What's the question?

Never done it in Zorro, but Zorro lets you find covariances and construct a covariance matrix

Quote:
/ generate covariance matrix
for(i=0; i<N; i++)
for(j=0; j<N; j++)
Covariances[i][j] = Covariance(Returns[i],Returns[j],DAYS);


The you just need the weights vector and to perform matrix multiplication



Then multiply the portfolio value by the calculated portfolio sigma and the appropriate z-score for the confidence level you want (e.g. 1.645 for 95%).


Moderated by  Petra 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1