13.07.2015 Views

BERND PAPE Asset Allocation, Multivariate Position Based Trading ...

BERND PAPE Asset Allocation, Multivariate Position Based Trading ...

BERND PAPE Asset Allocation, Multivariate Position Based Trading ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

174 ACTA WASAENSIA181 nmout = max([nmout-ones(1,2);zeros(1,2)]);182 end183 while nf-sum(nfout) 1 %if more chartists than allowed197 np = fix(np/zrel); %reduce number of optimists198 nm = fix(nm/zrel); %reduce number of pessimists199 nc = np + nm; %update number of chartists200 nf = N - nf; %update number of fundamentalists201 end202203 % Calculation of excess demand (Lux p.684)204 EDc = (np-nm)*tc; %excess demand by chartists205 EDf = nf*tf*(pf-p); %excess demand by fundamentalists206 ED = EDc + EDf; %overall excess demand207208 % Calculation of new aggregate holdings209 chold = chold + EDc; %new aggregate chartist holdings210 fhold = fhold + EDf; %new aggregate fundamentalist holdings211212 % Update of the trading price p213 ppadj = beta*(ED+sigma*randn)*100/steps;%price adjust. probab.214 p=p+sign(ppadj)*(abs(ppadj)>rand)/100; %adjustment unit 1 cent215216 % Update of aggregate traders cash217 ccash = ccash - EDc*p; %new chartists aggregate chash218 fcash = fcash - EDf*p; %new fundamentalists aggr. cash219220 % Update of pdot and precent221 pdot = steps*(p-precent(1))/plag; %=dp/dt, dt=plag/steps222 precent(1:plag-1)=precent(2:plag); %move recent price history223 precent(plag) = p; %insert current price224225 % Update of the remaning state variables x and z226 x = (np-nm)/nc; %opinion index227 z = nc/N; %chartist index

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!