nepse_floor: Nepal Stock Exchange Floor Sheet

Description Usage Arguments Details Value Author(s) References Examples

View source: R/nepse_floor.R

Description

nepse_floor downloads floor sheet from Nepal Stock Exchange.

Usage

1
nepse_floor(symbol = NULL,from = NULL,to = NULL)

Arguments

symbol

a character string naming the symbol of stock to be loaded

from

begin date expressed in ISO CCYY-MM-DD format (e.g.,"2015-07-08"). The from must not be less than "2014-07-13"

to

end date expressed in ISO CCYY-MM-DD format (e.g., "2015-07-09"). The to must not be less than from

Details

The nepse_floor downloads floor sheet for a given stock symbol and given begin and end dates from Nepal Stock Exchange . The nepse_floor will first check whether the entered symbol is the valid stock symbol by looking through all stocks symbols listed in NEPSE. The error with message are issued for an invalid stock symbol but valid dates. For a valid stock symbol and an invalid begin date or end date, the nepse_floor will return an error along with message. For a valid stock symbol and valid begin date and end date, the end date must be greater than or equal to the begin date, else the nepse_floor will return an error along with message. If the begin date is in valid format, it must not be less than "2014-07-13".

Value

nepse_floor will return the object of class dataframe with 8 variables: floor_date, stock_symbol, contract_no, buyer_broker, seller_broker, quantity, rate, and amount.

Author(s)

Nayan Krishna Joshi

References

http://www.nepalstock.com.np/

Examples

 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
## Not run: 
# floor sheet for an invalid stock symbol and valid begin date and end date;
# issues an error with message nepse_floor('JOSHI','2015-07-08','2015-07-09')

# floor sheet for a valid stock symbol and an invalid begin date or end date;
# issues an error with message nepse_floor('HBL','2015-07','2015-07-09')
# nepse_floor('HBL','2015-07-09','2015-07')
# nepse_floor('HBL','2015-07','2015-07')

# floor sheet for a valid stock symbol and valid begin date and end date but
# begin date is greater than end date; issues an error with message
# nepse_floor('HBL','2015-07-09','2015-07-08')

# floor sheet for a valid stock symbol and valid begin date and end date and
# begin date is less than or equal to end date; returns a dataframe with non-NA
# values
nepse_floor("HBL", "2015-07-08", "2015-07-08")
nepse_floor("HBL", "2015-07-08", "2015-07-09")

# compute average stock price, total number of transactions, total quantity of
# shares, and total amount of shares conducted by buyer broker 36 during
# March-June 2015 for 'HBL' stock
require(data.table)
dt_hbl <- as.data.table(nepse_floor("HBL", "2015-03-01", "2015-06-30"))
dt_hbl[
  buyer_broker == 36, .(avg_rate = mean(rate), transaction_no = .N,
                        quantity = sum(quantity), amount = sum(amount))]

## End(Not run)

nayanj/NPdata documentation built on May 23, 2019, 12:24 p.m.