I have taken a stab at implementing the Three Arrows Algorithm as defined in Phil Town's "Rule #1", a terrific investment book.
I was interested in doing some back testing to test this strategy. The results are not overwhelming. I would appreciate comment/collaboration.
Three Arrow Algorithm using:
Momentum Strategy as defined by:
Momentum when the previous close crosses the 10 day Moving Average
MACD is based on Rule#1 investing settings MACD(8,17,9)
and Stochastic based on Rule#1 settings and ThinkOrSwim default STO(14,5,0)
This implementation uses a schedule_function that triggers everyday calculates Momentum,
MACD and Stochastic. It then determines if these indicators (arrows) are 'green' to
signal a buy order.
When all 3 arrows are green buy.
When all 3 arrows are red sell.
Three arrows briefly explained: https://www.youtube.com/watch?v=SlyB5ST9K-Y
This code appears to work though not thoroughly tested, could be off for example by a day.
Perhaps something is wrong in my interpretation or implementation because returns
are not great. Or perhaps the algorithm isn't great. This approach seems to favor a bull market.
I also attempted to short the SPY with SH when indications are for a downward motion.
I commented it out as it didn't seem to work.