ret_type: Create stock returns for different durations.

Description Usage Arguments Examples

Description

This function takes a data frame of stock prices and a date variable created by get_close and creates a new data frame with returns for different durations. The default options are daily, weekly, monthly, and total. By specifying a number for per.len, the returns will be for a period of that many days.

Usage

1
ret_type(df, per.len, per.st = 1, ann = FALSE, quietly = TRUE)

Arguments

df

data frame

per.len

character or number. The length of the period. E.g. weekly, monthly, daily, total

per.st

the start of the period. Default to 1. For weekdays, 1 corresponds to Sunday.

ann

If TRUE, the returns be annualized. Default to FALSE

quietly

TRUE, If FALSE, then it will print the period length

Examples

1

SmarshMELLOW/financeSMM documentation built on May 16, 2019, 6:41 p.m.