%% NetValueDemoTemplate% by LiYang_faruto% Email:[email protected]% 2015/02/14%% A Little Clean Worktic;% clear;% clc;% close all;formatcompact;%% load DataloadFundValue_FQuant.mat;Fund=FundNetValue_FQuant(:,2);Dates=FundNetValue_FQuant(:,1);%% Cal Investment Performance Metrics[DrawDownPercent,DrawDownAbs,DDduration,DDdTe]=IPM_MaxDrawDown(Fund,1);DrawDownPercent=DrawDownPercent*100;%% Fund & MDDLen=length(Fund);scrsz=get(0,'ScreenSize');figure('Position',[scrsz(3)*1/4scrsz(4)*1/6scrsz(3)*4/5scrsz(4)]*3/4);subplot(3,1,1:2)h=plot(Fund);h.LineWidth=1.5;xlim([0,Len+1]);LabelSet(gca,Dates,[],[],1);str=['Fund Net Value'];title(str,'FontWeight','Bold','FontSize',15);tX=Len/2;tY=sum(ylim)/2;tH=text(tX,tY,'FarutoQuant');tH.HorizontalAlignment='center';tH.VerticalAlignment='middle';tH.FontSize=40;tH.Color=[0.90.90.9];[MaxV,ix]=max(Fund);tH=text(ix,MaxV,num2str(MaxV));tH.HorizontalAlignment='center';tH.VerticalAlignment='bottom';[MinV,ix]=min(Fund);tH=text(ix,MinV,num2str(MinV));tH.HorizontalAlignment='center';tH.VerticalAlignment='top';subplot(3,1,3)h=plot(DrawDownPercent);xlim([0,Len+1]);LabelSet(gca,Dates,[],[],1);str=['MaxDrawDown(%)'];ylabel(str);[MinV,ix]=min(DrawDownPercent);tH=text(ix,MinV,[num2str(MinV),'%']);tH.HorizontalAlignment='center';tH.VerticalAlignment='top';%% Investment Performance MetricsLen=length(Fund);scrsz=get(0,'ScreenSize');figure('Position',[scrsz(3)*1/4scrsz(4)*1/6scrsz(3)*4/5scrsz(4)]*3/4);subplot(3,1,1)h=plot(DrawDownPercent);h.LineWidth=1.5;xlim([0,Len+1]);LabelSet(gca,Dates,[],[],1);str=['Investment Performance Metrics\_MaxDrawDown(%)'];title(str,'FontWeight','Bold','FontSize',10);[MinV,ix]=min(DrawDownPercent);tH=text(ix,MinV,[num2str(MinV),'%']);tH.HorizontalAlignment='center';tH.VerticalAlignment='top';subplot(3,1,2)h=plot(DDduration);h.LineWidth=1.5;xlim([0,Len+1