TradingView
Lupo_Investing
2019년 10월 24일 오전 9시 55분

Rolling Moving Average, SMA/EMA, for IPO stocks 

Lyft, Inc.NASDAQ

설명

The script replicates the standard EMA/SMA used by tradingview, but also adds an estimate for the first X periods, where X is the length of the moving average. This allows for an estimate of support resistance in IPO stocks, when fewer date is available
코멘트
formy76
Ciao, è possibile applicarlo anche al Alpha di Jensen e il beta, sarebbe interessante capire se l'ipo genera alpha dalle prime barre. Grazie.

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)
Lupo_Investing
@formy76, si può fare, ma la significanza statistica della correlazione (il valore di beta) che ottieni è molto bassa. Ottieni si un valore, ma che non ha troppo significato, in quanto stai usando troppi pochi periodi per calcolarlo.
formy76
Grazie proprio ciò che cercavo, secondo te è possibile codificarla anche per prorealtime?
Lupo_Investing
@formy76, non conosco il linguaggio di programmazione di prorealtime, quindi non ti saprei dire. Magari provi a chiedere su un forum li postando questo script e vedi se qualcuno ti riesce ad aiutare
더보기