Hi, I’m a college student who wants to learn quantitative trading. I read some strategies in the Quantopian forum and combine them together with my thinking to make my first algorithm. The result seems really good. However, my perspectives may still be naïve as a new learner. So please point it out if you find any problems with my algorithm and give me some advice if you can.
The logic is really simple. First find some good stock with good long-term debt-equity ratio, because this fundamental data indicates stock returns better compared to other fundamental data after I do some experiment. After this filter, find high momentum stocks among these stocks and put it into the pipeline.
However, even the best stocks also decline a lot in bad times. Therefore, I need some signals to indicate the whole market. Theses indicators include 60 days return XLI, DBB, BIL, and UUP. If they imply a good market, I will buy top stocks from the pipeline. Otherwise, I will buy bonds and wait for 15 days before entering the market again.
These indicators are not perfect. When I zoom in to the crisis in 2008 and 2020, I find they are perfect when indicating the crisis, but they are bad at indicating the recovery. Stocks rise very fast in recovery and I want to gain these profits. Therefore, I add a condition myself that if (SPY price now) / (SPY price 30 days mean) > 1.03, I will cancel the warning and start to but stocks. The SPY price rises fast if this condition is true, which is a signal of recovering. This number 1.03 has no solid reason, but I try different numbers and find 1.03 works well during recovery.
Here are the links where I learned some these ideas:
https://www.quantopian.com/posts/new-strategy-in-and-out
https://www.quantopian.com/posts/new-strategy-presenting-the-quality-companies-in-an-uptrend-model-1
Once again, please give me some advice is you can!