Niklaus

Beta

en.wikipedia.org/wiki/Beta_(finance)
Beta is a measure of the risk arising from exposure to general market movements as opposed to idiosyncratic factors.
The market portfolio of all investable assets has a beta of exactly 1 (here the S&P500). A beta below 1 can indicate either an investment with lower volatility than the market, or a volatile investment whose price movements are not highly correlated with the market
סקריפט קוד פתוח

ברוח TradingView אמיתית, מחבר הסקריפט הזה פרסם אותו בקוד פתוח, כך שסוחרים יכולים להבין ולאמת אותו. כל הכבוד למחבר! אתה יכול להשתמש בו בחינם, אך שימוש חוזר בקוד זה בפרסום כפוף לכללי הבית. אתה יכול להכניס אותו למועדפים כדי להשתמש בו בגרף.

כתב ויתור

המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.

רוצה להשתמש בסקריפ זה בגרף?
study(title="Beta", shorttitle="Beta")

//by Niklaus
//SHOULD BE USED TOGETHER WITH "Alpha" INDICATOR
//beta (β or beta coefficient) of an investment indicates whether the investment is more or less volatile than the market. 
//In general, a beta less than 1 indicates that the investment is less volatile than the market,
//while a beta more than 1 indicates that the investment is more volatile than the market. Volatility is measured as the fluctuation of the price around the mean.

//Beta is a measure of the risk arising from exposure to general market movements as opposed to idiosyncratic factors. 
//The market portfolio of all investable assets has a beta of exactly 1 (here the S&P500). A beta below 1 can indicate either an investment with lower volatility than the market, 
//or a volatile investment whose price movements are not highly correlated with the market. 
//An example of the first is a treasury bill: the price does not go up or down a lot, so it has a low beta. 
//An example of the second is gold. The price of gold does go up and down a lot, but not in the same direction or at the same time as the market

//https://en.wikipedia.org/wiki/Beta_(finance)

sym = "SPX500", res=period, src = close, length = input(title = "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

plot(Beta, color=blue, style=area, transp=40)