Backtesting - 2-week performance as buy/sell signal?

Hello together,
I'm just learning Matlab and I'm trying to backtest an asset allocation strategie, which I tested on Excel earlier with Matlab. There is a moving average crossing signal, which I can implement easily with Matlab, but I struggle with my second signal: When the 2 week performance of my strategy is negative, I take my money out of stocks and allocate it into bonds and I want to switch back after the 2 week performance is positiva again (the performance of the actual only bonds portfolio). My problem is: how to implement a signal-vector which relies on information that isn't known when the algorithm starts but it becomes clear over time? It sounds like an easy job for a for-loop but is there anything which fits to vector/matrix-thinking?
Thanks in advance for your help!
Julian

Answers (0)

Categories

Find more on Portfolio Optimization and Asset Allocation in Help Center and File Exchange

Asked:

on 8 May 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!