| GetCPPIPath(dates,Prices,Multiplier, Floor,SmoothingFactor,TransactionThreshold,TransactionCost)
|
function [CPPI_Path , TradedAmount, PercentageOfTradingDates,DynFloor,Exposure, ExpPercentage] = GetCPPIPath(dates,Prices,Multiplier, Floor,SmoothingFactor,TransactionThreshold,TransactionCost)
%% Backtest a CPPI product
% CPPI stands for Constant Proportion Portfolio insurance. It is one of
% the simplest hedging strategy.
% this porduct is portfolio with 2 assets : one risk free (tipically, a
% bond) . The other asset is a risky one, but in practice, only assets with
% low volatilities (ie, funds) are used. the typical asset is a fund of
% fund.
%
% The basis of this strategy is to warranty an amount at Expiry, but to
% take advantage of the potential increase of the risky asset. so CPPI
% provides downside protection.
%
% 3 parameters therefore drive the mechanism :
% - The warratnied amount (Floor). The less you warranty, the more you can potentially take
% advantage of the risky asset
% - the multiplicator : this is the degree of exposure of the bank
%
%
% - Transaction cost : a percentage. If 0.02, then cost to trade 100 is 2
% hedging is less than this value
% To avoid too much trading costs, 3 other parameters are set :
% - A treshold level (for example 0.05) -> we do not hedge if the percentage of
% hedging is less than this value
% - A smothing factor After computation opf the volume of asset to hedge,
% we just trade but we adjust the volume using this smothing factor
%% Clear all the data
%% Set the warrantied amount and fundamental parameters of the CPPI
% Floor = 96;
% MaxMultiplier = 10;
% NumberOfMultiplierStep = 100;
% SmoothingFactor = 0.8;
% TransactionThreshold = 0.02;
% TransactionCost = 0.005;
% HedgingFrequencyInDays = 1;
%% Retrieve the data used for the backtesting
% We use the Eurstoxx50 in this case
StartDate = min(dates);
EndDate = max(dates);
%[Prices,dates,StartDate,EndDate] = SimpleXlsReader('1998_BackTest.xls');
%Prices,dates,StartDate,EndDate] = SimpleXlsReader('EuroStoxx3years.xls');
Returns = Prices(2 :end)./ Prices (1:end - 1) - 1;
%% Set the number of Multiplier to generate the 3D surface
%Here we just set the number of multiplier we want to evaluate.
%% Get the risky asset path (to compare with the CPPI evolution)
NormalizedPrices = ret2price(Returns,100, 1);
TimeLength = size(NormalizedPrices,1);
%% Compute the CPPI value for each multiplier
[CPPI_Path , TradedAmount, PercentageOfTradingDates,DynFloor,Exposure, ExpPercentage]= CPPI_PayOff_From_Returns_2(100, Floor,Multiplier,Returns, 0.03,SmoothingFactor, TransactionThreshold, TransactionCost, 1);
|
|