Description Usage Arguments Details
1. if the last record of transactions table is not 'completing' a trade the last row of the aggregated ppl table is removed before "cbinding" 2. the first row of trx table must not contain the 'empty' ('init'/'0') data i.e. it must be removed before calling getExtStats The if the first transaction recorded in the subset of a table of transactions is exiting a position, it is counted as a trade (only 'flat-to-flat' transaction definition is supported at the moment)
1 2 | getExtStats(portfolio, symbol, ppl, trx, dateMin, dateMax, dates = NULL,
interval, ...)
|
ppl |
'position PL' data frame w/o the initialization 'record' ('row') |
trx |
'transactions' data frame w/o the initialization 'record' ('row') |
TODO: a proper table of 'trades' is needed in the portfolio itself such a table shall contain trades as defined in the argument to tradeStats 3 methods to define a trade: "flat-to-flat" "position-reducing" "logically-tagged-open-closed" (algorithm specific) (source: http://quant.stackexchange.com/questions/9213/how-do-order-management-matching-systems-match-allocate-orders-and-filled-price) — Additional reference: https://r-forge.r-project.org/scm/viewvc.php/*checkout*/pkg/quantstrat/sandbox/backtest_musings/strat_dev_process.pdf?root=blotter methods to calculate round-trip trades: 1. FIFO 2. tax lots 3. flat to flat 4. flat to reduced 5. increased to reduced (a superior alternative to FIFO) & avg.cost —
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.