trades: Trades in a portfolio

Description Usage Arguments Details Value Note Author(s)

View source: R/trades.R

Description

A trade is two transactions a buy & sell transaction.

checks if given object is of trades class/not

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
trades(n = 1)

is.trades(t)

add.trades.position(pf = "default", pos)

get.trades(pf = "default")

## S3 method for class 'trades'
as.xts(t)

Arguments

n

- no. of rows

t

- trades

pf

- portfolio name. default is "default"

pos

- position to be added

pf

- default "default"

Details

trades - Returns the empty trades data frame with given 'n' objects

add.trades.position - Function to add given position to trades table in a given portfolio

get.trades - gets the trades from a default portfolio

as.xts.trades - Convert the trades from dataframe to xts. Since xts is a strict matrix, all string columns are removed. Index of the returned xts object is open date on which trade is initially opened.

Value

blank trades dataframe

recently added trade

returns the trades/trxns data frame

returns the trades/trxns data frame

Note

This will create a trade object

Author(s)

Siva Sunku


sivasunku/rulesNtrades documentation built on May 29, 2019, 11 p.m.