Showing posts with label Stock Price TSLA. Show all posts
Showing posts with label Stock Price TSLA. Show all posts

Monday, January 13, 2020

How to move Stock Price TSLA

Stock Price TSLA

tslachartseries

[1] "TSLA"
> chartSeries(Cl(TSLA))
> addRSI()
> addMomentum()
> rettsla <- dailyReturn(Cl(TSLA), type='log')
> par(mfrow=c(2,2))
> acf(rettsla, main="Tsla Return ACF");
> pacf(rettsla, main="Tsla Return PACF");
> acf(rettsla^2, main="Tsla Squared return ACF");
> pacf(rettsla^2, main="Tsla Squared return PACF")
Tsla Return ACF

> par(mfrow=c(1,1))
> m=mean(ret);s=sd(ret);
> kurtosis(rettsla)
[1] 5.814273
attr(,"method")
[1] "excess"
> plot(density(rettsla), main='Tsla Return EDF - upper tail', xlim = c(0.1, 0.2),
+      ylim=c(0,2));
> curve(dnorm(x, mean=m,sd=s), from = -0.3, to = 0.2, add=TRUE, col="red")
'Tsla Return EDF - upper tail

'Tsla Return EDF - upper tail

> ret.tsla <- dailyReturn(Cl(TSLA), type='log')
> chartSeries(rettsla)
 chartSeries(rettsla)

(rettsla)

> garch11.spec = ugarchspec(variance.model = list(model="sGARCH",garchOrder=c(1,1)), mean.model = list(armaOrder=c(0,0)))
> tsla.garch11.fit = ugarchfit(spec=garch11.spec, data=rettsla)

Black-Scholes formula-R

 Black-Scholes formula-R > BlackScholes <- function(TypeFlag = c("c", "p"), S, X, Time, r, b, sigma) { TypeFla...