-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.Rmd
167 lines (122 loc) · 3.5 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
<!-- badges: start -->
[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/nser)](https://cran.r-project.org/package=nser)
[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable-1)
![Downloads](http://cranlogs.r-pkg.org/badges/nser)
[![](https://cranlogs.r-pkg.org/badges/grand-total/nser)](https://cran.r-project.org/package=nser)
<!-- badges: end -->
# 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)
```