Stock Market Analysis Using R
Quantmod?–?“Quantitative Financial Modeling and Trading Framework for R”
The aim of the article is to extract stock market data into R using the package Quantmod. we need to install the package install the package by using the command install.packages("quantmod") and then we need the symbol name for each of the organisation. we can navigate the link https://www.nasdaq.com/screening/company-list.aspx , By clicking any one of the company name you can find a column call Symbol which is highlighted in Blue (length of 3 character).
Our first aim to see a stock details of a paticular organisation. for e.g iam taking WIPRO,symbol for WIPRO is "WIT" and execute the below code,as i am taking date from DEC 7th to till data.
require("quantmod")
require(TTR)
getSymbols("WIT",src="yahoo" , from ="2017-12-07", to = Sys.Date())
View(WIT)
Our Next aim to analyze further for a period 3 months by Moving Average
Using the type "Moving Average Convergence Divergence indicator to chart"
to see how the stock is performing and followed by
Bollinger Bands to current chart
领英推荐
# Source code the above to charts in R
require("quantmod")
require(TTR)
# Get the symbol https://www.nasdaq.com/screening/company-list.aspx
# Functions to load and manage Symbols in specified environment.
# WIT is the symbol for WIPRO
getSymbols(c("WIT")) #?
# Charting tool to create standard financial charts given a time series like object
# subset - xts style date subsetting argument
chartSeries(WIT, subset="last 3 months")
# Add Moving Average Convergence Divergence indicator to chart.
addMACD() #- Add Moving Average
#?
addBBands() #? Add Bollinger Bands to current chart.
Hope this article given an understand on how to extract stock data using R.
BBlog
Powerapps:
work on dax