Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
try to simulate my strategy in notebook

I try to use the history data to determine my empirical trading threshold. ( I just change t1 and t2 manually, then determine the approximately optimal thresholds by comparing outcomes of sharpe ratio.)
I use the same time period(04-16-2017~01-01-2018), and the same threshold in my notebook and my algorithm. However, they give me different outcomes(e.g. different sharpe ratio).
I think there maybe something wrong in the "if-else statement".