A little while ago, I shared John Ehlers' MAMA and FRAMA indicators.

I decided to play a little with it, and show you the possibilities when you account for neutral fluctuations in the market.

So I present you the MAMA and FRAMA indicators, applied to AAPL over the period 2005-2015. Clearly, if you trade aggressively with all your funds on the very short term, your equity will increase the most. However, such strategies are not always replicable in real-life due to transaction costs and slippage/illiquidity issues. So just for the purpose of motivation/entertainment, here is an algorithm that turns 10k initial capital into more than 1 million in the course of 10 years. So really, this is a little (overexaggerated) demonstration to show you that you can improve your strategy if you take the cyclical behaviour of the markets into account. In order to view the resulting graph, clone the algorithm and run the backtest.

The number of trades is too high to generate a summary of the backtest, so you would need to perform backtests on individual years to judge its power statistically. In a more serious manner, if you plan on using (part) of this strategy, you should adjust the algorithm to trade less frequently. One simple way of doing so is changing the consolidation period. Right now, this is:

int _consolidated_minutes = 10

You can change this to a larger number of minutes, for example, 60 minutes, to decrease the trading frequency.

In any case, I hope you enjoy this little example.

Keep dreaming and relish your coffee ;)