Back

Daydreaming: from 10k to 1 million (in 10 years)

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 ;)
Update Backtest






The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.



Great discussion! Thanks very much for taking the time to write that. It is VERY impressive to have pulled in 11,000% total return as opposed to 840%. And with such low deviation on top of that.

Does John Ehler discuss any techniques for calibrating the algorithm to the underlying asset? In particular, which parameters need to be calibrated?

Thanks again, and I apologize if I'm pestering you with questions. This is fascinating stuff.

0

@Stephen I've also answered your other question through the new message feature. I think you haven't noticed my reply yet, so just letting you know ;)

3

I can't upvote you enough. Thanks for answering my questions, JP :-)

0

The parameters that need to be calibrated are the _consolidated_minutes (how often you want to trade), the MAMA_FastLimit (fast moving average) and MAMA_SlowLimit (slow moving average). These moving averages are based on cycles.

One way of calibrating them is by eye:

- Take a small backtesting period
- Backtest the algorithm and click on the "MAMA" chart when done
- Zoom in to individual days and look how the moving averages fit the data
- Adjust until satisfactory

You can also take a look at my other post, in which I give a demonstration of how you can detect cycles in the price series using another of Ehlers' methods.

Good luck :)

1

Unfortunately, Ehler's moving averages though highly effective are prone to being confused.

Following Adaptive Moving Average = FAMA
MESA Adaptive moving average = MAMA
Fractal Adaptive Moving Average = FRAMA

The algorithm drawn from this paper is the MAMAFAMA.

I recently implemented the FRAMA indicator for integration into the codebase. I'm not sure how this feeds through to QC, but I guess it will be available some time or another. Is there any desire from anyone to have the MAMAFAMA algorithm pre-packaged in the same way?

0

@James Smith; Github merges are available on master within 10 minutes :) Your code is in the current code base.

0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Update Backtest





0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed