Niklaus

Alpha

Alpha is a measure of the active return on an investment, the performance of that investment compared to the S&P500 index, where 0.01 = 1%

  • alpha < 0: the investment has earned too little for its risk (or, was too risky for the return)
  • alpha = 0: the investment has earned a return adequate for the risk taken
  • alpha > 0: the investment has a return in excess of the reward for the assumed risk
Skrypt open-source

Zgodnie z prawdziwym duchem TradingView, autor tego skryptu opublikował go jako open-source, aby traderzy mogli go zrozumieć i zweryfikować. Brawo dla autora! Możesz używać go za darmo, ale ponowne wykorzystanie tego kodu w publikacji jest regulowane przez Dobre Praktyki. Możesz go oznaczyć jako ulubione, aby użyć go na wykresie.

Wyłączenie odpowiedzialności

Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.

Chcesz użyć tego skryptu na wykresie?
study(title="Alpha", shorttitle="Alpha")

////SHOULD BE USED TOGETHER WITH "Beta" INDICATOR
//Alpha is a measure of the active return on an investment, the performance of that investment compared to a suitable market index, where 0.01 = 1%
//alpha < 0: the investment has earned too little for its risk (or, was too risky for the return)
//alpha = 0: the investment has earned a return adequate for the risk taken
//alpha > 0: the investment has a return in excess of the reward for the assumed risk

//Beta Calculation
sym = "SPX500", res=period, src = close, length = input(title="rolling beta window",defval=300, minval=1)
ovr = security(sym, res, src)
ret = ((close - close[1])/close)
retb = ((ovr - ovr[1])/ovr)
secd = stdev(ret, length), mktd = stdev(retb, length)
Beta = correlation(ret, retb, length) * secd / mktd

//Alpha Calculation
y = input(title="alpha period", type=integer, defval=90, minval=1, maxval=1000)
ret2 = ((close - close[y])/close)
retb2 = ((ovr - ovr[y])/ovr)
alpha = ret2 - retb2*Beta
plot(alpha, color=green, style=area, transp=40)