File Exchange

image thumbnail

Walk-Forward Analysis (WFA) - Files for WFA webinar

version 1.0.0.2 (18.5 KB) by Kawee Numpacharoen
The files are designed for walk-forward analysis of pair trading strategy using Bollinger Band

16 Downloads

Updated 01 Feb 2018

View License

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.

Comments and Ratings (12)

Grateful for this!

Hi Babak,

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.

Best,
Kawee

babak znl

babak znl

hi, why do you set cost = TNew.execPrice in updatePort function?
i think it must be cost = TNew.cost

Brian Greer

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.

Cs0n

Did anyone code a workaround for the yahoo problem in getPrices.m of this demo?

Alejandro

Here you can learn more about another Walk-Forward Analysis (WFA) solution: http://wfatoolbox.com

Updates

1.0.0.2

Change data source from Yahoo! Finance to Google Finance.
Remove one pair of stocks because prices are not completely available in the new data source.

1.0.0.1

Updated license

1.0.0.1

Updated license

1.0.0.0

Add copyright statement

MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux