Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Code for back testing data through CSV

Hey ,
Explanation of my algorithm.
The algorithm is basically a test to Overreaction hypothesis. It calculates returns as ((high-low)/low)*100
It then takes the value of returns for past 200 days and calculates its average and standard deviation.
If the previous day returns are more than average returns + standard deviation (that means the price has overreacted) it will buy or sell in the opposite direction of overreaction.

But since Quantopian only provides US stock market data I am unable to test the hypothesis on Indian and Chinese securities. Therefore I need to feed daily data through a csv file. Earlier I am using minutely back tests for US stocks but for Indian and Chinese stocks I will use daily mode(rather than minute mode because I only have daily data) . So if someone can change the code accordingly I will be grateful.

2 responses

I have read the csv fetcher documentation but unable to write a code since I am a beginner with python.

Jessica Stauth shows how to use fetcher to get data for Chinese securities in this post, but as she mentions, you won't be able to run a backtest on those securities.