Sunday, 7 July 2019

How to analyse time series data NIFTY50

 How to analyze data( NIFTY50)

nifty,bank nifty,bank nifty analysis,nifty analysis,bank nifty strategy,nifty tomorrow,bank nifty today,bank nifty future,nifty 50,nifty options trading strategies,nifty bank,nifty future,nifty this week,bank nifty live,nifty tommorow,nifty strategy,bank nifty studio,nifty prediction,bank nifty option,bank nifty prediction for tomorrow,nifty 50 companies,bank nifty options,bank nifty live chart


https://www.mathclasstutor.online
getSymbols("^NSEI", from="2004-01-01", to=Sys.Date())
chartSeries(Cl(NSEI))
> ret <- dailyReturn(Cl(NSEI), type='log')
Warning message:
In to_period(xx, period = on.opts[[period]], ...) :
  missing values removed from data
> par(mfrow=c(2,2))
> acf(ret, main="Return ACF");
> pacf(ret, main="Return PACF");
> acf(ret^2, main="Squared return ACF");
> pacf(ret^2, main="Squared return PACF")
> par(mfrow=c(1,1))
> m=mean(ret);s=sd(ret);
> par(mfrow=c(1,2))
> hist(ret, nclass=40, freq=FALSE, main='Return histogram');curve(dnorm(x,
+          mean=m,sd=s), from = -0.3, to = 0.2, add=TRUE, col="red")
> plot(density(ret), main='Return empirical distribution');curve(dnorm(x,
+         mean=m,sd=s), from = -0.3, to = 0.2, add=TRUE, col="red")
> par(mfrow=c(1,1))
https://www.mathclasstutor.online

> kurtosis(ret)
[1] 12.6355
attr(,"method")
[1] "excess"
> plot(density(ret), main='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")
> plot(density(ret), xlim=c(-5*s,5*s),log='y', main='Density on log-scale')
Warning message:
In xy.coords(x, y, xlabel, ylabel, log) :
  75 y values <= 0 omitted from logarithmic plot
> curve(dnorm(x, mean=m,sd=s), from=-5*s, to=5*s, log="y", add=TRUE,
+       col="red")
https://www.mathclasstutor.online

https://www.mathclasstutor.online

https://www.mathclasstutor.online

> qqnorm(ret);qqline(ret);

No comments:

Post a comment

Intersection of subring

How to prove the intersection of two subrings is a subring? Let S1 and S2  be two subrings of a ring R. Then S1∩S2 is not empty since ...