Description Usage Arguments Value Author(s) References Examples
View source: R/maxProbProfit.R
Maximize the Probability of Profit
1 2 |
lsp |
A |
target |
The profit target. |
horizon |
The number of holding periods. |
constrFun |
A string naming the constraint function. |
constrVal |
The value of the constraint function that should not be exceeded. |
zmin |
A value or vector of minimum values for the two
martingale exponents. If |
margin |
A vector of inital margin values for each event series. |
equity |
Current account equity. |
upper |
Upper f-value bounds (recycled, if necessary). |
lower |
Lower f-value bounds (recycled, if necessary). |
... |
Parameters to be passed to |
f |
Initial f values. |
z |
Martingale z values. The first (second) exponent is used when portfolio equity is below (above) the target value. |
profitProb |
Maximum probability of profit. |
Joshua Ulrich
Vince, Ralph (2007) The Handbook of Portfolio Mathematics.
New York: John Wiley & Sons, Inc.
Vince, Ralph (2009) The Leverage Space Trading Model.
New York: John Wiley & Sons, Inc.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | ## Not run:
data(port)
# DEoptim parameters (see ?deoptim)
DEctrl <- list(itermax=11, trace=1)
# Unconstrained maximum probability of profit
res <- maxProbProfit(port, 1e-6, 4, control=DEctrl)
# Margin-constrained maximum probability of profit
res <- maxProbProfit(port, 1e-6, 4, control=DEctrl,
margin=-port$maxLoss*5, equity=1e6)
# Initial population
ipop <- cbind(runif(50,0,0.01),runif(50,0,0.01),runif(50,0,0.01),
runif(50,-1,-0.8),runif(50,-1,-0.8))
# DEoptim parameters (see ?deoptim)
DEctrl <- list(itermax=11, trace=1, initial=ipop)
# Drawdown-constrained maximum probability of profit
res <- maxProbProfit(port, 1e-6, 4, probDrawdown, 0.1,
DD=0.2, calc.max=4, control=DEctrl)
# Create snow socket cluster for two cores
library(snow)
clust <- makeSOCKcluster(2)
# Drawdown-constrained maximum probability of profit using two cores
res <- maxProbProfit(port, 1e-6, 12, probDrawdown, 0.1,
DD=0.2, calc.max=4, snow=clust, control=DEctrl)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.