Risk Position Sizing tool using Coefficient of Variation

A way to manage portfolio risk using relative standard deviation, also known as coefficient of variation. This tool tells you how much of each stock in shares and in value to buy adjusted for their volatility risk for a given starting account capital. A problem many people have is how to diversify an account and adjusting it for the risk involved in each equity. Many would put in an equal amount of capital value into each share but is it really equal if some equities have more risk than others? A solution is to adjust the portfolio by giving less weight to those that are more volatile or risky. It's done by using a starting percent of the account, preferably a small percent of it, and buying up shares with that same amount for each equity. Each equity will also be divided by the COV to risk adjust the portfolio by giving less weight to the more volatile stocks. This is done until as much of the initial capital in the account as possible is spent.

COV is how far away the price is from the mean or average. The further the price is from the mean the more risk or volatility there is. It uses standard deviation in its calculation. The problem with SD and ATR is that they are not relative to the past or to other equities to compare to. An application where COV can be used is risk portfolio management formulas. This does not take into account correlation or other equation parts in some portfolio management formulas but only the risk or volatility , the default volatility length is mostly arbitrary, and the lower risk stocks may end up being the slowest in performance.

The text label will show how many shares will be bought and how much value each equity will have. At the end it will show the initial capital that was started off with, the total shares bought, the total value of all the shares, and the amount of capital left over. If the sources are not blank then they will be used, to blank them you will need to reset the settings to default otherwise they might still be read. If you want to add more than the given 10 equity spaces to the portfolio then you will need to add in the code manually and add it to the chart. The denominator is perhaps the important part in these types of risk position sizing tools, you can change to other things such as risk-reward ratio instead of volatility or change the volatility type, etc.
릴리즈 노트: fixed a problem with the volatility somehow existing despite empty input symbol sources which ended up throwing things off
오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.


이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?