Package 'nser'

Title: Bhavcopy and Live Market Data from National Stock Exchange (NSE) & Bombay Stock Exchange (BSE) India
Description: Download Current & Historical Bhavcopy. Get Live Market data from NSE India of Equities and Derivatives (F&O) segment. Data source <https://www.nseindia.com/>.
Authors: Nandan Patil [cre, aut]
Maintainer: Nandan Patil <[email protected]>
License: GPL-3
Version: 1.5.1
Built: 2024-11-13 04:28:10 UTC
Source: https://github.com/nandp1/nser

Help Index


Bhavcopy from NSE and BSE

Description

Bhavcopy from NSE and BSE

Usage

bhav(x, se = "NSE")

Arguments

x

numeric date format

se

Stock Exchange either 'NSE' or 'BSE'. Default is 'NSE'.

Details

Gets Bhavcopy from NSE and BSE for the given date.

Value

Bhavcopy for the given date.

Note

The date should be strictly numerical and mentioned in quotation mark (refer examples). 'bhav' can be used to download NSE bhavcopy from 1 Jan 2020 on wards.

Author(s)

Nandan L. Patil [email protected]

Source

<https://www.nseindia.com/all-reports>, <https://www.bseindia.com/markets/marketinfo/BhavCopy.aspx>

See Also

bhavprbhavtoday

Examples

#Download Bhavcopy from NSE
report = bhav("01072024") # Download bhavcopy for 01 July 2024

#Download bhavcopy from BSE
report = bhav("01072024", 'BSE')

Bhavcopy from NSE upto 05 July 2024

Description

Bhavcopy from NSE upto 05 July 2024

Usage

bhav1(x)

Arguments

x

numeric date format

Details

Gets Bhavcopy from NSE from 1 Jan 2016 to 05 July 2024.

Value

Bhavcopy for the given date.

Note

The date should be strictly numerical and mentioned in quotation mark (refer examples). 'bhav1' can be used to download bhavcopy from 1 Jan 2016 to 05 July 2024.

Author(s)

Nandan L. Patil [email protected]

Source

<https://www.nseindia.com/all-reports>

See Also

bhavbhavtoday

Examples

#Download Bhavcopy from NSE
report = bhav("01072021") # Download bhavcopy for 01 July 2021

Futures and Options (F&o) Bhavcopy through RSelenium

Description

Futures and Options (F&o) Bhavcopy through RSelenium

Usage

bhavfos(x, n = 0)

Arguments

x

numeric date format (ddmmyyyy)

n

time interval to delay in seconds. DEFAULT = 0

Details

Gets zip Bhavcopy from NSE for the given date.

Value

Download F&O Bhavcopy zip file of the given date.

Note

The date should be strictly of numeric and of format 'ddmmyyyy' mentioned in quotation mark. All the Bhavcopy's can be downloaded.

Author(s)

Nandan L. Patil [email protected]

Source

<https://www.nseindia.com/all-reports>

See Also

bhavprbhavtodaybhavfobhavbhavs

Examples

# Start a selenium server and browser
# For Google Chrome (Update Chrome to latest version)
library(RSelenium)
#driver = rsDriver(browser = c("chrome"), port = 3163L, chromever = "91.0.4472.101")
#remDr = driver$client

# For Firefox
#driver = rsDriver(browser = c("firefox"), port = 3799L)

# Download Equity Bhavcopy zip file
#bhavfos("03012000", 3)

# Close the Browser
#remDr$close()

Bhavcopy PR from NSE

Description

Bhavcopy PR from NSE

Usage

bhavpr(x)

Arguments

x

numeric date format

Details

Gets Bhavcopy PR from NSE for the given date.

Value

List of Bhavcopy PR for the given date.

Note

The date should be strictly numerical and mentioned in quotation mark, refer example.

Author(s)

Nandan L. Patil [email protected]

Source

<https://www.nseindia.com/all-reports>

See Also

bhavbhavtoday

Examples

# Equity Bhavcopy PR
library(nser)
report = bhavpr("01072021")

Equity Bhavcopy through RSelenium

Description

Equity Bhavcopy through RSelenium

Usage

bhavs(x, n = 0)

Arguments

x

numeric date format (ddmmyyyy)

n

time interval to delay in seconds. DEFAULT = 0

Details

Gets zip Bhavcopy from NSE for the given date.

Value

Download Equity Bhavcopy zip file of the given date.

Note

The date should be strictly numeric and of format 'ddmmyyyy' mentioned in quotation mark. All the Bhavcopy's can be downloaded.

Author(s)

Nandan L. Patil [email protected]

Source

<https://www.nseindia.com/all-reports>

See Also

bhavprbhavtodaybhavfobhavbhavfos

Examples

