Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
How to get right backtest result for EWA/EWC pair tading?

I use "Lecture 45 Example: Basic Pairs Trading Algorithm"'s sample code.
But How to modify the code to achieve high return backtest result like https://www.quantopian.com/posts/ernie-chans-ewa-slash-ewc-pair-trade-with-kalman-filter
I attach my code.
Hope someone can help me modify the sample code.

Thank you very much.