Corrected Moving AverageThis moving average was originally developed by professor Andreas Uhl in 2005 (The paper in German: www.buero-uhl.de). Here is the guy himself: wavelab.at
The strength of the CMA is that the current value of the time series must exceed the current volatility-dependent threshold, so that the filter increases or falls, avoiding false signals in weak phases.
The straight line of CMA can be used for a ranging market identification
CMA
Uhl MA System - Strategy AnalysisThe Uhl MA crossover system was specifically designed to provide an adaptive MA crossover system that didn't committed the same errors of more classical MA systems. This crossover system is based on a fast and a slow moving average, with the slow moving average being the corrected moving average (CMA) originally proposed by Andreas Uhl, and the fast moving average being the corrected trend step (CTS) which is also based on the corrected moving average design.
For more information see :
In this post, the performances of this system are analyzed on various markets.
Setup And Rules
The analysis is solely based on the indicator signals, therefore no spread is applied. Constant position sizing is used. The strategy will be backtested on the 15 minute time-frame. The mult setting is discarded, the default setting used for length is 100.
Here are the rules of our strategy :
long: CTS crossover CMA
short: CTS crossunder CMA
Results And Data
EURUSD:
Net Profit: $ 0.08
Total number of trades: 99
Profitability: 35.35 %
Profit Factor: 1.834
Max Drawdown: $ 0.01
EURUSD behaved pretty well, and was most of time showing long term trends without exhibiting particularly tricky structures, the moving averages still did cross during ranging phases, since march 9 we can see a downtrend with more pronounced cyclical variations (retracements) that could potentially lead to loosing trades.
BTCUSD:
Net Profit: $ 4371.57
Total number of trades: 94
Profitability: 32.98 %
Profit Factor: 1.749
Max Drawdown: $ 1409.96
The strategy didn't started well, producing its largest drawdown after only a few trades, the strategy still managed to recover. BTCUSD exhibited a strong downtrend, the strategy profited from that to recover, signals still occurred on ranging phases, and where mostly caused by a short term volatile move, unfortunately the CMA can converge toward ranging/flat price zones where false signals might occur at higher frequency.
AMD:
Net Profit: $ 16.09
Total number of trades: 95
Profitability: 29.47 %
Profit Factor: 1.288
Max Drawdown: $ 20.11
On AMD the strategy started relatively well with a raising balance, then the balance quickly fallen, this downtrend in the balance lasted quite some time (almost 48 trades), the strategy finally recovered in Nov 2019 and the balance made a new highest high at the end of February. AMD had numerous trends during the backtesting period, yet results are poor.
AAPL:
Net Profit: $ -28.17
Total number of trades: 89
Profitability: 28.09 %
Profit Factor: 0.894
Max Drawdown: $ 63.21
AAPL show the poorest results so far, with a stationary balance around the initial capital (in short the evolution of the balance is not showing any particular trend and oscillate around the initial capital value).
AAPL had some significant retracements in its up-trend, which triggered some trades (of course), and the ranging period from Jan 24 to Feb 13 heavily damaged the strategy performance, generating 6 significant loosing trades. AAPL show the worst results so far, mostly due by ranging phases.
Conclusions
The Uhl MA crossover system strategy has been tested and based on the results don't show particularly interesting performances, and might even be outperformed by simpler MA systems that prove to be more robust against ranging markets. The total number of executed trades are on average 94, and the profitability is on average 31%. The strategy might prove more interesting if we can correct the behavior of the CMA, who sometimes converged toward ranging/flat markets.
Uhl MA Crossover SystemToday proposed indicator is based on the corrected moving average, an indicator originally proposed by Andreas Uhl professor at Salzburg University. This moving average is not the most well known, which is a pity since its design is extremely elegant.
The corrected moving average (CMA) is an adaptive moving average based on exponential averaging and aim to correct common problems of classical moving averages such as crosses occurring during sideway markets, more details will be introduced in the calculation section. The CMA aim to act as a slow moving average in a moving average crossover system.
Here a new fast adaptive moving average named corrected trend step (CTS) based on the CMA is introduced in order to provide a full moving average crossover system based on A. Uhl design.
To Andreas Uhl
Calculation And Understanding The CTS
Even if the code is quite compact, the original idea behind the CMA can be blurry for some users, however it is actually relatively simple to understand. The CMA is based on exponential averaging and a smoothing variable is therefore required, in the CMA the calculation of the smoothing variable is based on the squared distance between the precedent CMA output and a simple moving average, and the rolling variance, where the rolling variance act as threshold.
The CTS work the same way but instead of using the squared error between a simple moving average and the previous CMA output, we use the squared error between the closing price and the previous CTS output, this allow the CTS to better fit with the closing price. As said before the rolling variance act as threshold, if the squared error is lower than the rolling variance this mean that the CTS is close to the price, which can indicate a sideway market, therefore we should filter the entirety of the current price, therefore on sideways market the CTS is equal to the precedent value of the CTS.
In trending/volatile markets we expect the price to go away from the CTS, thus having an high squared error, if the squared error is greater than the rolling variance, the smoothing variable is equal to 1 - variance/squared error , here variance/squared error < 1 since the squared error is greater than the rolling variance ( remember that the smoothing variable need to be in a (0,1) range ), however if the squared error is way higher than variance this ratio will be small, which would return a non reactive output, but thats not what we want ! This is why we subtract 1 by this ratio in order to make the CTS more reactive instead of less reactive.
In case the squared error is greater than the rolling variance during sideway markets we would not expect a huge difference anyway, that is squared error ≈ variance and therefore:
1 - variance/squared error ≈ 1 - 1/1 ≈ 1 - 1 ≈ 0
This is a beautiful way to make an adaptive moving average, the CMA is not a flashy indicator, but when we look at the details behind the design we can only get amazed, or maybe that its just me, truly a great adaptive moving average.
The System
length control the filtering amount of both moving averages, with higher values of length returning larger filtering amount. Mult multiply the rolling variance by an user selected value, this also allow a greater amount of filtering.
The CTS act as a fast moving average while the CMA act as a slow moving average.
Here the indicator with length = 200, we can see how a sideway market who could have generated a large amount of signals don't affect our system.
Unlike classical crossovers systems where the slow moving average will rarely produce a cross with the fast moving average and price at the same time, the Uhl system can actually do that:
Conclusion
A moving average crossover system based on the corrected moving average proposed by Andreas Uhl has been presented, a new moving average that aim to produce good fits with the price has been created especially for this system. The logic behind the CMA has also been explained. A possible strategy analysis could be presented in the future.
In conclusion i would say the CMA is a bit underrated, in a field where arrows, signals, alerts are the only things appreciated by peoples, original content is slowly dying, this actually make today technical indicators have a pretty bad academic reputations. I'am afraid that today haiku master is Uhl rather than me, i hope to see more indicators from him in the future.
Thanks for reading !
Original paper: www.buero-uhl.de