Adaptive Kaufman Moving Average Trend Following Strategy
Overview
This strategy uses the Adaptive Moving Average indicator Kaufman's Adaptive Moving Average (KAMA) to track price trends and make long and short decisions to profit.
Strategy Logic
The calculation formula for Kaufman's Adaptive Moving Average (KAMA) indicator is:
nAMA = nz(nAMA[1]) + nsmooth * (Close - nz(nAMA[1]))
where:
nsmooth = (nefratio * (nfastend - nslowend) + nslowend)^2
nefratio = nsignal / nnoise
nsignal = |Close - Close[Length]|
nnoise = sum(|Close - Close[1]|, Length)
nfastend = 0.666
nslowend = 0.0645
This indicator takes into account both market volatility and price change trends, allowing it to track price trends more quickly. Specifically:
-
When market volatility is low, nsmooth is close to nslowend, and KAMA line changes slowly to suppress market noise.
-
When market volatility rises and a trend emerges, nsmooth approaches nfastend, and KAMA line changes rapidly to track the trend.
By comparing price with KAMA, the trend direction can be determined to make long and short decisions.
Advantages
The biggest advantage of this strategy is using the adaptive moving average indicator KAMA to track price trend changes, which can effectively reduce the impact of noise and improve tracking performance. Specific advantages:
-
KAMA indicator suppresses market noise and reduces unnecessary trade combinations.
-
KAMA indicator can respond quickly to price trend changes with good tracking effect.
-
The strategy decision rules are simple and clear, easy to understand and implement.
-
Reversal trading can be configured to suit different market environments.
Risks
There are also some risks with this strategy:
-
KAMA indicator may generate erroneous signals in choppy markets. Parameters can be adjusted for optimization.
-
Tracking lag exists, potentially missing short-term price reversals. Other indicators can be combined for diagnosis.
-
Trading costs and slippage are not considered, real performance would be weaker than backtest.
Enhancement Directions
This strategy can also be optimized in the following aspects:
-
Optimize KAMA parameters to improve indicator tracking sensitivity.
-
Add stop loss mechanism to limit maximum loss per trade.
-
Combine other indicators to filter signals and improve decision accuracy.
-
Add re-entry mechanism for further trend tracking.
Summary
This strategy uses Kaufman's Adaptive Moving Average to track price trends. The decision rules are simple and easy to implement for live trading. While suppressing noise, the indicator responds quickly to price changes with excellent tracking effect. It is a recommended trend following strategy worth trying out.
/*backtest
start: 2023-12-03 00:00:00
end: 2024-01-02 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=2
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 25/08/2017
// Everyone wants a short-term, fast trading trend that works without large- 1

