extractTxns: Extract transactions from a portfolio

View source: R/extractTests.R

extractTxnsR Documentation

Extract transactions from a portfolio

Description

This function reverse-engineers addTxn calls for all the transactions in Portfolio. This is the fundamental task required to create a reproducible example, as it would replicate the state of the $txn slot in the portfolio after each addTxn call.

Usage

extractTxns(Portfolio)

Arguments

Portfolio

string identifying the portfolio to extract from

Details

While market data, expected results, portfolio and account setup, etc, are also required, these can usually be deduced or equivalent formulations can be found.

For transactions, only the exact addTxn parameters will recreate the $txn slot. This function creates that reproducibility, since the result (stored in 'x') can be used to regenerate transactions with eval(parse(text=x)).

Value

String vector of addTxn calls that would replicate the given portfolio.

Author(s)

Brian G. Peterson, Josh Ulrich


braverock/blotter documentation built on Feb. 13, 2023, 1 p.m.