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.

ACTA WASAENSIA 175228229 end % end of inner loop over micro time steps230231 % Upadate history of state variables at integer time steps232 phist(t) = p; %(T*1) trading price history233 xhist(t) = x; %(T*1) opinion index history234 zhist(t) = z; %(T*1) chartist index history235236 % Upate history of traders’ holdings and cash237 hchist(t) = chold; %(T*1) chartist holdings history238 hfhist(t) = fhold; %(T*1) fundamentalist holdings history239 cchist(t) = ccash; %(T*1) chartist cash history240 cfhist(t) = fcash; %(T*1) fundamentalist cash history241242243 end % end of outer loop over integer time steps244245246 % Claculate logreturns247248 lnp = log([pf; phist]); %((T+1)*1) vector of logarithmic prices249 rhist = lnp(2:T+1)-lnp(1:T); %(T*1) vector of logreturns250251252 % Calculate history of traders wealth253254 cwealth = hchist.*phist + cchist; %(T*1) chartist wealth255 fwealth = hfhist.*phist + cfhist; %(T*1) fundamentalist wealth256257258 % Plot history of Lux’ state variables259260 figure;261 subplot(4,1,1), plot(phist), title(’<strong>Trading</strong> Price’);262 subplot(4,1,2), plot(rhist), title(’Logreturns’);263 subplot(4,1,3), plot(zhist); title(’Chartist Index’);264 subplot(4,1,4), plot(xhist); title(’Opinion Index’);265266267 % Plot history of traders holdings and wealth268269 figure;270 subplot(2,1,1), plot([hchist,hfhist]), title(’Traders holdings’);271 subplot(2,1,2), plot([cwealth,fwealth]), title(’Traders wealth’);272273274 % Plot history of marketmaker holdings and wealth

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

Saved successfully!

Ooh no, something went wrong!