https://github.com/nandp1/nser
R package to download historical bhavcopy of Equities and F&O, get live market data, plot treemap of movement in securities
https://github.com/nandp1/nser
bhav bhavcopy bhavcopy-downloader cran financial-data market-data national-stock-exchange nse nse-stock-data option-pricing optionchain r r-package rselenium stock-prices
Last synced: 2 months ago
JSON representation
R package to download historical bhavcopy of Equities and F&O, get live market data, plot treemap of movement in securities
- Host: GitHub
- URL: https://github.com/nandp1/nser
- Owner: nandp1
- License: gpl-2.0
- Created: 2021-07-07T18:06:20.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-11-13T03:58:24.000Z (7 months ago)
- Last Synced: 2025-03-18T18:03:43.463Z (3 months ago)
- Topics: bhav, bhavcopy, bhavcopy-downloader, cran, financial-data, market-data, national-stock-exchange, nse, nse-stock-data, option-pricing, optionchain, r, r-package, rselenium, stock-prices
- Language: R
- Homepage: https://nandp1.github.io/nser/
- Size: 1.62 MB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.Rmd
- License: LICENSE
Awesome Lists containing this project
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```[](https://cran.r-project.org/package=nser)
[](https://lifecycle.r-lib.org/articles/stages.html#stable-1)

[](https://cran.r-project.org/package=nser)# Latest Version `1.4.4`
* `optnifty`, `optbanknifty` are deprecated.
# New functions `nsetree`, `bhavfos`, `daytoweek`, `daytomonth`
* `daytomonth` Convert daily OHLC data to monthly data
* `daytoweek` Convert daily OHLC data of a stock to weekly data.
* `nsetree` Get a treeplot plot of NSE NIFTY 50 and FO securities.
* `bhavfos` Download historical F&O Bhavcopy zip file through RSelenium.
# Introduction
"nser" helps you to download historical bhavcopy of Equities and F&O segment easily.
Package website [nser](https://nandp1.github.io/nser/)
## Installation
You can install "nser" from [CRAN](https://cran.r-project.org/package=nser) with:
``` r
install.packages("nser")
```
Install it from github by:
``` r
install.packages("devtools")
library(devtools)
install_github("nandp1/nser")
```## Example 1. Downloading Historical Equity Bhavcopy
``` r
library(nser)
# Download Bhavcopy of 1st July 2021
report1 = bhav("01072021")
```## Example 2. Downloading Historical F&O Bhavcopy
``` r
library(nser)
# Download Bhavcopy of 1st July 2021
report2 = fobhav("01072021")
```
## Example 3. Downloading today's Equity and F&O Bhavcopy
```r
library(nser)
report3 = bhavtoday()
report4 = fobhavtoday()
```## Example 4. Live F&O data.
``` r
library(nser)
nselive()
```## Example 5. Pre market open data of F&O stocks
``` r
library(nser)
nseopen("fo")
```## Example 6. Current and Upcoming IPO's
```
library(nser)
nseipo()
```## Example 7. RSelenium to Download Equity Bhavcopy
``` r
library(nser)
library(RSelenium)# Start a selenium server and browser
# For Google Chrome (Update Chrome to latest version)driver <- rsDriver(browser = c("chrome"), port = 3163L, chromever = "91.0.4472.101")
remDr <- driver$client# or for Firefox
driver <- rsDriver(browser = c("firefox"), port = 3799L)
# Download Equity Bhavcopy zip file
bhavs("03012000", 2)# Close the Browser
remDr$close()```
## Example 8. RSelenium to Download F&O Bhavcopy
``` r
library(nser)
library(RSelenium)# Start a selenium server and browser
# For Google Chrome (Update Chrome to latest version)driver <- rsDriver(browser = c("chrome"), port = 3163L, chromever = "91.0.4472.101")
remDr <- driver$client# or for Firefox
driver <- rsDriver(browser = c("firefox"), port = 3799L)
# Download Equity Bhavcopy zip file
bhavfos("03012000", 2)# Close the Browser
remDr$close()```
## Example 9. NSE Treemap
``` r
library(nser)
# NIFTY 50 stocks
nsetree()# F&O stocks
nsetree("fo")
```## Example 10. Daily data to Weelkly data
```
library(nser)
data(dailydata)
daytoweek(dailydata)
```## Example 11. Daily data to Monthly data
```
library(nser)
data(dailydata)
daytomonth(dailydata)
```