maxProbProfit: Maximize the Probability of Profit

Description Usage Arguments Value Author(s) References Examples

View source: R/maxProbProfit.R

Description

Maximize the Probability of Profit

Usage

1
2
  maxProbProfit(lsp, target, horizon, constrFun=NULL, constrVal=NULL,
    zmin=-1, margin=NULL, equity=NULL, upper, lower, ...)

Arguments

lsp

A lsp object.

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 zmin is a vector, the first (second) element is used when portfolio equity is below (above) target. zmin must be <= -1 and >= 0.

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 constrFun.

Value

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.

Author(s)

Joshua Ulrich

References

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.

Examples

 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)

LSPM documentation built on May 2, 2019, 5:54 p.m.