Description Objects from the Class Slots Methods Author(s) References See Also Examples
This is a class that contains the result of a call to the function trading.simulator(). It contains information on the trading performance of a set of signals on a given set of "future" market quotes.
Objects can be created by calls of the form tradeRecord(...)
.
These objects contain information on i) the trading variables for each
day in the simulation period; ii) on the positions hold during this
period; iii) on the value used for transaction costs; iv) on the
initial capital for the simulation; v) on the function that implements
the trading policy used in the simulation; and vi) on the list of
parameters of this function.
trading
:Object of class "xts"
containing the
information on the trading activities through the testing
period. This object has one line for each trading date. For each
date it includes information on the closing price of the market
("Close"), on the order given at the end of that day ("Order"), on
the money available to the trader at the end of that day ("Money"),
on the number of stocks hold by the trader ("N.Stocks"), and on the
equity at the end of that day ("Equity").
positions
:Object of class "matrix"
containing
the positions hold by the trader during the simulation
period. This is a matrix with seven columns, with as many rows as
the number of positions hold by the trader. The columns of this
matrix contain the type of position ("pos.type"), the number of
stocks of the position ("N.stocks"), the date when the position
was opened ("Odate"), the open price ("Oprice"), the closing date
("Cdate"), the closing price ("Cprice") and the percentage return
of the position ("result").
trans.cost
:Object of class "numeric"
with the
monetary value of each transaction (market order).
init.cap
:Object of class "numeric"
with the
initial monetary value of the trader.
policy.func
:Object of class "character"
with
the name of the function that should be called at the end of each
day to decide what to do, i.e. the trading policy function. This
function is called with the vector of signals till the current
date, the market quotes till today, the current position of the
trader and the currently available money.
policy.pars
:Object of class "list"
containing
a list of extra parameters to be used when calling the trading
policy function (these depend on the function defined by the user).
signature(x = "tradeRecord", y = "ANY")
: provides
a graphical representation of the trading results.
signature(object = "tradeRecord")
: shows an
object in a proper way.
signature(object = "tradeRecord")
: provides a
summary of the trading results.
Luis Torgo ltorgo@dcc.fc.up.pt
Torgo, L. (2010) Data Mining using R: learning with case studies, CRC Press (ISBN: 9781439810187). http://www.dcc.fc.up.pt/~ltorgo/DataMiningWithR
trading.simulator
, tradingEvaluation
1 | showClass("tradeRecord")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.