I am working on an automatized quantitative strategy that use cointegration in Forex. I am backtesting this strategy in Python.
Please see below the python file: https://drive.google.com/file/d/0B1AEYFPAAAE6eW5XeHlkTXprVUU/view?usp=sharing
See below the data that I used to backtest: https://drive.google.com/file/d/0B1AEYFPAAAE6amx0RWI1MGh3SW8/view?usp=sharing
My Algorithm is:
- Read File
- Transform the data with the log return
- Treat Outliers
- Realize the linear regression
- Test for cointegration with ADF test
- If the spread is stationary then apply the best ARMA model
- Forecast and using beta calculation to control the risk
Could you please help to understand how can I improve this algo?