# Start a selenium server and browser
library(RSelenium)
# For Google Chrome (Update Chrome to latest version)
#driver = rsDriver(browser = c("chrome"), port = 3163L, chromever = "91.0.4472.101")
#remDr = driver$client

# For Firefox
#driver = rsDriver(browser = c("firefox"), port = 3799L)

# Download Equity Bhavcopy zip file
#bhavs("03012000", 3)

# Close the Browser
#remDr$close()

Get Bhavcopy for the present day from NSE and BSE

Description

Get Bhavcopy for the present day from NSE and BSE

Usage

bhavtoday(se = "NSE")

Arguments

se

Stock Exchange either 'NSE' or 'BSE'. Default is 'NSE'.

Details

Gets todays bhavcopy from NSE. The function tries to get the bhavcopy from two sources Old and New website of NSE.

Value

Todays's Bhavcopy.

Note

The date should be strictly numerical and mentioned in quotation mark.The present days Bhavcopy would usually available in the evening

Author(s)

Nandan L. Patil [email protected]

Source

<https://www.nseindia.com/all-reports>, <https://www.bseindia.com/markets/marketinfo/BhavCopy.aspx>

See Also

bhavprbhav

Examples

## Not run: 

#Todays NSE Equity Bhavcopy, the data would be available usually after 6.30 PM.
library(nser)
report = bhavtoday()

#Todays BSE Equity Bhavcopy
report = bhavtoday('BSE')

## End(Not run)

Daily data of a stock

Description

Daily data of a stock with six columns.

Usage

data(dailydata)

Format

Daily data of a stock with six column

SYMBOL

SYMBOL of the stock

OPEN

Opening price for the day

HIGH

High price for the day

LOW

Low price for the day

CLOSE

Closing price for the day

DATE

Date for the given day

Source

https://www.nseindia.com/

See Also

bhav ,bhavtoday ,nsetree

Examples

library(nser)
data(dailydata)
daytoweek(dailydata)

Convert Daily data of a stock to Monthly data

Description

Convert Daily data of a stock to Monthly data

Usage

daytomonth(x)

Arguments

x

dataframe containing stock data with columns SYMBOL, OPEN, HIGH, LOW, CLOSE & DATE.

Details

Converts the Daily data of a stock to Monthly data.

Value

OHLC data in monthly format.

Note

The dataframe should contain six columns named SYMBOL, OPEN, HIGH, LOW, CLOSE & DATE.

Author(s)

Nandan L. Patil [email protected]

See Also

bhavprbhavtodaybhavdaytoweek

Examples

data(dailydata)
daytomonth(dailydata)

Convert Daily data of a stock to Weekly data

Description

Convert Daily data of a stock to Weekly data

Usage

daytoweek(x)

Arguments

x

dataframe containing stock data with columns SYMBOL, OPEN, HIGH, LOW, CLOSE & DATE.

Details

Converts the Daily data of a stock to Weekly data.

Value

Dataframe with Weekly data.

Note

The dataframe should contain six columns named SYMBOL, OPEN, HIGH, LOW, CLOSE & DATE.

Author(s)

Nandan L. Patil [email protected]

See Also

bhavprbhavtodaybhav

Examples

library(nser)
data(dailydata)
daytoweek(dailydata)

Latest FII/DII data.

Description

Latest FII/DII data.

Usage

fdii()

Details

Get latest FII/DII data from Moneycontrol website.

Value

Dataframe containing FII/DII data.

Author(s)

Nandan L. Patil [email protected]

Source

<https://www.moneycontrol.com/stocks/marketstats/fii_dii_activity/index.php>

See Also

nseipobhavfobhavtodaynseopen

Examples

## Not run: 
# The function may fail when accessed outside from INDIA.

library(nser)
fdii()


## End(Not run)

Futures and Options Bhavcopy from NSE

Description

Futures and Options Bhavcopy from NSE

Usage

fobhav(x)

Arguments

x

numeric date format

Details

Gets Futures and Options Bhavcopy from NSE for the given date.

Value

F&O Bhavcopy for the given date.

Note

The date should be strictly numerical and mentioned in quotation mark. 'fobhav' can be used to download bhavcopy from 1 Jan 2016 onwards.

Author(s)

Nandan L. Patil [email protected]

Source

<https://www.nseindia.com/all-reports>

See Also

bhavprbhavtoday

Examples

report = fobhav("01072021") # Download F&O bhavcopy for 01 July 2021

Get F&O Bhavcopy for the present day

Description

Get F&O Bhavcopy for the present day

Usage

fobhavtoday()

Details

Gets todays Futures and Options bhavcopy from NSE.

Value

Todays's F&O Bhavcopy.

Note

The date should be strictly numerical and mentioned in quotation mark.The present days Bhavcopy would usually available in the evening.

Author(s)

Nandan L. Patil [email protected]

See Also

