

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object TradingStrategies.VectorStrategy
A trading strategy investing in a Basket
(vector of baskets).
Provides methods to compute the following statistics associated with the
trading strategy:
conveniently assembled into a random vector for easy analysis of the mean, the variance and the empirical distribution (histogram). All quantities except the number of trades are discounted amounts computed at the time horizon T.
It is assumed that the entire strategy is financed through borrowings at the riskfree rate. Thus current (disounted) borrowings are equal to the (discounted) amount invested at all times.
Transaction costs are allowed and have a fixed and a proportional component. The proportional transaction costs come from bidask spread etc., 0.1 is a very conservative number. Transaction costs are assumed to grow at the riskfree rate (to remain constant in todays dollars).Note that the computation of the portfolio weight (the number of shares of the basket held at any given time) might involve conditional expectations which necessitate branch simulations of the price path of the basket.
Each branch simulation destroys an existing price path of the basket from the time of branching forward. Consequently we cannot simply compute a full path of the basket and then move the trading strategy along this path. Instead we evolve the path simultaneous with the trading strategy in single time steps.
These time steps are driven by new Zincrements (see the class
Market.basket
) and consequently produce independent basket price
paths (rather than independent groups of dependent paths).
Constructor Summary  
VectorStrategy(double fixed_trc,
double prop_trc,
Basket basket,
Trigger tradeTrigger)
Constructor, full initialization. 

VectorStrategy(double fixed_trc,
double prop_trc,
Basket basket,
Trigger tradeTrigger,
int currentWeightNotInitialized)
Constructor, initializes all fields except currentWeight 
Method Summary  
RandomVector 
discountedGainsAndNumberOfTrades()
The newDiscountedGainsAndNumberOfTrades() as a random
vector. 
RandomVariable 
discountedGainsFromTrading()
The terminal discounted gains from trading as a random variable. 
double[] 
get_B()
Price path of riskfree bond. 
Basket 
get_basket()
The basket invested in. 
ColtVector 
get_currentWeight()
Current number of shares of the basket held. 
double 
get_dt()
Size of time step. 
double 
get_fixed_trc()
Fixed transaction cost per trade. 
int 
get_nTrades()
Current number of trades. 
double 
get_prop_trc()
Proportional transaction cost per trade. 
ColtVector[] 
get_S()
Discounted basket price path. 
int 
get_T()
Number of time steps to horizon. 
Trigger 
get_tradeTrigger()
Trigger triggering the trades. 
double 
initialInvestment()
Amount invested at time t=0. 
double[] 
newDiscountedGainsAndNumberOfTrades()
The discounted gains from trading (return_value[0]) and number of trades (return_value[1]) at the time horizon T computed from a new and independent basket price path. 
double 
newDiscountedGainsFromTrading()
The discounted gains from trading at the time horizon T computed from a new and independent basket price path. 
double 
newReturnFromTrading()
The return from trading at the time horizon T computed from a new and independent basket price path. 
double[] 
newTradeStatistics()
Computes a vector x of statistics associated with the trading strategy: 
RandomVariable 
returnsFromTrading()
The terminal returns from trading as a random variable. 
abstract void 
setNewWeight(int t)
Write the vector of portfolio weights at time t into the field newWeight . 
RandomVector 
tradeStatistics()
The newTradeStatistics() as a random vector X: 
Methods inherited from class java.lang.Object 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Constructor Detail 
public VectorStrategy(double fixed_trc, double prop_trc, Basket basket, Trigger tradeTrigger)
Constructor, full initialization.
fixed_trc
 fixed transaction costs.prop_trc
 proportional transaction costs.basket
 the basket invested in.tradeTrigger
 triggers the trades.public VectorStrategy(double fixed_trc, double prop_trc, Basket basket, Trigger tradeTrigger, int currentWeightNotInitialized)
Constructor, initializes all fields except
currentWeight
Needed because the call currentWeight=newWeight(0);
might make use of fields of a subclass which are not initialized
yet. In this case this call is then made in the subclass constructor
after the needed fields have been initialized. The variable
currentWeightNotInitialized
is a dummy parameter used
only to differentiate the parameter signatures of the two constructors,
assign any value.
fixed_trc
 fixed transaction costs.prop_trc
 proportional transaction costs.basket
 the basket invested in.tradeTrigger
 triggers the trades.currentWeightNotInitialized
 dummy parameter, assign any value.Method Detail 
public int get_T()
public double get_dt()
public ColtVector[] get_S()
public double[] get_B()
public double get_fixed_trc()
public double get_prop_trc()
public Basket get_basket()
public Trigger get_tradeTrigger()
public ColtVector get_currentWeight()
public int get_nTrades()
public abstract void setNewWeight(int t)
Write the vector of portfolio weights at time t
into the field newWeight
. Do this whenever a trade takes
place, that is, the portfolio is rebalanced. The field
currentWeight
contains the vector of current portfolio
weights.
t
 current time.public double initialInvestment()
public double newDiscountedGainsFromTrading()
The discounted gains from trading at the time horizon T computed from a new and independent basket price path.
The variable currentWeight
is updated without being used
explicitly. This is done to allow the definition of strategies where the
next weight is defined with reference to the last weight.
public RandomVariable discountedGainsFromTrading()
The terminal discounted gains from trading as a random variable.
Warning: The time parameter t is ignored, that is, there is no possibility to condition on information available at time t. Useful only for computations at time t=0.It is slightly more complicated to implement this ability since the computation of the portfolio weights destroys an existing path so that the current path would have to be saved up to time t. We don't need the ability to condition and so it is not implemented.
public double[] newDiscountedGainsAndNumberOfTrades()
The discounted gains from trading (return_value[0]) and number of trades (return_value[1]) at the time horizon T computed from a new and independent basket price path.
The variable currentWeight
is updated without being used
explicitly. This is done to allow the definition of strategies where the
next weight is defined with reference to the last weight.
public RandomVector discountedGainsAndNumberOfTrades()
The newDiscountedGainsAndNumberOfTrades()
as a random
vector.
It is slightly more complicated to implement this ability since the computation of the portfolio weights destroys an existing path so that the current path would have to be saved up to time t. We don't need the ability to condition and so it is not implemented.
public double newReturnFromTrading()
The return from trading at the time horizon T computed from a new and independent basket price path.
Return: The return of a trading stratregy is computed as a return on the maximum invested during the life of the strategy: the gains from trading are viewed as interest on the maximum amount sunk into the strategy during its lifetime.
The variable currentWeight
is updated without being used
explicitly. This is done to allow the definition of strategies where the
next weight is defined with reference to the last weight.
public RandomVariable returnsFromTrading()
The terminal returns from trading as a random variable. See information.
public double[] newTradeStatistics()
Computes a vector x of statistics associated with the trading strategy:
during the life of the strategy. All quantities are discounted and derived from a new and independent path of the basket computed in this method.
Note: the variable currentWeight
must be kept up to date
at all times since the method newWeight(int t)
might make
use of it.
public RandomVector tradeStatistics()
The newTradeStatistics()
as a random vector X:
during the life of the strategy. Note that the time parameter t is ignored, that is, no ability to condition on information available at time t is implemented. Useful only for computations at time t=0.


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 