The files are designed for walk-forward analysis of pair trading strategy using Bollinger Band as entry and exit rules. In this example, you will see 5 pair of stocks tested over the period of 3 years. Performance analytic part includes profit/loss, Sharpe ratio, and maximum drawdown. I really hope that you will find this file as a starting point for backtesting your investment ideas. Definitely, you need to customize the file if you would like to add new rules, trading strategies, or market data. I would also recommend to watch the webinar on this topic.
Grateful for this!
and modifying code in getPrices.m
The cost in updatePort function is the cost of buying or short-selling the asset. It might be a little bit confusing with transaction cost. Sorry about that.
hi, why do you set cost = TNew.execPrice in updatePort function?
i think it must be cost = TNew.cost
Sorry for the inconvenience, I am working on fixing all Yahoo-related files. This one is on my radar too. Unfortunately, I haven't had a chance to work on this yet. I would suggest to manually download the price from Yahoo in csv format as a quick fix.
Did anyone code a workaround for the yahoo problem in getPrices.m of this demo?
Change data source from Yahoo! Finance to Google Finance.
Add copyright statement
Inspired by: Download Daily Data from Google and Yahoo! Finance