bhavprbhav

Examples

#Todays F&O Bhavcopy
library(nser)
try(stop(report = fobhavtoday()))

NSE Nifty Indices

Description

NSE Nifty Indices

Usage

nseindex()

Details

Live report of Nifty Indices

Value

A dataframe containing last price and per cent change of nifty indices.

Author(s)

Nandan L. Patil [email protected]

Source

<https://www1.nseindia.com/live_market/dynaContent/live_watch/live_index_watch.htm>

See Also

bhavprbhavfobhavtodaynseopennselive

Examples

## Not run: 
#Live status of Nifty Indices
library(nser)
nseindex()

## End(Not run)

Current and Upcoming IPO's on NSE.

Description

Current and Upcoming IPO's on NSE.

Usage

nseipo()

Details

List of upcoming and current IPO's on NSE gathered from Moneycontrol.

Value

A dataframe of IPO's on NSE.

Author(s)

Nandan L. Patil [email protected]

Source

<https://www.moneycontrol.com/ipo/ipo-snapshot/issues-open.html>

See Also

bhavprbhavfobhavtodaynseopen

Examples

## Not run: 
# NSE IPO's
library(nser)
nseipo()

## End(Not run)

NSE Live Market data

Description

NSE Live Market data

Usage

nselive(x = "n50")

Arguments

x

"n50" and "fo" for nifty 50 and F&O. DEFAULT value is "n50".

Details

Get live NSE market data of Nifty 50 and Futures & Options

Value

A dataframe with NSE Live market data.

Note

NSE pre-open market 09.00 hrs to 9.08 hrs (IST). Regular Trading Session 09.15 hrs to 15.30 hrs (IST)

Author(s)

Nandan L. Patil [email protected]

Source

<https://www.nseindia.com/market-data/live-market-indices>

See Also

bhavprbhavfobhavtodaynseindexnseopen

Examples

## Not run: 
# NSE Live market data for Nifty 50 stocks
library(nser)
nselive()

# Live market for F&O stocks
nselive("fo")

## End(Not run)

NSE Pre Open Market data

Description

NSE Pre Open Market data

Usage

nseopen(x = "n50")

Arguments

x

"fo" for F&O stocks, "all" for all the stocks. Default is "n50" for NIFTY 50 stocks.

Details

Get NSE Pre open market data.

Value

A dataframe with NSE Pre open market data.

Note

NSE market opening time is 9.00 AM (IST). The NSE pre market closes at 9.08 AM (IST).

Author(s)

Nandan L. Patil [email protected]

Source

<https://www1.nseindia.com/live_market/dynaContent/live_watch/pre_open_market/pre_open_market.htm>

See Also

bhavprbhavfobhavtoday

Examples

## Not run: 
# NSE Pre market open data of Nifty 50 stocks
library(nser)
nseopen("n50")

# Pre open market data of F&O stocks
nseopen("fo")

## End(Not run)

Treemap for Nifty50 and F&O Securities

Description

Treemap for Nifty50 and F&O Securities

Usage

nsetree(x = "n50")

Arguments

x

"n50" for NIFTY 50 Securities and "fo" for Futures and Options Securities.

Details

Plot treemap representing per cent change in 'NIFTY50' and 'F&O' stocks.

Value

treemap A Treemap of recent percent change in value of securities.

Author(s)

Nandan L. Patil [email protected]

Source

<https://www.nseindia.com/market-data/live-market-indices>

See Also

bhavprbhavtodaybhavfobhav

Examples

## Not run: 
# Treemap of NIFTY50 securities

library(nser)
nsetree()

# Treemap of FO securities

library(nser)
nsetree('fo')

## End(Not run)

Option Chain of NSE BANKNIFTY (current expiry date).

Description

Option Chain of NSE BANKNIFTY (current expiry date).

Usage

optbanknifty()

Details

Option chain of BANKNIFTY for the current expiry.

Value

A dataframe containing option chain of NSE BANKNIFT current expiry date.

Author(s)

Nandan L. Patil [email protected]

Source

<https://www.nseindia.com/option-chain>

See Also

optniftybhavtodaynselivensetreenseipo

Examples

## Not run:  # Example: BANKNIFTY option chain
optbanknifty()

## End(Not run)

Option Chain of NSE Nifty 50 (current expiry date).

Description

Option Chain of NSE Nifty 50 (current expiry date).

Usage

optnifty()

Details

Option chain of NIFTY 50 for the current expiry.

Value

A dataframe containing option chain of NSE Nifty 50 for current expiry date.

Author(s)

Nandan L. Patil [email protected]

Source

<https://www.nseindia.com/option-chain>

See Also

optbankniftybhavtodaynselivensetreenseipo

Examples

## Not run: # Example: NIFTY 50 option chain
optnifty()

## End(Not run)