The following is a paper trading result on the historical data of SPY using simple strategy. Since the trade is based on entirely random decision, the performance of the portfolio gives a low end benchmark. It is implemented by Matlab.

Given initial capital at starting date, we follow the strategy of this below. In the morning of each Monday, we do following transactions: Toss a coin. If the outcome is face-up, then half of the total wealth will be invested to risky asset. Otherwise, we clear all risky position. Following the above strategy on the period (29-Jan-1993 to 21-Jun-2013), the annualized return rate is approximately 0.00641.

The implementation is completed by Matlab programing by semi-automatically. First, using the Datafeed toolbox, download SPY historical price from Yahoo Finance server. The downloaded data is saved to “spy130622.mat” file.

(Download) Then, one can run this Matlab code “trade1.m”. ( Download )

### Like this:

Like Loading...

If you are interested in a more advanced backtesting example, you can check out this strategy on the Matlab File exchange

http://www.mathworks.com/matlabcentral/fileexchange/41540-pairs-trading-strategy/content/html/DemoMatlabPairsTrading.html